<DIV>In my [incoming] context I have something like this:<BR>exten => 8885861575,1,Macro(vrforward,${EXTEN},8136361451)</DIV>
<P><BR>And thie Macro contains this:<BR>[macro-vrforward]<BR>exten => s,1,GotoIF($[${CALLERIDNUM} = 9545551111]?40:2)<BR>exten => s,2,SetGroup(${ARG1})<BR>exten => s,3,CheckGroup(3)<BR>exten => s,4,SetAccount(${ARG1})<BR>exten => s,5,Dial(<A href="mailto:SIP/1${ARG2}@termprovider,30,o">SIP/1${ARG2}@termprovider,30,o</A>)<BR>exten => s,40,AGI(checkin|${ARG1})<BR>exten => s,41,Hangup<BR></P>
<P>Now, when I use my other server to set the caller ID to 9545551111 and place the call, I get this strange loop:</P>
<P>server*CLI><BR> -- Executing Macro("SIP/5060-0825a308", "vrforward|8885861575|8136361451") in new stack<BR> -- Executing GotoIf("SIP/5060-0825a308", "1?40:2") in new stack<BR> -- Goto (macro-vrforward,s,40)<BR> -- Executing AGI("SIP/5060-0825a308", "checkin|8885861575") in new stack<BR> -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin</P>
<P> -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR> -- Executing GotoIf("SIP/5060-0829c958", "1?40:2") in new stack<BR> -- Goto (macro-vrforward,s,40)<BR> -- Executing AGI("SIP/5060-0829c958", "checkin|8885861575") in new stack<BR> -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin<BR> -- AGI Script checkin completed, returning 0<BR> -- Executing Hangup("SIP/5060-0825a308", "") in new stack<BR> == Spawn extension (macro-vrforward, s, 41) exited non-zero on 'SIP/5060-0825a308' in macro 'vrforward'<BR> == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0825a308'<BR> -- AGI Script checkin completed, returning 0<BR> -- Executing Hangup("SIP/5060-0829c958", "") in new stack<BR> == Spawn extension (macro-vrforward, s, 41) exited non-zero
on 'SIP/5060-0829c958' in macro 'vrforward'<BR> == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0829c958'</P>
<P> -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR> -- Executing GotoIf("SIP/5060-0829c958", "1?40:2") in new stack<BR> -- Goto (macro-vrforward,s,40)<BR> -- Executing AGI("SIP/5060-0829c958", "checkin|8885861575") in new stack<BR> -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin<BR> -- AGI Script checkin completed, returning 0<BR> -- Executing Hangup("SIP/5060-0829c958", "") in new stack<BR> == Spawn extension (macro-vrforward, s, 41) exited non-zero on 'SIP/5060-0829c958' in macro 'vrforward'<BR> == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0829c958'<BR> -- Accepting AUTHENTICATED call from 209.237.227.185, requested format = 4, actual format = 4<BR> -- Executing SetCIDNum("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>",
"") in new stack<BR> -- Executing SetGroup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "NOC Phone") in new stack<BR> -- Executing CheckGroup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "3") in new stack<BR> -- Executing Dial("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "<A href="mailto:SIP/18885861575@termprovider|30|o">SIP/18885861575@termprovider|30|o</A>") in new stack<BR> -- Called <A href="mailto:18885861575@termprovider">18885861575@termprovider</A></P>
<P> -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR> -- Executing GotoIf("SIP/5060-0829c958", "0?40:2") in new stack<BR> -- Goto (macro-vrforward,s,2)<BR> -- Executing SetGroup("SIP/5060-0829c958", "8885861575") in new stack<BR> -- Executing CheckGroup("SIP/5060-0829c958", "3") in new stack<BR> -- Executing SetAccount("SIP/5060-0829c958", "000-8885861575") in new stack<BR> -- Executing Dial("SIP/5060-0829c958", "<A href="mailto:SIP/18136361451@termprovider|30|o">SIP/18136361451@termprovider|30|o</A>") in new stack<BR> -- Called <A href="mailto:18136361451@termprovider">18136361451@termprovider</A><BR> -- SIP/termprovider-d337 is making progress passing it to SIP/5060-0829c958<BR> -- SIP/termprovider-a01f is making progress passing it to <A
href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A><BR> == Spawn extension (company-vr1, 18885861575, 4) exited non-zero on <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR> -- Executing Hangup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "") in new stack<BR> == Spawn extension (company-vr1, h, 1) exited non-zero on <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR> -- Hungup <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR> == Spawn extension (macro-vrforward, s, 5) exited non-zero on 'SIP/5060-0829c958' in macro 'vrforward'<BR> == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0829c958'<BR></P>
<P>My Macro is a simple shell script:</P>
<P>#!/bin/sh</P>
<P>lynx -dump 'http://www.ourdomain.com/manual.php?pg=admin/cronjobs/origination-check2&i_did='$1<BR></P>
<P> </P>
<P>------------</P>
<P>Why is it looping? It executes the right goto once, and then it starts all over again, and does it right again, and then starts over and this time sends it to the forwarded number, and the receiver gets the callerid all messed up, either all 0's or some strange local number, probably the local provider being used number. The hangup doesn't terminate the channel, it just cyles again, after enough cycles the caller id gets lost and then ends up terminating. This system is designed to test our origination numbers, if we call any of our numbers with that specific caller id, the system should redirect it to an agi which sends it to a url to be added to a database. Then using Nagios we can check that url and make sure our numbers are all working.</P>
<P>I've tried Answer, AGI, Hangup but to no avail. I then tried DeadAGI, Hangup, to no avail. So what's going on?</P><p>
                <hr size=1>Yahoo! Mail Mobile<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/mobile/*http://mobile.yahoo.com/learn/mail">Take Yahoo! Mail with you!</a> Check email on your mobile phone.