<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">the scenario that you described is just ideal for two different contexts. Why do you want to have them in one?<br><br>Of course you can set a variable in an "inline" action in the beginning of a context, like this:<br><pre>&lt;action application="set" data="call_direction=inbound" inline="true"/&gt;</pre>and later in the dialplan, use this variable in conditions.<br>Also the variable can be assigned at the SIP gateway, then incoming calls will have it automatically:<br><br><pre>&lt;gateway name="gateway012"&gt;
   &lt;param name="realm" value="sip.voipcarrier.com" /&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><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> Monday, September 30, 2013 9:27 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [Freeswitch-users] Differentiating internal/external calls<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0903869962"><div dir="ltr">Hi,<div><br></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></div><div>Thanks!</div></div></div><br><br></div> </div> </div>  </div></body></html>