Luca Casavola
2004-Nov-13 18:14 UTC
[Asterisk-Users] manager api: how to handle failed calls
Hello again, I am reposting this issue since I realized I posted in an existing thread ( I am sorry about that). I am still faced with the same problem since long time: The question is how to correctly handle failed calls. In my application I want to make hundreds of outgoing calls automatically. When the callee pick up the phone he gets a playback message and give an acknowledge by means of dtmf code. I make use of manager command originate, something like Action:originate channel: ZAP/g1/XXXX Variable:X|Y|Z extension: test the extension test is something like [test] exten s,1 , wait () exten s, 2 , answer () exten s, 3 playback(XX) The problem is since I don't use the application dial inside the extension I cannot get any value from DIALSTATUS or HANGUPCAUSE variable I tried several strategies: 1) change the logic and use local pseudo channel In the originate command if I use channel: local/XXXXX@test1/n where test1 is: [test1] exten => _.,1,Dial(ZAP/g1/g${EXTEN}) exten => _.,2,NoOp( 2 HANGUPCAUSE is ${HANGUPCAUSE}) exten => _.,3,NoOp( 2 DIALSTATUS is ${DIALSTATUS}) exten => _.,4,NoOp( number is ${number}) exten => _.,5,Hangup I got the correct HANGUP value ( ie BUSY) but unfortunately I cannot see the variables set on the originate command. I wonder why not? 2) I tried to use the Async=True parameter in the originate command and magically * make a goto to extent failed. Unfortunately in such extension I can't see any value in HANGUPCAUSE or DIALSTATUS. Why? 3) this is the strategy I am currently using In the manager api when I send the originate command I wait for the response: if it is Error - reason : Originate failed I assume that such a call fails for one of this reason: busy, chan unavailable, wrong number. Unfortunately this solution, even not giving detailed information about the reason of failure doesn't work any more with a new pri line the italian pri provider telecom installed recently. With this pri interface , the originate command now return Success: Call queueed even if the line is busy. This is a very strange behaviour probably due to a pri different information not correctly catched. So how can I know what is going on when a call fail? Regards -- Ing. Luca Casavola (Technical Manager) Software Products Italia Milano / Roma / Firenze tel. ++39 055/33651 fax ++39 055/340558 e-mail: luca.casavola@softpi.it www: http://www.softpi.it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20041113/57408516/attachment.htm
Nicolás Gudiño
2004-Nov-14 07:52 UTC
[Asterisk-Users] manager api: how to handle failed calls
Hello, Comments inline..> The question is how to correctly handle failed calls. > In my application I want to make hundreds of outgoing calls automatically. > When the callee pick up the phone he gets a playback message and give an > acknowledge by means of dtmf code. > I make use of manager command originate, something like > Action:originate > channel: ZAP/g1/XXXX > Variable:X|Y|Z > extension: test > the extension test is something like > [test] > exten s,1 , wait () > exten s, 2 , answer () > exten s, 3 playback(XX) > The problem is since I don't use the application dial inside the extension > I cannot get any value from > DIALSTATUS or HANGUPCAUSE variable > I tried several strategies: > 1) > change the logic and use local pseudo channel > In the originate command if I use channel: local/XXXXX@test1/n > where test1 is: > [test1] > exten => _.,1,Dial(ZAP/g1/g${EXTEN}) > exten => _.,2,NoOp( 2 HANGUPCAUSE is ${HANGUPCAUSE}) > exten => _.,3,NoOp( 2 DIALSTATUS is ${DIALSTATUS}) > exten => _.,4,NoOp( number is ${number}) > exten => _.,5,Hangup > > I got the correct HANGUP value ( ie BUSY) but unfortunately I cannot see > the variables set on the originate command. > I wonder why not?Maybe, (just maybe, I did not try it myself) the originate variables are passed using asterisk CVS-HEAD and variable names prefixed with underscore... Eg: Use variable _X instead of X in the originate command. Let me know if it works. Regards, -- Nicol?s Gudi?o Buenos Aires - Argentina
Lior Mizrahi
2005-May-02 13:54 UTC
[Asterisk-Users] manager api: how to handle failed calls
Hi Luca, I am trying to implement your solution for outbound calls through Manager API and I get OutgoingSpoolFailed. Did it work for you? Can you give me more details about your example? Thanks a lot, Lior -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050503/7c8ba616/attachment.htm