Hello Michael
I'm still a freeswitch newbie but i have to deal with a similar
issue ( not yet implemented ) I believe that the proper solution
is using a sip proxy like opensips but it seems difficult to
implement.
My idea is to detect if a particular extension is registered
locally and try to transmit the call to the second server if the
extensions is not registered
I added something like this in the beginning of my domain dialplan
on freeswitch1
<extension name="user_registered" continue="true">
<condition >
<action application="set"
data="user_registered=${sofia_contact
${destination_number}@${domain_name}}" inline="true"/>
<action application="set"
data="user_exists=${user_exists id ${destination_number}
${domain_name}}" inline="true"/>
</condition>
<condition field="${user_exists}"
expression="^true$" />
<condition field="${user_registered}"
expression="^error/user_not_registered$" >
<action application="bridge"
data="{sip_invite_to_uri=<sip:${destination_number}@${domain_name}>}sofia/internal/${destination_number}@freeswitch2.company.com"
/>
</condition>
</extension>
I added this the public dialplan on freeswitch2
<include>
<extension name="ha_transfert" continue="false">
<condition field="${sip_h_X-CallType}"
expression="^ha_transfert$" >
<action application="set"
data="call_direction=inbound"/>
<action application="set"
data="domain_name=${sip_to_host}"/>
<action application="set"
data="domain=${sip_to_host}"/>
<action application="transfer"
data="${sip_to_user} XML ${sip_to_host}" />
</condition>
</extension>
</include>
Please note that my sample dialplan on freeswitch2 is not secure (
hopefully not yet in production and a restrictive firewall ), you
may interested by a topic between me and a freeswitch power user (
not like me :-) )
http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115900.html
Please look the Sergey advice about dialplan security, i hope i
will have the time to implement theses advises in a near future.
http://lists.freeswitch.org/pipermail/freeswitch-users/2015-September/115978.html
~
On 15/10/2015 08:56, Michael Nielsen wrote: