<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.18">
<TITLE>Asterisk Manager Problem</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">I am</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">originating</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> a call to a Local channel using</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> an</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> Originate Action:</FONT></SPAN></P>
<UL DIR=LTR><UL DIR=LTR>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Action: Originate</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Channel: Local/dial@outdi</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">al</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Context: outdial</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Exten: answer</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Priority: 1</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Timeout: 45000</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">ActionID: some_id</FONT></SPAN></P>
</UL></UL>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">In my dialplan, I have this:</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<UL DIR=LTR><UL DIR=LTR>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">[outdial]</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => dial,</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">1</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">,Dial(${DIAL_STRING}, ${DIAL_TIMEOUT})</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => dial,n,NoOp(Dial Status = ${DIALSTATUS})</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => dial,n,Agi(agi://localhost/Outdial.agi, ${DIAL_STRING})</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => dial,n,Hangup()</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => answer,1,NoOp(Dial Status = ${DIALSTATUS})</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => answer,n,Playback(${GREETING_NAME})</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => answer,n,WaitForSilence(2000)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => answer,n,Agi(agi://localhost/Outdial.agi)</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">exten => answer,n,Hangup()</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
</UL></UL>
<P DIR=LTR><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Everything seems to work fine so long as the Dial command e</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">xecutes successfully. </FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">For example, if someone picks up the other end after the Dial command completes, processing jumps to the</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">“</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">answer</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">”</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> extension as expected. If no one ever answers and the Dial command times out,</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">processing continues on with the next priority of the</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">“</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">dial</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">”</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> extension, again as expected.</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">However, if someone sets a bad DIAL_STRING (such as using a channel that doesn</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">t exist), things start to behave oddly. It continues on in the next priority of the</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">“</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">d</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">ial</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">”</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"></FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">extension</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> (</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">as I would expect). However, as soon as it executes the call to the AGI script, it also starts processing the</FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">“</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">answer</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">”</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> extension at the same time.</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri"> </FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">As a result, I end up with two calls into my AGI scrip</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">t</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">. </FONT></SPAN><SPAN LANG="en-us"> <FONT FACE="Calibri">Unfortunately, I don</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">t know what I</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">’</FONT></SPAN><SPAN LANG="en-us"><FONT FACE="Calibri">m doing wrong here.</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Thanks,</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">Deric Page</FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">-- </FONT></SPAN></P>
<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">deric.page@nisc.coop</FONT></SPAN><SPAN LANG="en-us"></SPAN></P>
</BODY>
</HTML>