Re: [Asterisk-java-users] getChannelByName returning an old hungup channel instead of the current o
Brought to you by:
srt
From: Gaetan M. <gm...@ea...> - 2007-03-16 14:20:10
|
Hi Stefan Indeed the channel cannot be purged immediately for history. I just implemented a "getActiveChannelByName()" that excludes hungup channel while cycling through the list (but of course doesn't modify the list in ChannelManager) The king of problem I experienced is for example: 1/ Someone calls in through Zap/1-1. The call ends normally. The channel remains as hung up in the list for 15 mins. 2/ Someone calls in again through Zap/1-1 and goes to a queue. 3/ I receive a Queue event in which the channel specified is Zap/1-1. I have no uniqueId in those events so I have to use the name. 4/ I call AsteriskServer.getChannelByName("Zap/1-1"); and it returns the first old one that is hung up, not the new one. The same applies with park related events for example. I guess the same kind of problem should happen for the MeetMeManager is it uses getByName. Also, this can be problematic if someone uses getChannelByName and expects it to return null if there is no such channel in asterisk at this moment ("Is my zap line free ?"). Gaetan Stefan Reuter wrote: > Hi, > > can you provide some more information detailing what problems this > behavior causes for you? > The reason for the channels not being purged immediately is that in some > cases you want to lookup a channel to access its history even if it has > been hung up therefore the 15 minutes delay. > > =Stefan > > > Gaetan Minet wrote: > >> Hi >> >> I ran across a problem with getChannelByName in AsteriskServerImpl (and >> ChannelManager.getChannelImplByName). Indeed sometimes it returns and >> old HUNGUP channel that has not yet been purged (< 15 min) of the >> channels list. >> >> With SIP channels it is very infrequent as there is a session ID (4 or >> more alpha chars) in the channel name so there is room before we get >> another channel with the same name in the 15 min interval, >> but for Zap channels it is more frequent as there is no session ID added >> to the name so we may have more than one channel with the same name (one >> active and several old ones that are hung up). >> >> Most of the library internal code calls getChannelImplById not ByName, >> but with queues and parked calls events we only have a channel name in >> the event, not the Id (unless bristuffed version), and so we must find >> it by name; >> Should this be considered as a bug ? >> >> >> >> Gaetan >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys-and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |