The execute_extension app is similar to a GOSUB command in BASIC: it goes out, executes some stuff, and then comes back. However, keep in mind that when you execute an extension it does loop through the dialplan looking for the destination_number that you specified. Depending on your needs you probably just need to create a distinct dialplan context for this special extension. Then you execute the extension in a separate context and only the extensions within that context will be checked against destination_number.<div>
<br></div><div>-MC<br><br><div class="gmail_quote">On Tue, Jan 25, 2011 at 6:42 AM, Boris Kovalenko <span dir="ltr">&lt;<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello!<br>
<br>
     From one of my extension I call another extension in another<br>
context. I suppose that exactly this extension should be executed, but<br>
instead I get all previous extension executed to. So below is my<br>
configuration. We are calling start_hunting in context <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>. I<br>
suppose start_hunting extension should be executed but no, hunting<br>
begins from the start of context and all extensions before start_hunting<br>
are executed too. auto_hunt=true solves the problem. So the question is<br>
- is this normal behaviour of execute_extension or am I doing something<br>
wrong?<br>
<br>
&lt;!-- We are hunting only for TAGNet numbering plan --&gt;<br>
&lt;extension name=&quot;ext_hunting&quot;&gt;<br>
&lt;condition field=&quot;${v_tagnet_dst}&quot;<br>
expression=&quot;^(73435230[0-9]{3}|73435494989|7343549499[0-1])$&quot;&gt;<br>
&lt;action application=&quot;javascript&quot; data=&quot;$${scripts_dir}/toll_check.js<br>
${toll_allow} local&quot;/&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;v_tagnet_hunting=true&quot; inline=&quot;true&quot;/&gt;<br>
&lt;action application=&quot;log&quot; data=&quot;NOTICE [top.ctx] - hunting in <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>&quot;/&gt;<br>
&lt;action application=&quot;log&quot; data=&quot;NOTICE ${v_tagnet_dst} $1&quot;/&gt;<br>
&lt;action application=&quot;execute_extension&quot; data=&quot;start_hunting XML <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
Context <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>:<br>
&lt;!--<br>
     This context is for home networking soft phones and cheap telephony.<br>
--&gt;<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
&lt;include&gt;<br>
&lt;context name=&quot;<a href="http://tagnet.ru" target="_blank">tagnet.ru</a>&quot;&gt;<br>
&lt;extension name=&quot;unloop&quot;&gt;<br>
&lt;condition field=&quot;${unroll_loops}&quot; expression=&quot;^true$&quot;/&gt;<br>
&lt;condition field=&quot;${sip_looped_call}&quot; expression=&quot;^true$&quot;&gt;<br>
&lt;action application=&quot;deflect&quot; data=&quot;${destination_number}&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;!--<br>
             Destination number normalization<br>
         --&gt;<br>
&lt;extension name=&quot;ext_translate_dst&quot; continue=&quot;true&quot;&gt;<br>
&lt;!-- &lt;condition field=&quot;${v_tagnet_hunting}&quot; expression=&quot;^true$&quot;<br>
break=&quot;on-true&quot;/&gt; --&gt;<br>
&lt;condition field=&quot;${destination_number}&quot; expression=&quot;^(1[0-9]{3})$&quot;<br>
break=&quot;on-true&quot;&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;v_tagnet_dst=$1&quot; inline=&quot;true&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;condition field=&quot;${destination_number}&quot; expression=&quot;^(\d+)$&quot;<br>
break=&quot;on-true&quot;&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;v_tagnet_dst=$1&quot; inline=&quot;true&quot;/&gt;<br>
&lt;action application=&quot;execute_extension&quot; data=&quot;ext_translate_dst XML<br>
features&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;!--<br>
             Source number normalization<br>
         --&gt;<br>
&lt;extension name=&quot;ext_translate_src&quot; continue=&quot;true&quot;&gt;<br>
&lt;condition field=&quot;${caller_id_number}&quot; expression=&quot;^2([0-9]{4})$&quot;<br>
break=&quot;on-true&quot;&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;caller_id_number=7343549$1&quot; inline=&quot;true&quot;/&gt;<br>
&lt;action application=&quot;set&quot; data=&quot;ani=7343549$1&quot; inline=&quot;true&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;!-- Here we start hunting process --&gt;<br>
&lt;extension name=&quot;start_hunting&quot; continue=&quot;true&quot;&gt;<br>
&lt;condition field=&quot;destination_number&quot; expression=&quot;^start_hunting$&quot;/&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;!--<br>
                 You can place files in the default directory to get<br>
included.<br>
         --&gt;<br>
&lt;X-PRE-PROCESS cmd=&quot;include&quot; data=&quot;<a href="http://tagnet.ru/*.xml" target="_blank">tagnet.ru/*.xml</a>&quot;/&gt;<br>
<br>
&lt;!-- Here we stop hunting process --&gt;<br>
&lt;extension name=&quot;stop_hunting&quot;&gt;<br>
&lt;condition field=&quot;${v_tagnet_hunting}&quot; expression=&quot;true&quot;/&gt;<br>
&lt;/extension&gt;<br>
<br>
&lt;!--<br>
             Transfer call to the TOP context<br>
         --&gt;<br>
&lt;extension name=&quot;top.ctx&quot;&gt;<br>
&lt;condition field=&quot;${v_tagnet_dst}&quot; expression=&quot;^(\d+)$&quot;&gt;<br>
&lt;action application=&quot;log&quot; data=&quot;DEBUG [top.ctx] - transfer to top.ctx&quot;/&gt;<br>
<br>
&lt;!-- Caller ID normalization --&gt;<br>
&lt;action application=&quot;execute_extension&quot; data=&quot;ext_translate_src XML<br>
features&quot;/&gt;<br>
<br>
&lt;action application=&quot;transfer&quot; data=&quot;$1 XML top.ctx&quot;/&gt;<br>
&lt;/condition&gt;<br>
&lt;/extension&gt;<br>
&lt;/context&gt;<br>
&lt;/include&gt;<br>
<br>
<br>
<br>
<br>
--<br>
С уважением,<br>
   Борис Коваленко<br>
   ЗАО &quot;Тагнет&quot;<br>
   (3435) 494991<br>
<br>
<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>
</blockquote></div><br></div>