freeswitch的配置和拨打电话尝试

来源:互联网 发布:查看informix端口 编辑:程序博客网 时间:2024/06/06 03:46

刚刚安装完成的freeswitch还是无法拨打电话打通的,需要做一些配置的修改和增加拨号计划。

想测试视频的需要增加视频编码的支持,不然无法协商通过:

修改conf/vars.xml:

增加音视频编码
<!--<X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>-->
<!--<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,VP8"/>-->

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=iLBC@30i,speex@8000h@20i,speex@16000h@20i,speex@32000h@20i,G7221@16000h,G7221@32000h,G722,PCMU,PCMA,GSM,AMR"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=iLBC@30i,speex@8000h@20i,speex@16000h@20i,speex@32000h@20i,G7221@16000h,G7221@32000h,G722,PCMU,PCMA,GSM,AMR"/>


修改conf/autoload_configs/acl.conf.xml:

<configuration name="acl.conf" description="Network Lists">
<network-lists>
<!--
These ACL's are automatically created on startup.

rfc1918.auto - RFC1918 Space
nat.auto - RFC1918 Excluding your local lan.
localnet.auto - ACL for your local lan.
loopback.auto - ACL for your local lan.
-->

<list name="lan" default="allow">
<node type="deny" cidr="192.168.42.0/24"/>
<node type="allow" cidr="192.168.2.0/24"/> 按照自己IP地址段自行修改
</list>

<!--
This will traverse the directory adding all users
with the cidr= tag to this ACL, when this ACL matches
the users variables and params apply as if they
digest authenticated.
-->
<list name="domains" default="deny">
<!-- domain= is special it scans the domain from the directory to build the ACL -->
<node type="allow" domain="$${domain}"/>
<!-- use cidr= if you wish to allow ip ranges to this domains acl. -->
<node type="allow" cidr="192.168.2.0/24"/> 按照自己IP地址段自行修改
</list>

</network-lists>
</configuration>


修改conf/diaplan/default.xml:

conf/diaplan/public.xml:

新增普通拨号的拨号计划:
<extension name="sip2sip">
    <condition field="destination_number" expression="^(1[0-9][0-9][0-9])$">
        <action application="export" data="dialed_extension=$1"/>
        <action application="set" data="call_timeout=30"/>
        <action application="set" data="video_possible=true"/> 此为视频是否打开选项
        <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
    </condition>
</extension>


想测试会议的可以增加会议的拨号计划:
<extension name="conferences">
    <condition field="destination_number" expression="^(3[0-9][0-9][0-9])$">
        <action application="set" data="video_possible=true"/> 此为视频是否打开选项
        <action application="answer"/>
        <action application="conference" data="$1@video-mcu-stereo"/> 红色部分为视频会议的视频profile
    </condition>
</extension>


上面配置好以后就可以用电话客户端拨号尝试了,按照上面配置的拨号计划,拨打1000~1999是普通呼叫,但是默认的freeswitch只配了前20个帐号,如果需要请自行添加,拨打3000~3999是进入会议,测试普通通话可以使用microsip,但是视频方面的通话使用microsip可能会崩溃掉,可以换jitsi测试视频通话或者其他客户端。