<div dir="ltr">The FS dialplan is not run like a script interpreter like it is in asterisk.<br><br>when the dialplan is parsed only variables that are already set before the call hit the dialplan are available for the regex<br>
it makes 1 giant pass into all the extensions and for all the things that match, the actions are appended to the list of instructions<br>no variables are passed or actually set, all of the xml is parsed, then the call goes to the execute state where the variables are expanded.<br>
if you need to have a subsequent action be based on variables set from the dialplan, you need to transfer or execute exten in the list of instructions so you can go back to the dialplan with the new varianbles set.<br><br>
<br>see: <a href="http://wiki.freeswitch.org/wiki/Dialplan">http://wiki.freeswitch.org/wiki/Dialplan</a><br><br><div class="gmail_quote">On Wed, Sep 24, 2008 at 5:52 AM, Jon Bruel <span dir="ltr">&lt;<a href="mailto:jbr@consiglia.dk">jbr@consiglia.dk</a>&gt;</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;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">For a test, I have used the following
show sample dialstring:</span></font></p>

<p style="text-indent: 24pt;"><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">&lt;extension
name=&quot;Local_Extension&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;destination_number&quot; expression=&quot;(10[01][0-9])$&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;set&quot; data=&quot;custid=100001210&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;set&quot; data=&quot;dialed_ext=$1&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;set&quot; data=&quot;caller_domain=<a href="http://10.3.1.11" target="_blank">10.3.1.11</a>&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;export&quot; data=&quot;execute_on_answer=execute_extension
ONANSWER XML default&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;export&quot; data=&quot;execute_on_ring=execute_extension
ONRING XML default&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;bridge&quot;
data=&quot;[NEWVARIABLE=AAABBBCCC]user/${custid}${dialed_ext}@${caller_domain}&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/extension&gt;</span></font></p>

<p style="margin-left: 24pt; text-indent: 12pt;"><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">&lt;extension name=&quot;Call_Answered&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;destination_number&quot; expression=&quot;^ONANSWER$&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;set&quot;
data=&quot;On_Answer_Is_It_Then_Passed=${NEWVARIABLE}&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;info&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp; &lt;/extension&gt;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension
name=&quot;Ringing&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;destination_number&quot; expression=&quot;^ONRING$&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;action
application=&quot;set&quot; data=&quot;Ringing_Is_It_Then_Passed=${NEWVARIABLE}&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/extension&gt;</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">The two extensions Call_Answered and
Ringing are just test extensions to check if the variable NEWVARIABLE has been
passed. If I just make normal call, it is not passed on. Using export for the
execute_on_answer, the code runs twice. I have tried other "execute_on_XXX"
but I can't see the new variable. Again this may be related to my lack of
understanding the fundamentals of FS. /Jon</span></font></p>

</div>

</div>


<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>
<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>
</div>