I'm trying to write a dialplan that will allow me to "stress" test it. I want to be able to dial an extension, or pretend that the extension is busy or out of order (so that I can see what to do) given the dialplan snippet: [outbound] exten => _X.,1,NoOp(${TEST}) exten => _X.,n,Dial(SIP/${EXTEN}) exten => Busy,1,Busy(2) exten => Busy,n,Hangup() exten => Congestion,1,Congestion(2) exten => Congestion,n,Hangup() exten => NoAnswer,1,Wait(10) exten => NoAnswer,n,Hangup() exten => h,1,NoOp(XXXXXXXXX) exten => h,n,NoOp(${DIALSTATUS}:${HANGUPCAUSE}) why if I call the Busy or Congestion extensions, the DIALSTATUS and HANGUPCAUSE variables are not set ? If I call the NoAnswer extension, DIALSTATUS is blank and hangupcause is 16. I presume that this is correct ? If I call (say) extension 1234 all things are set ok. Julian.
On Fri, 2007-08-03 at 19:58 +0100, Julian Lyndon-Smith wrote:> why if I call the Busy or Congestion extensions, the DIALSTATUS and > HANGUPCAUSE variables are not set ?The DIALSTATUS channel variable is set when you call the Dial() application. If you don't call the Dial() application (like if you called the Congestion extension directly in your example), then it won't be set. -- Jared Smith Community Relations Manager Digium, Inc.
On 8/3/07, Julian Lyndon-Smith <asterisk at dotr.com> wrote:> > why if I call the Busy or Congestion extensions, the DIALSTATUS and > HANGUPCAUSE variables are not set ? > > If I call (say) extension 1234 all things are set ok.I think you've answered your own question there. The only asterisk application that sets DIALSTATUS is Dial(). If you grep the source, you'll see that the value is retrieved by some other modules (chan_sip, chan_iax, etc.), but only Dial() sets the value of the variable. I assume when you say "when I call the Busy extension" you mean something like a SIP user whose context is "outgoing" doing an INVITE to " Busy at yourasterisk". If so, you're bridging a SIP call leg to an asterisk application, so Dial() isn't invoked and DIALSTATUS isn't set. It might work if you did an invite to an extension that used Dial() to call a Local channel (e.g. Local/Busy at outgoing), but I'm not sure how DIALSTATUS would interact with the /n option on the local channel. -- j. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070803/1ddb4d0b/attachment.htm