下载windows版本FreeWitch
地址为:http://files.freeswitch.org/windows/installer/
一.配置外呼
conf\sip_profiles\external
创建nexmo.xml文件 配置自己的sip外呼账号 这里是nexmo
<include>
<gateway name="nexmo">
<param name="proxy" value="sip.nexmo.com">
<param name="register" value="true"/>
<param name="caller-id-in-from" value="false"/>
<param name="from-user" value="这里是号码"/>
<param name="username" value=“这里是账号"/>
<param name="password" value="这里是密码"/>
</gateway>
</include>
sip.nexmo.com: 这个是域名
\conf\dialplan\default
创建 call_out.xml 文件 用于外呼
<include>
<extension name="[international.mycompany.com](http://international.mycompany.com/)">
<condition field="destination_number" expression="^(00\d+)$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
<action application="bridge" data="{origination_caller_id_name=这里是号码}sofia/gateway/nexmo/$1"/>
</condition>
</extension>
</include>
^(00\d+)$ :00代表外呼前缀 拨打外网电话前面加00
origination_caller_id_name: 显示号码
gateway/nexmo/$1 : nexmo代表自己创建的网关文件
二.配置NAT 外网可以访问到FreeSwitch
conf\sip_profiles
修改 internal.xml
<param name="ext-rtp-ip" value=“这里填公网IP"/>
<param name="ext-sip-ip" value="这里填公网IP"/>
\conf
修改 vars.xml
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=这里填公网IP"/>
<X-PRE-PROCESS cmd="set" data="external_sip_ip=这里填公网IP"/>
三.添加白名单
\conf\autoload_configs
acl.conf.xml
<list name="nexmo" default="deny">
<node type="allow" cidr="173.193.199.24/32"/>
<node type="allow" cidr="174.37.245.34/32"/>
<node type="allow" cidr="5.10.112.121/32"/>
<node type="allow" cidr="5.10.112.122/32"/>
<node type="allow" cidr="119.81.44.6/32"/>
<node type="allow" cidr="119.81.44.7/32"/>
<node type="allow" cidr="169.60.141.29/32"/>
<node type="allow" cidr="169.60.141.30/32"/>
</list>
四.配置阿里防火墙
参考: https://freeswitch.org/confluence/display/FREESWITCH/Firewall