<DIV>In my [incoming] context I have something like this:<BR>exten =&gt; 8885861575,1,Macro(vrforward,${EXTEN},8136361451)</DIV>
<P><BR>And thie Macro contains this:<BR>[macro-vrforward]<BR>exten =&gt; s,1,GotoIF($[${CALLERIDNUM} = 9545551111]?40:2)<BR>exten =&gt; s,2,SetGroup(${ARG1})<BR>exten =&gt; s,3,CheckGroup(3)<BR>exten =&gt; s,4,SetAccount(${ARG1})<BR>exten =&gt; s,5,Dial(<A href="mailto:SIP/1${ARG2}@termprovider,30,o">SIP/1${ARG2}@termprovider,30,o</A>)<BR>exten =&gt; s,40,AGI(checkin|${ARG1})<BR>exten =&gt; 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&nbsp;strange loop:</P>
<P>server*CLI&gt;<BR>&nbsp;&nbsp;&nbsp; -- Executing Macro("SIP/5060-0825a308", "vrforward|8885861575|8136361451") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing GotoIf("SIP/5060-0825a308", "1?40:2") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Goto (macro-vrforward,s,40)<BR>&nbsp;&nbsp;&nbsp; -- Executing AGI("SIP/5060-0825a308", "checkin|8885861575") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin</P>
<P>&nbsp;&nbsp;&nbsp; -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing GotoIf("SIP/5060-0829c958", "1?40:2") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Goto (macro-vrforward,s,40)<BR>&nbsp;&nbsp;&nbsp; -- Executing AGI("SIP/5060-0829c958", "checkin|8885861575") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin<BR>&nbsp;&nbsp;&nbsp; -- AGI Script checkin completed, returning 0<BR>&nbsp;&nbsp;&nbsp; -- Executing Hangup("SIP/5060-0825a308", "") in new stack<BR>&nbsp; == Spawn extension (macro-vrforward, s, 41) exited non-zero on 'SIP/5060-0825a308' in macro 'vrforward'<BR>&nbsp; == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0825a308'<BR>&nbsp;&nbsp;&nbsp; -- AGI Script checkin completed, returning 0<BR>&nbsp;&nbsp;&nbsp; -- Executing Hangup("SIP/5060-0829c958", "") in new stack<BR>&nbsp; == Spawn extension (macro-vrforward, s, 41) exited non-zero
 on 'SIP/5060-0829c958' in macro 'vrforward'<BR>&nbsp; == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0829c958'</P>
<P>&nbsp;&nbsp;&nbsp; -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing GotoIf("SIP/5060-0829c958", "1?40:2") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Goto (macro-vrforward,s,40)<BR>&nbsp;&nbsp;&nbsp; -- Executing AGI("SIP/5060-0829c958", "checkin|8885861575") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Launched AGI Script /var/lib/asterisk/agi-bin/checkin<BR>&nbsp;&nbsp;&nbsp; -- AGI Script checkin completed, returning 0<BR>&nbsp;&nbsp;&nbsp; -- Executing Hangup("SIP/5060-0829c958", "") in new stack<BR>&nbsp; == Spawn extension (macro-vrforward, s, 41) exited non-zero on 'SIP/5060-0829c958' in macro 'vrforward'<BR>&nbsp; == Spawn extension (company-in, 8885861575, 1) exited non-zero on 'SIP/5060-0829c958'<BR>&nbsp;&nbsp;&nbsp; -- Accepting AUTHENTICATED call from 209.237.227.185, requested format = 4, actual format = 4<BR>&nbsp;&nbsp;&nbsp; -- Executing SetCIDNum("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>",
 "") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing SetGroup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "NOC Phone") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing CheckGroup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "3") in new stack<BR>&nbsp;&nbsp;&nbsp; -- 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>&nbsp;&nbsp;&nbsp; -- Called <A href="mailto:18885861575@termprovider">18885861575@termprovider</A></P>
<P>&nbsp;&nbsp;&nbsp; -- Executing Macro("SIP/5060-0829c958", "vrforward|8885861575|8136361451") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing GotoIf("SIP/5060-0829c958", "0?40:2") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Goto (macro-vrforward,s,2)<BR>&nbsp;&nbsp;&nbsp; -- Executing SetGroup("SIP/5060-0829c958", "8885861575") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing CheckGroup("SIP/5060-0829c958", "3") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing SetAccount("SIP/5060-0829c958", "000-8885861575") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Executing Dial("SIP/5060-0829c958", "<A href="mailto:SIP/18136361451@termprovider|30|o">SIP/18136361451@termprovider|30|o</A>") in new stack<BR>&nbsp;&nbsp;&nbsp; -- Called <A href="mailto:18136361451@termprovider">18136361451@termprovider</A><BR>&nbsp;&nbsp;&nbsp; -- SIP/termprovider-d337 is making progress passing it to SIP/5060-0829c958<BR>&nbsp;&nbsp;&nbsp; -- SIP/termprovider-a01f is making progress passing it to <A
 href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A><BR>&nbsp; == Spawn extension (company-vr1, 18885861575, 4) exited non-zero on <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR>&nbsp;&nbsp;&nbsp; -- Executing Hangup("<A href="mailto:IAX2/vr1@vr1/14">IAX2/vr1@vr1/14</A>", "") in new stack<BR>&nbsp; == Spawn extension (company-vr1, h, 1) exited non-zero on <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR>&nbsp;&nbsp;&nbsp; -- Hungup <A href="mailto:'IAX2/vr1@vr1/14'">'IAX2/vr1@vr1/14'</A><BR>&nbsp; == Spawn extension (macro-vrforward, s, 5) exited non-zero on 'SIP/5060-0829c958' in macro 'vrforward'<BR>&nbsp; == 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&amp;i_did='$1<BR></P>
<P>&nbsp;</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.&nbsp; 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&nbsp; 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.