It not only makes sense it's well documented on the wiki page.<br>The set line is not happening right when it's encountered, the set line is copied into the channel and executed later after the whole dialplan is parsed. The dialplan is a pre-processor not a runtime engine.<br>
<br>Here is a new feature in pre-1.0.5 (svn trunk)<br><br>Some applications like set can now be executed within the dialplan but you should use it sparingly.<br><action application="set" data="testing=true" inline="true"/><br>
<br>The inline=true makes it execute inside the dialplan and it's never copied into your resulting extension because it's executed immediately.<br><br><br><br><div class="gmail_quote">On Wed, Oct 21, 2009 at 6:13 AM, Tihomir Culjaga <span dir="ltr"><<a href="mailto:tculjaga@gmail.com">tculjaga@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">consider this:<div class="im"><br><br><br><br><context name="SIP_incoming"><br>
<extension name="call-sip-extensions"><br> <condition field="destination_number" expression="^(\d+)$"><br>
<action application="set" data="AUTHENTICATION_STATUS=0"/><br> <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/><br>
</condition><br> </extension><br></context><br><br><br><br><context name="Authen_Status"><br> <extension name="exten-auth-status"><br> <condition field=<span style="background-color: rgb(255, 255, 0);">"${AUTHENTICATION_STATUS}"</span> expression="^0$"><br>
<action application="answer"/><br> <action application="playback" data="play.wav"/><br> </condition><br> </extension><br> </context><br>
<br><br><br><br><br></div>here is one of my dialplan. I'm using execute_extension but it is quite the same...<br><br><br><br> <extension name="ServiceLookup"><br> <condition field="destination_number" expression="(^300030)(.*)"><br>
<action application="lookup_service_destination" data="in ${caller_id_number:6:16}, in ${caller_id_number:0:6}, in $2, in $<br>1, in ${network_addr}:5060, out red_contact, out authResult"/><br>
<action application="log" data="INFO ######################## ServiceLookup ########################\n"/><br> <action application="log" data="INFO ######################## contact = '${red_contact}' ##############\n"/><br>
<action application="log" data="INFO ######################## CallerNum = '${caller_id_number:6:16}' ##########\n"/><br> <action application="log" data="INFO ######################## RADIUS auth = '${authResult}' ##########\n"/><br>
<br> <action application="execute_extension" data="doRedirect XML public"/><br> </condition><br> </extension><br><br><br> <extension name="doRedirect"><br>
<condition field="destination_number" expression="^doRedirect$"/><br> <condition field="${authResult}" expression="^0$|^60$"><br> <action application="log" data="INFO ######################## RADIUS auth OK!!!' ##########\n"/><br>
<action application="redirect" data="${red_contact}"/><br> <anti-action application="log" data="INFO ######################## RADIUS auth NOK!! ##########\n"/><br>
<anti-action application="respond" data="403 Forbidden"/><br> </condition><br><br> </extension><br><br><br><br><br><div class="gmail_quote"><div><div></div><div class="h5">
On Wed, Oct 21, 2009 at 12:37 PM, Ahmed Munir <span dir="ltr"><<a href="mailto:ahmedmunir007@gmail.com" target="_blank">ahmedmunir007@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi,<br><br>I've declared a variable named AUTHENTICATION_STATUS in dialplan, and I want to use it in condition, as I'm listing down the configuration below;<br>
<br><context name="SIP_incoming"><br> <extension name="call-sip-extensions"><br>
<condition field="destination_number" expression="^(\d+)$"><br> <action application="set" data="AUTHENTICATION_STATUS=0"/><br> <action application="transfer" data="${AUTHENTICATION_STATUS} XML Authen_Status"/><br>
</condition><br> </extension><br></context><br><br><context name="Authen_Status"><br> <extension name="exten-auth-status"><br> <condition field="AUTHENTICATION_STATUS" expression="^0$"><br>
<action application="answer"/><br> <action application="playback" data="play.wav"/><br> </condition><br> </extension><br> </context><br>
<br><br><br><br> But unfortunately it is not working. Kindly advise me how to do implement it(Note: I don't want to call script). And one more thing to ask how can I transfer the values within the same context?<br clear="all">
<br>-- <br>Regards,<br><font color="#888888"><br>Ahmed Munir<br><br><br>
</font><br></div></div><div class="im">_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></div></blockquote></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>