[Freeswitch-users] Keeping local calls local

curriegrad2004 curriegrad2004 at gmail.com
Sun Sep 23 21:24:22 MSD 2012


You can use modules like mod_enum or mod_easyroute to route the calls
first before hitting your SIP provider. The wiki is a great place to
start for this type of scenario

On Sun, Sep 23, 2012 at 8:01 AM, D'Arcy Cain <darcy at vex.net> wrote:
> The first thing I found with the basic setup of FreeSWITCH was that
> calls between my own clients still went to my provider.  This seemed
> like a waste to me.  To handle calls coming in I generate an XML file
> called dialplan/public/00_Local.xml.  Here is an example entry from it.
>
> <extension name="Local_4164251212">
>   <condition field="destination_number" expression="^(4164251212)$">
>     <action application="export" data="dialed_extension=$1"/>
>     <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
>     <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
>     <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
>     <action application="bind_meta_app" data="4 b s execute_extension::att_xfer XML features"/>
>     <action application="set" data="ringback=${us-ring}"/>
>     <action application="set" data="transfer_ringback=$${hold_music}"/>
>     <action application="set" data="call_timeout=30"/>
>     <action application="set" data="hangup_after_bridge=true"/>
>     <action application="set" data="continue_on_fail=true"/>
>     <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
>     <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
>     <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
>     <action application="hash" data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/>
>     <action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/>
>     <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
>     <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
>     <action application="answer"/>
>     <action application="sleep" data="1000"/>
>     <action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
>   </condition>
> </extension>
>
> I am still trying to figure out exactly what everything in there does
> but it seems to do the job.  Calls originating outside get delivered to
> the correct client's phone.  Calls between clients go out to the
> provider and then come back in as if it was external.
>
> I worked around this by symlinking this file to the dialplan/default
> directory.  This works but I wonder if this is the best way to
> accomplish this.
>
> Side question, can I create a simple alias for all of my DIDs and make
> one condition that tests that alias somehow?
>
> Cheers.
>
> --
> D'Arcy J.M. Cain
> System Administrator, Vex.Net
> http://www.Vex.Net/ IM:darcy at Vex.Net
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list