I haven't used ael but in extension.conf whenever we set a channel variable we use a SET command just like you used it to set the variable MACRO_RESULT. try using the set command, if still it does not work then try to initialize the wrongpin=0 before the dial command, or outside the macro.<br>
<br><div class="gmail_quote">On Fri, May 16, 2008 at 12:36 PM, Tobias Ahlander <<a href="mailto:plyschen@gmail.com">plyschen@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Good day, <br><br>I'm using a dial string as follows: Dial(SIP/${phonenumber},30,grM(screen^${pin})L(${300000}[:60000]));<br>When I set a variable in the macro screen, it doesn't get passed back to the extension from where the dial was called. I can always put the result in the MySQL database, but that feels a bit overkill... the macro looks as follows: <br>
<br>macro screen (arg1) {<br><br> Wait(0.2);<br> Read(acceptcall|sounds/pin|7);<br> if(${acceptcall} = ${arg1}) {<br> NoOp(connect them);<br> wrongpin=0;<br> } else {<br> Set(MACRO_RESULT=CONTINUE);<br> wrongpin=1;<br>
}<br> NoOp(MACRO_RESULT = ${MACRO_RESULT});<br><br>}<br><br>This is the output from the CLI, and I can see that the wrongpin is set to 1, but when I do a NoOp right after leaving the macro, it says its empty...<br><br>
-- Executing [s@connect:36] Dial("SIP/1003-b7619b78", "SIP/1203|30|grM(screen^1234)L(300000[:60000])") in new stack<br> -- Limit Data for this call:<br> > timelimit = 300000<br> > play_warning = 60000<br>
> play_to_caller = yes<br> > play_to_callee = yes<br> > warning_freq = 0<br> > start_sound = (null)<br> > warning_sound = beep<br> > end_sound = beep<br> -- Called 1203<br>
-- SIP/1203-08d62408 is ringing<br> -- SIP/1203-08d62408 answered SIP/1003-b7619b78<br> -- Executing [s@macro-screen:1] Set("SIP/1203-08d62408", "arg1=1234") in new stack<br> -- Executing [s@macro-screen:2] Wait("SIP/1203-08d62408", "0.2") in new stack<br>
-- Executing [s@macro-screen:3] Read("SIP/1203-08d62408", "acceptcall|sounds/pin|7") in new stack<br> -- Accepting a maximum of 7 digits.<br> -- <SIP/1203-08d62408> Playing 'sounds/pin' (language 'en')<br>
-- User entered '1'<br> -- Executing [s@macro-screen:4] GotoIf("SIP/1203-08d62408", "0?5:8") in new stack<br> -- Goto (macro-screen,s,8)<br> -- Executing [s@macro-screen:8] Set("SIP/1203-08d62408", "MACRO_RESULT=CONTINUE") in new stack<br>
-- Executing [s@macro-screen:9] Set("SIP/1203-08d62408", "wrongpin=1") in new stack<br> -- Executing [s@macro-screen:10] NoOp("SIP/1203-08d62408", "Finish if-screen-32753") in new stack<br>
-- Executing [s@macro-screen:11] NoOp("SIP/1203-08d62408", "MACRO_RESULT = CONTINUE") in new stack<br> -- Executing [s@connect:37] NoOp("SIP/1003-b7619b78", "DIALSTATUS:ANSWER") in new stack<br>
-- Executing [s@connect:38] NoOp("SIP/1003-b7619b78", "wrongpin=") in new stack<br><br>Is there a good way to pass this variable back to the context "connect"? <br><br>Thanks, <br>Best regards, <br>
<font color="#888888">
Tobias<br>
</font><br>_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>Rizwan Hisham<br>