asterisk (192.168.0.10) <==> freeswitch
代码:
1. did forward, freeswitch => asterisk
2. outgoing trunk, asterisk => freeswitch
=====================================
asterisk:
sip.conf
*************************
externip=router ip (your external IP)
localnet=192.168.0.0/255.255.255.0 (server server ip range)
*************************
type=friend
port=[color=red]5080[/color] ; freeswitch 的 external 要求
qualify=yes
canreinvite=no
host=67.212.64.81
context=from-trunk
nat=yes
disallow=all
allow=g729
freeswitch:
1. external, customer.xml (this is easy)
2. did forwarding:
dialplan/defaut.xml:
<extension name="did">
<condition field="destination_number" expression="^1{0,1}(\d{10})$">
<action application="bridge" data="sofia/gateway/customer/$1"/>
</condition>
</extension>
3. outgoing trunk
public/00_inbound_did.xml:
<extension name="customer_out">
<condition field="destination_number" expression="^{0,1}(\d{10})$">
<action application="bridge" data="sofia/internal/$1@xx.xx.xx.xx"/>
</condition>
</extension>
xx.xx.xx.xx, which is the IP of outgoing trunk server.