<div dir="ltr">which leg do you want to see the variable and which leg do you need to execute the extension<br><br>normally execute_on_answer is not used to do any prolonged activities since it will indeed block the progress of the call until the application you specified is done so it&#39;s normally just used to set a variable or schedule a call hangup etc.<br>
<br><br>if you only want the execute_on_answer to happen on the b-leg you can do the following in your existing code.<br><br><span lang="EN-GB">&nbsp; &lt;action
application=&quot;export&quot; data=&quot;nolocal:execute_on_answer=execute_extension
ONANSWER XML default&quot;/&gt;<br>
</span><br><br>the nolocal: tells the system to only set the variables on the b-legs spawned from the current channel and never the A leg itself otherwise export will set the variable on both legs.<br><br>This is the same as using {<span lang="EN-GB">execute_on_answer=&#39;execute_extension
ONANSWER XML default</span>&#39;}<br>at the beginning of your dial string.<br>&nbsp;<br>The variables you put in the [foo=bar] will only be set on the B-legs spawned off from that originate.<br><br>if you do it like i mentioned here you can eliminate all of the checks for a or b leg because you will be certain that the event is only triggered on the B legs<br>
<br><br><br><div class="gmail_quote">On Thu, Sep 25, 2008 at 1:57 PM, 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">Anthony, this is a simplified version
dialplan, just for an illustration of the previous posts:</span><span lang="EN-GB"> </span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;"><br>
file default.xml:<br>
</span></font><span lang="EN-GB"><div class="Ih2E3d">&lt;?xml version=&quot;1.0&quot;
encoding=&quot;utf-8&quot;?&gt;<br>
&lt;include&gt;<br></div>
&nbsp; &lt;context name=&quot;default&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;Local_Extension&quot;&gt;<br>
&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;&lt;action
application=&quot;set&quot; data=&quot;leg=a&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;action
application=&quot;set&quot; data=&quot;destination=user/$<a href="mailto:1@10.3.1.11" target="_blank">1@10.3.1.11</a>&quot;/&gt;<br>
&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; &lt;action application=&quot;bridge&quot;
data=&quot; =&quot;[NEWVARIABLE=AAABBBCCC]${destination}&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp;&nbsp; &lt;/extension&gt;<div class="Ih2E3d"><br>
<br>
&nbsp;&nbsp; &lt;extension name=&quot;Call_Answered&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;destination_number&quot; expression=&quot;^ONANSWER$&quot;&gt;<br></div>
&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&lt;action
application=&quot;execute_extension&quot; data=&quot;INFO XML info&quot;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp;&nbsp; &lt;/extension&gt;<br>
&nbsp; &lt;/context&gt;<br>
&lt;/include&gt;</span></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">file info.xml:<div class="Ih2E3d"><br>
&lt;xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
&lt;include&gt;<br></div>
&nbsp; &lt;context name=&quot;info&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extension name=&quot;Call_Info&quot;&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;destination_number&quot; expression=&quot;^INFO$&quot; /&gt;<div class="Ih2E3d"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;condition
field=&quot;${leg}&quot; expression=&quot;^a$&quot;&gt;<br></div><div class="Ih2E3d">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!--
We are in the b-leg--&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anti-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;&nbsp;&nbsp;&nbsp;&nbsp; &lt;anti-action
application=&quot;info&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;<br>
&nbsp; &lt;/context&gt;<br>
&lt;/include&gt;</div></span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">Sorry about my inconsistent use of the
terms, the XML about should explain. /Jon</span></font></p>

<p><font face="Courier New" size="2"><span style="font-size: 10pt; line-height: 110%;" lang="EN-GB">&nbsp;</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>