Re: [Asterisk-java-users] AGI Thread does not break at call Hangup
Brought to you by:
srt
From: Zoumana T. <zou...@gm...> - 2014-04-03 10:51:00
|
Hi Yves, Thanks, yes maybe. But i will stick for the moment to the 0.3.1 as 1.0.0 is still a milestone and we are on production + i have wrote some codes on 0.3.1 thread pool and queue management for our needs. I will wait 1.0.0 to go general availability to migrate. Following your track on *channel.getChannelStatus* and doing something like this: * public void service(AgiRequest request, AgiChannel channel) throws AgiException { boolean hangup = false; while(channel.getChannelStatus() != -1 && !hangup){ for(int i=0; i <3; i++){ System.out.println("playing"+(i+1)); System.out.println("channelStatus="+channel.getChannelStatus()); channel.streamFile("svi/jingle"); if(i==2){ hangup=true; } if(channel.getChannelStatus() == -1){ break; } } } hangup();* * }* I've reached the expected behaviour. Many Thanks Regards, Zoumana *---* *Zoumana TRAORE* mob. (+33)0699783622 2014-04-03 12:21 GMT+02:00 Yves A. <yv...@gm...>: > hi, > > please upgrade to latest asterisk-java first... it is somewhat 1.x.x now. > this might already bring the expected behaviour. > > regards, > yves > > Am 03.04.2014 01:45, schrieb Zoumana TRAORE: > > Hi Yves, > > Thanks for helping me out. > Yes, i found that strange too. > Asterisk 11.5 > AJ 0.3.1 > > Here is the code: > public void service(AgiRequest request, AgiChannel channel) throws > AgiException { > > for(int i=0; i <3; i++){ > System.out.println("playing"+(i+1)); > > System.out.println("channelStatus="+channel.getChannelStatus()); > channel.streamFile("svi/jingle"); > } > hangup(); > } > > > Here is the output (there is something interesting indeed, > channelStatus=-1 after my hangup, i could try to use that for my need if > nobody sees something more suitable) > INFO: Begin AgiScript SVILegoAgi on Asterisk-Java DaemonPool-1-thread-1 > playing1 > channelStatus=6 > playing2 > channelStatus=-1 > playing3 > channelStatus=-1 > Apr 3, 2014 1:42:37 AM > org.asteriskjava.fastagi.internal.AgiConnectionHandler runScript > INFO: End AgiScript SVILegoAgi on Asterisk-Java DaemonPool-1-thread-1 > > Thanks > > > > > *--- * > > *Zoumana TRAORE* > > mob. (+33)0699783622 > > > 2014-04-03 1:17 GMT+02:00 Yves A. <yv...@gm...>: > >> hi, >> >> normally you would get an exception at any method that accesses a hungup >> channel. this bevaviour is strange. >> which version of asterisk and aj are you using? >> add a system.out.println(channel.getChannelStatus()); before streaming >> and post the output... >> >> yves >> >> Am 03.04.2014 00:46, schrieb Zoumana TRAORE: >> >> Hi everybody, >> >> During an incoming call handled by AGI, i would like to detect >> where the caller hangup and then break the IVR scenario at this precise >> point. >> >> For example: >> Here is my AGI content: >> >> >> >> >> >> >> >> >> >> * public void service(AgiRequest request, AgiChannel channel) throws >> AgiException { for(int i=0; i <3; i++){ >> System.out.println("playing"+(i+1)); >> channel.streamFile("svi/jingle"); } hangup(); } * >> Each audio play has 7 seconds duration. >> Even i hangup the call during the "playing 1", AGI keeps executing all >> the sequences. >> This is the output: >> >> >> >> >> >> >> >> *INFO: Begin AgiScript SVILegoAgi on Asterisk-Java DaemonPool-1-thread-1 >> playing1 playing2 playing3 Apr 3, 2014 12:26:52 AM >> org.asteriskjava.fastagi.internal.AgiConnectionHandler runScript INFO: End >> AgiScript SVILegoAgi on Asterisk-Java DaemonPool-1-thread-1 * >> Thanks! >> >> Regards, >> Zoumana >> >> >> ------------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |