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"><<a href="mailto:boris@tagnet.ru">boris@tagnet.ru</a>></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>
<!-- We are hunting only for TAGNet numbering plan --><br>
<extension name="ext_hunting"><br>
<condition field="${v_tagnet_dst}"<br>
expression="^(73435230[0-9]{3}|73435494989|7343549499[0-1])$"><br>
<action application="javascript" data="$${scripts_dir}/toll_check.js<br>
${toll_allow} local"/><br>
<action application="set" data="v_tagnet_hunting=true" inline="true"/><br>
<action application="log" data="NOTICE [top.ctx] - hunting in <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>"/><br>
<action application="log" data="NOTICE ${v_tagnet_dst} $1"/><br>
<action application="execute_extension" data="start_hunting XML <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>"/><br>
</condition><br>
</extension><br>
<br>
Context <a href="http://tagnet.ru" target="_blank">tagnet.ru</a>:<br>
<!--<br>
This context is for home networking soft phones and cheap telephony.<br>
--><br>
<?xml version="1.0" encoding="utf-8"?><br>
<include><br>
<context name="<a href="http://tagnet.ru" target="_blank">tagnet.ru</a>"><br>
<extension name="unloop"><br>
<condition field="${unroll_loops}" expression="^true$"/><br>
<condition field="${sip_looped_call}" expression="^true$"><br>
<action application="deflect" data="${destination_number}"/><br>
</condition><br>
</extension><br>
<br>
<!--<br>
Destination number normalization<br>
--><br>
<extension name="ext_translate_dst" continue="true"><br>
<!-- <condition field="${v_tagnet_hunting}" expression="^true$"<br>
break="on-true"/> --><br>
<condition field="${destination_number}" expression="^(1[0-9]{3})$"<br>
break="on-true"><br>
<action application="set" data="v_tagnet_dst=$1" inline="true"/><br>
</condition><br>
<condition field="${destination_number}" expression="^(\d+)$"<br>
break="on-true"><br>
<action application="set" data="v_tagnet_dst=$1" inline="true"/><br>
<action application="execute_extension" data="ext_translate_dst XML<br>
features"/><br>
</condition><br>
</extension><br>
<br>
<!--<br>
Source number normalization<br>
--><br>
<extension name="ext_translate_src" continue="true"><br>
<condition field="${caller_id_number}" expression="^2([0-9]{4})$"<br>
break="on-true"><br>
<action application="set" data="caller_id_number=7343549$1" inline="true"/><br>
<action application="set" data="ani=7343549$1" inline="true"/><br>
</condition><br>
</extension><br>
<br>
<!-- Here we start hunting process --><br>
<extension name="start_hunting" continue="true"><br>
<condition field="destination_number" expression="^start_hunting$"/><br>
</extension><br>
<br>
<!--<br>
You can place files in the default directory to get<br>
included.<br>
--><br>
<X-PRE-PROCESS cmd="include" data="<a href="http://tagnet.ru/*.xml" target="_blank">tagnet.ru/*.xml</a>"/><br>
<br>
<!-- Here we stop hunting process --><br>
<extension name="stop_hunting"><br>
<condition field="${v_tagnet_hunting}" expression="true"/><br>
</extension><br>
<br>
<!--<br>
Transfer call to the TOP context<br>
--><br>
<extension name="top.ctx"><br>
<condition field="${v_tagnet_dst}" expression="^(\d+)$"><br>
<action application="log" data="DEBUG [top.ctx] - transfer to top.ctx"/><br>
<br>
<!-- Caller ID normalization --><br>
<action application="execute_extension" data="ext_translate_src XML<br>
features"/><br>
<br>
<action application="transfer" data="$1 XML top.ctx"/><br>
</condition><br>
</extension><br>
</context><br>
</include><br>
<br>
<br>
<br>
<br>
--<br>
С уважением,<br>
Борис Коваленко<br>
ЗАО "Тагнет"<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>