<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">Siri, that's right, and you can still split the logic between contexts.<br><br>For example, in public context, do the condition matching to classify your call and set a variable, say, "target_context".<br><br>Then at the bottom of public context, transfer to ${target_context}. Then that target context would do the actual call processing.<br><br><br><div><span><br></span></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Siri MM &lt;sirimmfs@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH Users Help &lt;freeswitch-users@lists.freeswitch.org&gt; <br> <b><span
 style="font-weight: bold;">Sent:</span></b> Tuesday, October 1, 2013 1:33 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Freeswitch-users] Differentiating internal/external calls<br> </font> </div> <div class="y_msg_container"><br><div id="yiv3685617860"><div><div dir="ltr">Hi Stanislav,<div><br clear="none"></div><div>Thanks for the reply.</div><div><br clear="none"></div><div>I am working in an open system, where the local extensions/gateways don't authenticate with Freeswitch, and hence I am forced to use the public context alone.</div>
<div><br clear="none"></div><div>Again, since the gateway doesn't authenticate, I am unable to use the "variables" defined within gateway settings.</div><div><br clear="none"></div></div><div class="yiv3685617860gmail_extra"><br clear="none"><br clear="none"><div class="yiv3685617860gmail_quote">
On Mon, Sep 30, 2013 at 6:15 PM, Stanislav Sinyagin <span dir="ltr">&lt;<a rel="nofollow" shape="rect" ymailto="mailto:ssinyagin@yahoo.com" target="_blank" href="mailto:ssinyagin@yahoo.com">ssinyagin@yahoo.com</a>&gt;</span> wrote:<br clear="none"><blockquote class="yiv3685617860gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="yiv3685617860yqt5598092072" id="yiv3685617860yqt34329"><div><div style="font-size:10pt;font-family:arial, helvetica, sans-serif;">the scenario that you described is just ideal for two different contexts. Why do you want to have them in one?<br clear="none"><br clear="none">Of course you can set a variable in an "inline" action in the beginning of a context, like this:<br clear="none">
<pre>&lt;action application="set" data="call_direction=inbound" inline="true"/&gt;</pre>and later in the dialplan, use this variable in conditions.<br clear="none">Also the variable can be assigned at the SIP gateway, then incoming calls will have it automatically:<br clear="none">
<br clear="none"><pre>&lt;gateway name="gateway012"&gt;
   &lt;param name="realm" value="<a rel="nofollow" shape="rect" target="_blank" href="http://sip.voipcarrier.com/">sip.voipcarrier.com</a>" /&gt;
   &lt;param name="username" value="WBrandes" /&gt;
   &lt;param name="password" value="myvoiceismypassword" /&gt;
   &lt;param name="register" value="true" /&gt;
   &lt;param name="caller-id-in-from" value="true" /&gt;
   &lt;param name="ping" value="5" /&gt;
   &lt;param name="ping-max" value="3" /&gt;
   &lt;param name="retry-seconds" value="5" /&gt;
   &lt;param name="expire-seconds" value="60" /&gt;
   &lt;variables&gt;
     &lt;variable name="this_is_inbound_call" value="true" direction="inbound"/&gt;
   &lt;/variables&gt;
 &lt;/gateway&gt;</pre>direction="inbound" means to apply this variable for inbound calls.<br clear="none"><br clear="none"><br clear="none"><div><span><br clear="none"></span></div><div><br clear="none"></div>  <div style="font-family:arial, helvetica, sans-serif;font-size:10pt;">
 <div style="font-family:times new roman, new york, times, serif;font-size:12pt;"> <div dir="ltr"> <hr size="1">  <font face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Siri MM &lt;<a rel="nofollow" shape="rect" ymailto="mailto:sirimmfs@gmail.com" target="_blank" href="mailto:sirimmfs@gmail.com">sirimmfs@gmail.com</a>&gt;<br clear="none">
 <b><span style="font-weight:bold;">To:</span></b> FreeSWITCH Users Help &lt;<a rel="nofollow" shape="rect" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>&gt; <br clear="none"> <b><span style="font-weight:bold;">Sent:</span></b> Monday, September 30, 2013 9:27 AM<br clear="none">
 <b><span style="font-weight:bold;">Subject:</span></b> [Freeswitch-users] Differentiating internal/external calls<br clear="none"> </font> </div><div class="yiv3685617860im"> <div><br clear="none"><div><div dir="ltr">Hi,<div><br clear="none"></div><div>Is it possible for me to have two sets of dialplans - one for
 incoming (to FS) and other for outgoing (from FS), in the same context? On receiving an incoming call, I want to run through only a subset of xmls, and give up on not hitting, and the same for outbound - is this feasible? Or any channel variable that would help me differentiate between a external call and internal call?</div>

<div><br clear="none"></div><div>Thanks!</div></div></div><br clear="none"><br clear="none"></div> </div></div> </div>  </div></div></div><br clear="none">_________________________________________________________________________<br clear="none">
Professional FreeSWITCH Consulting Services:<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:consulting@freeswitch.org" target="_blank" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitchsolutions.com/">http://www.freeswitchsolutions.com</a><br clear="none">
<br clear="none">
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.cudatel.com/">http://www.cudatel.com</a><br clear="none">
<br clear="none">
Official FreeSWITCH Sites<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.cluecon.com/">http://www.cluecon.com</a><br clear="none">
<br clear="none">
FreeSWITCH-users mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br clear="none">
UNSUBSCRIBE:<a rel="nofollow" shape="rect" target="_blank" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><div class="yqt5598092072" id="yqt80435">_________________________________________________________________________<br clear="none">Professional FreeSWITCH Consulting Services:<br clear="none"><a shape="rect" ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br clear="none"><a shape="rect" href="http://www.freeswitchsolutions.com/" target="_blank">http://www.freeswitchsolutions.com</a><br clear="none"><br clear="none">FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br clear="none"><a shape="rect" href="http://www.cudatel.com/" target="_blank">http://www.cudatel.com</a><br clear="none"><br clear="none">Official FreeSWITCH Sites<br clear="none"><a shape="rect" href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br clear="none"><a shape="rect" href="http://wiki.freeswitch.org/"
 target="_blank">http://wiki.freeswitch.org</a><br clear="none"><a shape="rect" href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com</a><br clear="none"><br clear="none">FreeSWITCH-users mailing list<br clear="none"><a shape="rect" ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br clear="none"><a shape="rect" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br clear="none">UNSUBSCRIBE:<a shape="rect" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br clear="none"><a shape="rect" href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org</a><br clear="none"></div><br><br></div> </div> </div>  </div></body></html>