Hi,<div><br></div><div>With Asterisk 1.8.3, I can'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 => 123,1,Answer()</font></div><div><font class="Apple-style-span" color="#3333FF">exten => 123,n,Originate(SIP/20,app,Macro,foo,bar)</font></div><div><font class="Apple-style-span" color="#3333FF">exten => 123,n,NoOp(This is the NoOp after the originate command)</font></div>
<div><font class="Apple-style-span" color="#3333FF">exten => 123,n,Wait(30)</font></div><div><font class="Apple-style-span" color="#3333FF">exten => 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 => s,1,Answer()</font></div><div><font class="Apple-style-span" color="#3333FF">exten => s,2,NoOp(arg1 is ${ARG1} and arg2 is ${ARG2})</font></div>
<div><font class="Apple-style-span" color="#3333FF">exten => s,3,Playback(tt-monkeys)</font></div></div><div><br></div><div>I was hoping the ${ARG1} within the macro would be 'bar', 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> </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("SIP/21-0000000c", "") in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [123@from-internal:2] Originate("SIP/21-0000000c", "SIP/20,app,Macro,foo,bar") 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("SIP/20-0000000d", "") in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [s@macro-foo:2] NoOp("SIP/20-0000000d", "</font><b><font class="Apple-style-span" color="#3333FF">arg1 is and arg2 is </font></b><font class="Apple-style-span" color="#3333FF">") in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [s@macro-foo:3] Playback("SIP/20-0000000d", "tt-monkeys") in new stack</font></div><div><font class="Apple-style-span" color="#3333FF"> -- <SIP/20-0000000d> Playing 'tt-monkeys.gsm' (language 'en')</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [123@from-internal:3] NoOp("SIP/21-0000000c", "This is the NoOp after the originate command") in new stack</font></div><div><font class="Apple-style-span" color="#3333FF"> -- Executing [123@from-internal:4] Wait("SIP/21-0000000c", "30") in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [123@from-internal:5] Hangup("SIP/21-0000000c", "") in new stack</font></div><div><font class="Apple-style-span" color="#3333FF"> == Spawn extension (from-internal, 123, 5) exited non-zero on 'SIP/21-0000000c'</font></div>
<div><font class="Apple-style-span" color="#3333FF"> -- Executing [h@from-internal:1] Macro("SIP/21-0000000c", "hangupcall") in new stack</font></div><div><font class="Apple-style-span" color="#3333FF"> -- Executing [s@macro-hangupcall:1] GotoIf("SIP/21-0000000c", "1?skiprg") 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("SIP/21-0000000c", "1?skipblkvm") 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("SIP/21-0000000c", "1?theend") 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("SIP/21-0000000c", "") in new stack</font></div>
<div><font class="Apple-style-span" color="#3333FF"> == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/21-0000000c' in macro 'hangupcall'</font></div><div><font class="Apple-style-span" color="#3333FF"> == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/21-0000000c'</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>