<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Hello<BR><DIV><DIV>On 17/05/2005, at 8:13 AM, Michael Stahl wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2">My dial plan seems to work great - in that when I call extensions 1234 it connects to 1234. Strangely, after the call terminates (the other side hangs up first), Asterisk continues in the same context and then matches to extensions _. which causes an invalid extension error!</FONT></SPAN></DIV> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2">Why does asterisk not leave the context (called internalmenu) after the remote hangup? Instead, it continues to the InternalInvalid context (included later in the InternalMenu context). I'm confused!</FONT></SPAN></DIV> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2"></FONT></SPAN> </DIV> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2">Here is a snippet of the relevant context and macro. Thanks,</FONT></SPAN></DIV> <DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2">Mike</FONT></SPAN></DIV><SPAN class="426590822-16052005"><FONT face="Arial" size="2"> <DIV> </DIV></FONT></SPAN></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>But that's exactly what your dialplan ask asterisk to do: keep doing stuff after the call has hanged up.</DIV><DIV>If you do not want to continue after Dial, then make sure there a Hangup and nothing else after that.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><BLOCKQUOTE type="cite"><SPAN class="426590822-16052005"><FONT face="Arial" size="2"> <DIV><BR>;****************************************************************<BR>; Macros<BR>;****************************************************************</DIV> <DIV> </DIV> <DIV>[macro-stdexten]<BR>;<BR>; Standard extension macro:<BR>; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well<BR>; ${ARG2} - Device(s) to ring<BR>;<BR>exten => s,1,Playback(transfer,skip) ; "Please hold while..." but skip if channel is not up<BR>;exten => s,2,SendText('Calling extension '${ARG1}) ; Tell the user what extension being called<BR>exten => s,2,SetVar(LastStatus=CallDone) ; Ensure script knows that a Dial was completed<BR>exten => s,3,Dial(${ARG2},${RINGTIME},r) ; Ring the interface, 20 seconds maximum<BR>exten => s,4,NoOp(${DIALSTATUS}) ; Show status after hangup<BR>exten => s,5,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)</DIV> <DIV><BR></DIV></FONT></SPAN></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>Here , you tell asterisk to Goto s-. after the Dial operation...</DIV><DIV><BR><BLOCKQUOTE type="cite"><SPAN class="426590822-16052005"><FONT face="Arial" size="2"><DIV> </DIV> <DIV>exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce</DIV> <DIV> </DIV> <DIV>exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce</DIV> <DIV> </DIV> <DIV>exten => s-ANSWER,1,NoOp ; If call answered, then do nothing after hangup</DIV> <DIV> </DIV> <DIV>exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer</DIV> <DIV> </DIV> <DIV>exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain</DIV> <DIV> </DIV> <DIV> </DIV> </FONT></SPAN></BLOCKQUOTE></DIV><DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">---</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Jean-Yves Avenard</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Hydrix Pty Ltd - Embedding the net</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">www.hydrix.com | fax +61 3 95722686 | office +61 3 8573 5299 | direct +61 3 8573 5200</FONT></P> </DIV><BR></BODY></HTML>