<p dir="ltr">You can split the inbound and outbound calls for your registered users into different contexts, and that will ensure that calls from outside are not sent to PSTN in an uncontrolled way. See an example here:</p>
<p dir="ltr"><a href="https://github.com/voxserv/freeswitch_conf_minimal/blob/master/docs/tutorial_01_simple_pbx.md">https://github.com/voxserv/freeswitch_conf_minimal/blob/master/docs/tutorial_01_simple_pbx.md</a></p>
<p dir="ltr">In your public context, you match the calks from the gsm gateway and transfer them to an extension in one if your internal contexts.</p>
<div class="gmail_quote">On Sep 20, 2015 6:59 PM, "Michael Nielsen" <<a href="mailto:mic.niel84@gmail.com">mic.niel84@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I've tried different scenarios. <div>One was to put all my dial plans in public context. This worked, but of course opened up a lot of security issues. </div><div><br></div><div>My thoughts are now to have all my dial plans in the default context, so only registered users can dial them, but also have one single dial plan in the public context for transferring incoming calls to the default dial plan. </div><div><br></div><div>BUT will this not still open up for security issues?</div><div><br></div><div>I currently see calls in my cdr csv made from user 100 even though no such user exists!?</div><div><br></div><div>How can one be sure that calls are only made from registered and authenticated users in FS?</div><div><br>On Wednesday, September 16, 2015, Bote Man <<a href="mailto:bote_radio@botecomm.com" target="_blank">bote_radio@botecomm.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This is the job of the dialplan. The example entries that are included with the vanilla FS config provide guidance, but in my particular case I had to test on a different SIP field than the vanilla config was looking for.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">My inbound calls from CallCentric put the destination number (DID) in sip_to_user so my dialplan test condition reads:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> <condition field="${sip_to_user}" expression="^(12345678900)$"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I had to read the FS debug logs to see what it was seeing, and then adjust my dialplan accordingly. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If you have many FS users you might consider looking up the directory entries with XML as is typically done.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Here is a good place to start for more information:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="https://freeswitch.org/confluence/display/FREESWITCH/Dialplan" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Dialplan</a><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hope this helps.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Bote<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a>freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a>freeswitch-users-bounces@lists.freeswitch.org</a>] <b>On Behalf Of </b>Michael Nielsen<br><b>Sent:</b> Wednesday, 16 September, 2015 08:33<br><b>To:</b> FreeSWITCH Users Help<br><b>Subject:</b> [Freeswitch-users] Call FS users from external gateway.<u></u><u></u></span></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">I've got my users in FS in /directory/users.xml in a certain domain and user-context = public.<u></u><u></u></p><div><p class="MsoNormal">I've got my FS hooked up to a SIP gateway for connection to the GSM-world.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I'm able to route calls to my SIP gateway for outbound calls, but incoming calls to my FS from the GSM-world does not get routed to my users in FS.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">My users have the ID's "+4412345678", and incoming calls from my SIP gateway does contain +<a>4412345678@my-sip-gateway-domain.com</a><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I guess I need to tell FS somehow that incoming calls from my SIP gateway should match my user IDs in users from my /directory/users.xml.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">But how to I do this?<u></u><u></u></p></div></div></div></div></div></blockquote></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><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" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div>