Thread: [Asterisk-java-users] Execute AMD() inside a forwarded call by AGI
Brought to you by:
srt
From: Zoumana T. <zou...@gm...> - 2014-05-30 14:01:46
|
Hi every body, I am dealing with a use case within an IVR (driven by AJ AGI) received call 1. Play audio to announce the call forward 2. Make the forward using Dial 3. When the forwarded called is answered, execute an AMD() command to detect the status DURING THE call public void service(AgiRequest request, AgiChannel channel) throws AgiException { channel.answer(); channel.streamFile("svi/transfer-announce"); channel.exec("Dial", "SIP/200"); channel.exec("AMD"); channel.getVariable("AMD_STATUS"); channel.hangup(); } But as AGI lines are sequential, my AMD command come up when the forwarded call is already hangup so i got nothing. Somebody sees a solution or workaround for this? Thanks, Zoumana *---* *Zoumana TRAORE* |
From: Yves A. <yv...@gm...> - 2014-05-31 11:00:08
|
Hi, this will surely be possible. Due to lack of time I cant give you a fully working example, but it is not to hard. 1.) Read about using "local channels" 2.) after that... dont "dial" your extension directly but "dial" into another part of your dialplan (yet to write), where you handle dialling the extension amd AMDing and so on... regards, yves Am 30.05.2014 16:01, schrieb Zoumana TRAORE: > Hi every body, > > I am dealing with a use case within an IVR (driven by AJ AGI) received > call > 1. Play audio to announce the call forward > 2. Make the forward using Dial > 3. When the forwarded called is answered, execute an AMD() command to > detect the status DURING THE call > > public void service(AgiRequest request, AgiChannel channel) > throws AgiException { > > channel.answer(); > channel.streamFile("svi/transfer-announce"); > channel.exec("Dial", "SIP/200"); > channel.exec("AMD"); > channel.getVariable("AMD_STATUS"); > channel.hangup(); > } > > But as AGI lines are sequential, my AMD command come up when the > forwarded call is already hangup so i got nothing. Somebody sees a > solution or workaround for this? > > > Thanks, > Zoumana > > *--- > * > > *Zoumana TRAORE* > > > > ------------------------------------------------------------------------------ > Time is money. Stop wasting it! Get your web API in 5 minutes. > www.restlet.com/download > http://p.sf.net/sfu/restlet > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Murthy G. <mga...@nt...> - 2014-06-13 02:05:12
|
Hi Yves or anyone who cares to answer, I am using setAutoHangup(20) in my AGI script. Then I do a DB look up that can take potentially longer than 20 seconds as follows: try { setAutoHangup(20); call-a-very-long-db-access-method(); } catch (Exception e) { } In my dialplan I call the AGI as : exten = 2,n(lookup-agent), agi(agi://${JAVA-AGI-SERVER}/lookupAgent.agi) exten = 2,n, VERBOSE(back from agi) During testing I find that "back from agi" is never printed soon after 20 seconds. In other words, the agi call in the dial plan is waiting for the return from the service method in the LookupAgent. Is this a flaw or by design? How can I return from LookupAgent after 20 seconds without async? Thanks for your help. Murthy |
From: Yves A. <yv...@gm...> - 2014-06-15 10:56:49
|
Hi, Take a look at the h - priority... this part of the dialplan becomes executed after hangup. But more important for me, as I think there might be a smarter solution...: what is your objective? Why auto-hangup the call at all? yves Am 13.06.2014 03:06, schrieb Murthy Gandikota: > > Hi Yves or anyone who cares to answer, > > I am using setAutoHangup(20) in my AGI script. Then I do a DB look up > that can take potentially longer than 20 seconds as follows: > > try { > > setAutoHangup(20); > > call-a-very-long-db-access-method(); > > } catch (Exception e) { > > } > > In my dialplan I call the AGI as : > > exten = 2,n(lookup-agent), agi(agi://${JAVA-AGI-SERVER}/lookupAgent.agi) > > exten = 2,n, VERBOSE(back from agi) > > During testing I find that "back from agi" is never printed soon after > 20 seconds. In other words, the agi call in the dial plan is waiting > for the return from the service method in the LookupAgent. > > Is this a flaw or by design? How can I return from LookupAgent after > 20 seconds without async? > > Thanks for your help. > > Murthy > > > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Murthy G. <mga...@nt...> - 2014-06-16 14:44:18
|
Hi Yves Used h - priority. The dial plan execution stops at the AGI call even after auto hangup duration exceeded. With regards to objective: I have a DB intensive method that can take longer than 20 seconds when there is too much activity. If the duration of the method call exceeds the time limit, I would like to abandon it and return to the dial plan with an error message like ("Sorry, could not look up an agent"). If you could please suggest an alternative I would appreciate it. Thanks Murthy ________________________________ From: Yves A. [mailto:yv...@gm...] Sent: Sunday, June 15, 2014 3:57 AM To: ast...@li... Subject: Re: [Asterisk-java-users] How to continue dialplan execution after autohangup? Hi, Take a look at the h - priority... this part of the dialplan becomes executed after hangup. But more important for me, as I think there might be a smarter solution...: what is your objective? Why auto-hangup the call at all? yves Am 13.06.2014 03:06, schrieb Murthy Gandikota: Hi Yves or anyone who cares to answer, I am using setAutoHangup(20) in my AGI script. Then I do a DB look up that can take potentially longer than 20 seconds as follows: try { setAutoHangup(20); call-a-very-long-db-access-method(); } catch (Exception e) { } In my dialplan I call the AGI as : exten = 2,n(lookup-agent), agi(agi://${JAVA-AGI-SERVER}/lookupAgent.agi) exten = 2,n, VERBOSE(back from agi) During testing I find that "back from agi" is never printed soon after 20 seconds. In other words, the agi call in the dial plan is waiting for the return from the service method in the LookupAgent. Is this a flaw or by design? How can I return from LookupAgent after 20 seconds without async? Thanks for your help. Murthy ------------------------------------------------------------------------ ------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Zoumana T. <zou...@gm...> - 2014-05-31 12:16:47
|
Hi, Thanks for the guidelines. I've just read a bit more about local channels, you mean doing something like this: -turn AGI short into channel.answer(); channel.exec("Dial", Local/1@amd"); -add into the dialplan file something like [amd] exten => 1,1,Dial(SIP/200) exten => 1,2,AMD() ... While waiting for your return, i will test that out. Thanks, Zoumana *--- * *Zoumana TRAORE* 2014-05-31 13:00 GMT+02:00 Yves A. <yv...@gm...>: > Hi, > > this will surely be possible. Due to lack of time I cant give you a fully > working example, but it is not to hard. > 1.) Read about using "local channels" > 2.) after that... dont "dial" your extension directly but "dial" into > another part of your dialplan (yet to write), where you handle dialling > the extension amd AMDing and so on... > > regards, > yves > > Am 30.05.2014 16:01, schrieb Zoumana TRAORE: > > Hi every body, > > I am dealing with a use case within an IVR (driven by AJ AGI) received > call > 1. Play audio to announce the call forward > 2. Make the forward using Dial > 3. When the forwarded called is answered, execute an AMD() command to > detect the status DURING THE call > > public void service(AgiRequest request, AgiChannel channel) > throws AgiException { > > channel.answer(); > channel.streamFile("svi/transfer-announce"); > channel.exec("Dial", "SIP/200"); > channel.exec("AMD"); > channel.getVariable("AMD_STATUS"); > channel.hangup(); > } > > But as AGI lines are sequential, my AMD command come up when the > forwarded call is already hangup so i got nothing. Somebody sees a solution > or workaround for this? > > > Thanks, > Zoumana > > > *--- * > > *Zoumana TRAORE* > > > ------------------------------------------------------------------------------ > Time is money. Stop wasting it! Get your web API in 5 minutes.www.restlet.com/downloadhttp://p.sf.net/sfu/restlet > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Time is money. Stop wasting it! Get your web API in 5 minutes. > www.restlet.com/download > http://p.sf.net/sfu/restlet > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Zoumana T. <zou...@gm...> - 2014-06-02 18:42:53
|
Hi Yves, I've tried the previous code, here is the behavior: -AGI Answer and trigger Local Channel -Dialplan takes over and make the "real" Dial and block to this instruction during the call -When the called party hangup, the call is back inside the AGI code: the others instructions in the diaplan are not executed at all: AMD() and so on Any leads/explanations? I will keep digging on local channels Thank you all *---* *Zoumana TRAORE* 2014-05-31 14:16 GMT+02:00 Zoumana TRAORE <zou...@gm...>: > Hi, > > Thanks for the guidelines. > I've just read a bit more about local channels, you mean doing something > like this: > > -turn AGI short into > > channel.answer(); > channel.exec("Dial", Local/1@amd"); > > -add into the dialplan file something like > > [amd] > exten => 1,1,Dial(SIP/200) > exten => 1,2,AMD() > ... > > While waiting for your return, i will test that out. > Thanks, > Zoumana > > > > *--- * > > *Zoumana TRAORE* > > > 2014-05-31 13:00 GMT+02:00 Yves A. <yv...@gm...>: > > Hi, >> >> this will surely be possible. Due to lack of time I cant give you a fully >> working example, but it is not to hard. >> 1.) Read about using "local channels" >> 2.) after that... dont "dial" your extension directly but "dial" into >> another part of your dialplan (yet to write), where you handle dialling >> the extension amd AMDing and so on... >> >> regards, >> yves >> >> Am 30.05.2014 16:01, schrieb Zoumana TRAORE: >> >> Hi every body, >> >> I am dealing with a use case within an IVR (driven by AJ AGI) received >> call >> 1. Play audio to announce the call forward >> 2. Make the forward using Dial >> 3. When the forwarded called is answered, execute an AMD() command to >> detect the status DURING THE call >> >> public void service(AgiRequest request, AgiChannel channel) >> throws AgiException { >> >> channel.answer(); >> channel.streamFile("svi/transfer-announce"); >> channel.exec("Dial", "SIP/200"); >> channel.exec("AMD"); >> channel.getVariable("AMD_STATUS"); >> channel.hangup(); >> } >> >> But as AGI lines are sequential, my AMD command come up when the >> forwarded call is already hangup so i got nothing. Somebody sees a solution >> or workaround for this? >> >> >> Thanks, >> Zoumana >> >> >> *--- * >> >> *Zoumana TRAORE* >> >> >> ------------------------------------------------------------------------------ >> Time is money. Stop wasting it! Get your web API in 5 minutes.www.restlet.com/downloadhttp://p.sf.net/sfu/restlet >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Time is money. Stop wasting it! Get your web API in 5 minutes. >> www.restlet.com/download >> http://p.sf.net/sfu/restlet >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > |