freeswitch 配置网关连接pstn

时间:2024-03-07 13:04:15

freeswitch通过配置gateway实现pstn落地 

配置步骤: 
1.在FreeSWITCH\conf\sip_profiles\external目录下添加pstn.xml 

引用
<include> 
  <gateway name="pstn"> 
  <paramname="username" value="freeswitch"/> 
  <paramname="password" value="freeswitch"/> 
  <paramname="realm" value="demo.asterisk.org"/> 
  <paramname="proxy" value="demo.asterisk.org"/> 
  </gateway> 
</include> 

2.执行如下指令 

引用
sofia profile external restart

重启sip profile 

3 添加 dialplan 

引用
<extension name="Goip outbound"> 
<condition field="destination_number"  expression="^0(\d+)$"> 
  <action application="log" data="INFO goip outbound to $1"/> 
  <action application="bridge" data="sofia/gateway/pstn/$1"/> 
<!--   直接在dialplan中添加网关的IP地址,也可以出局 
<action application="bridge" data="sofia/internal/$1@192.168.5.222"/>  //192.168.5.222是网关的地址 --> 
</condition> 
</extension>

ok 拨打0加上电话号码就通过pstn呼出去了