Hi,<div><br></div><div>With Asterisk 1.8.3, I can&#39;t figure out how to pass an argument to a macro which is used within an originate command.</div><div>Here is my sample dialplan to illustrate:</div><div><br></div><div>
<div><font class="Apple-style-span" color="#3333FF">exten =&gt; 123,1,Answer()</font></div><div><font class="Apple-style-span" color="#3333FF">exten =&gt; 123,n,Originate(SIP/20,app,Macro,foo,bar)</font></div><div><font class="Apple-style-span" color="#3333FF">exten =&gt; 123,n,NoOp(This is the NoOp after the originate command)</font></div>
<div><font class="Apple-style-span" color="#3333FF">exten =&gt; 123,n,Wait(30)</font></div><div><font class="Apple-style-span" color="#3333FF">exten =&gt; 123,n,Hangup()</font></div><div><font class="Apple-style-span" color="#3333FF"><br>
</font></div><div><font class="Apple-style-span" color="#3333FF">[macro-foo]</font></div><div><font class="Apple-style-span" color="#3333FF">exten =&gt; s,1,Answer()</font></div><div><font class="Apple-style-span" color="#3333FF">exten =&gt; s,2,NoOp(arg1 is ${ARG1} and arg2 is ${ARG2})</font></div>
<div><font class="Apple-style-span" color="#3333FF">exten =&gt; s,3,Playback(tt-monkeys)</font></div></div><div><br></div><div>I was hoping the ${ARG1} within the macro would be &#39;bar&#39;, but the argument does not seem to be passed on to the macro so far as I can tell.</div>
<div>Here is the CLI output:</div><div><br></div><div><div><font class="Apple-style-span" color="#3333FF">pbx*CLI&gt; </font></div><div><font class="Apple-style-span" color="#3333FF">  == Using SIP RTP TOS bits 184</font></div>
<div><font class="Apple-style-span" color="#3333FF">  == Using SIP RTP CoS mark 5</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [123@from-internal:1] Answer(&quot;SIP/21-0000000c&quot;, &quot;&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [123@from-internal:2] Originate(&quot;SIP/21-0000000c&quot;, &quot;SIP/20,app,Macro,foo,bar&quot;) in new stack</font></div><div><font class="Apple-style-span" color="#3333FF">  == Using SIP RTP TOS bits 184</font></div>
<div><font class="Apple-style-span" color="#3333FF">  == Using SIP RTP CoS mark 5</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Launching Macro(foo) on SIP/20-0000000d</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-foo:1] Answer(&quot;SIP/20-0000000d&quot;, &quot;&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-foo:2] NoOp(&quot;SIP/20-0000000d&quot;, &quot;</font><b><font class="Apple-style-span" color="#3333FF">arg1 is  and arg2 is </font></b><font class="Apple-style-span" color="#3333FF">&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-foo:3] Playback(&quot;SIP/20-0000000d&quot;, &quot;tt-monkeys&quot;) in new stack</font></div><div><font class="Apple-style-span" color="#3333FF">    -- &lt;SIP/20-0000000d&gt; Playing &#39;tt-monkeys.gsm&#39; (language &#39;en&#39;)</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [123@from-internal:3] NoOp(&quot;SIP/21-0000000c&quot;, &quot;This is the NoOp after the originate command&quot;) in new stack</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [123@from-internal:4] Wait(&quot;SIP/21-0000000c&quot;, &quot;30&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [123@from-internal:5] Hangup(&quot;SIP/21-0000000c&quot;, &quot;&quot;) in new stack</font></div><div><font class="Apple-style-span" color="#3333FF">  == Spawn extension (from-internal, 123, 5) exited non-zero on &#39;SIP/21-0000000c&#39;</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Executing [h@from-internal:1] Macro(&quot;SIP/21-0000000c&quot;, &quot;hangupcall&quot;) in new stack</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-hangupcall:1] GotoIf(&quot;SIP/21-0000000c&quot;, &quot;1?skiprg&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Goto (macro-hangupcall,s,4)</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-hangupcall:4] GotoIf(&quot;SIP/21-0000000c&quot;, &quot;1?skipblkvm&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Goto (macro-hangupcall,s,7)</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-hangupcall:7] GotoIf(&quot;SIP/21-0000000c&quot;, &quot;1?theend&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">    -- Goto (macro-hangupcall,s,9)</font></div><div><font class="Apple-style-span" color="#3333FF">    -- Executing [s@macro-hangupcall:9] Hangup(&quot;SIP/21-0000000c&quot;, &quot;&quot;) in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF">  == Spawn extension (macro-hangupcall, s, 9) exited non-zero on &#39;SIP/21-0000000c&#39; in macro &#39;hangupcall&#39;</font></div><div><font class="Apple-style-span" color="#3333FF">  == Spawn extension (from-internal, h, 1) exited non-zero on &#39;SIP/21-0000000c&#39;</font></div>
</div><div><br></div><div><div>Could anyone tell me what I am doing wrong please?</div><div>Many thanks in advance for any assistance anyone is able to offer.</div><div><br></div><div>Best regards</div><div>Bruce Hopkins</div>
</div>