<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">here's a piece of my dialplan in "default" context. It simply catches such calls and transfers them directly to the public context. The public context matches local DID numbers and transfers them to corresponding extensions in default context:<br><br> <extension name="internal_did"><br> <condition field="destination_number" expression="^($${default_did_prefix}\d+)$"><br> <action application="transfer" data="$1 XML public"/><br> </condition><br> </extension><br><div><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">The "default_did_prefix" variable holds my
DID number block. <br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <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"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> D'Arcy Cain <darcy@Vex.Net><br> <b><span style="font-weight: bold;">To:</span></b> FreeSWITCH-users@lists.freeswitch.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday,
September 23, 2012 5:01 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [Freeswitch-users] Keeping local calls local<br> </font> </div> <br>
The first thing I found with the basic setup of FreeSWITCH was that<br>calls between my own clients still went to my provider. This seemed<br>like a waste to me. To handle calls coming in I generate an XML file<br>called dialplan/public/00_Local.xml. Here is an example entry from it.<br><br><extension name="Local_4164251212"><br> <condition field="destination_number" expression="^(4164251212)$"><br> <action application="export" data="dialed_extension=$1"/><br> <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/><br> <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/><br> <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/><br> <action application="bind_meta_app" data="4 b s
execute_extension::att_xfer XML features"/><br> <action application="set" data="ringback=${us-ring}"/><br> <action application="set" data="transfer_ringback=$${hold_music}"/><br> <action application="set" data="call_timeout=30"/><br> <action application="set" data="hangup_after_bridge=true"/><br> <action application="set" data="continue_on_fail=true"/><br> <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/><br> <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/><br> <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/><br> <action application="hash"
data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/><br> <action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/><br> <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/><br> <action application="bridge" data="user/${dialed_extension}@${domain_name}"/><br> <action application="answer"/><br> <action application="sleep" data="1000"/><br> <action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/><br> </condition><br></extension><br><br>I am still trying to figure out exactly what everything in there does<br>but it seems to do the job. Calls originating outside get delivered to<br>the correct client's phone. Calls between clients go out to the<br>provider and then
come back in as if it was external.<br><br>I worked around this by symlinking this file to the dialplan/default<br>directory. This works but I wonder if this is the best way to<br>accomplish this.<br><br>Side question, can I create a simple alias for all of my DIDs and make<br>one condition that tests that alias somehow?<br><br>Cheers.<br><br>-- <br>D'Arcy J.M. Cain<br>System Administrator, Vex.Net<br>http://www.Vex.Net/ IM:<a ymailto="mailto:darcy@Vex.Net" href="mailto:darcy@Vex.Net">darcy@Vex.Net</a><br><br>_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services:<br><a ymailto="mailto:consulting@freeswitch.org" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>http://www.freeswitchsolutions.com<br><br>FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>http://www.cudatel.com<br><br>Official FreeSWITCH
Sites<br>http://www.freeswitch.org<br>http://wiki.freeswitch.org<br>http://www.cluecon.com<br><br>FreeSWITCH-users mailing list<br><a ymailto="mailto:FreeSWITCH-users@lists.freeswitch.org" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<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><br><br> </div> </div> </blockquote></div> </div></body></html>