Freeswitch测试

增加会议室密码功能

1、编辑conf/autoload_configs/conference.conf.xml,取消如下两行注释

<param name="pin" value="12345"/>

<param name="moderator-pin" value="54321"/>

重新加载配置文件reloadxml
reload mod_conference

2、启用会议密码验证
编辑/usr/local/freeswitch/conf/dialplan/default.xml

  1. <extension name="nb_conferences">
  2. <condition field="destination_number" expression="^(30d{2})$">
  3. <action application="answer"/>
  4. **<action application="set" data="conference_enforce_security=true"/>** ‘default.xml增加此行’
  5. <action application="conference" data="$1-${domain_name}@default"/>
  6. </condition>
  7. </extension>

在<extension name="Local_Extension">后添加如下action

<action application="set" data="RECORD_TITLE=Recording ${destination_number} ${caller_id_number} ${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_COPYRIGHT=(c) 2011"/>
<action application="set" data="RECORD_SOFTWARE=FreeSWITCH"/>
<action application="set" data="RECORD_ARTIST=FreeSWITCH"/>
<action application="set" data="RECORD_COMMENT=FreeSWITCH"/>
<action application="set" data="RECORD_DATE=${strftime(%Y-%m-%d %H:%M)}"/>
<action application="set" data="RECORD_STEREO=true"/>
<action application="record_session" data="/home/record/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>

新增用户,并将用户名设置为Jack

将1000.xml复制到1234.xml中。打开1234.xml,将所有1000都改为1234。并把effective_caller_id_name的值改为Jack,命令如下:

<variable name="effective_caller_id_name" value="Jack"/>
接下来,打开conf/dialplan/default.xml,找到下面一行,增加1234字段

<condition field="destination_number" expression="^(10[01][0-9]|1234)$">
新增完成以后reloadxml文件,或者按F6使新的配置生效。

配置SIP网关拨打外部电话

配置外呼时,需要修改两个地方,路由规则以及出局规则。
路由规则路径为:/usr/local/freeswitch/conf/sip_profiles/external
新建xml文件,本文为:AC_243.xml

<include>
<gateway name="AC_243">
<param name="realm" value="172.20.8.243"/>
<param name="proxy" value="172.20.8.243"/>
<param name="register" value="false"/>
<param name="register-transport" value="udp"/>
</gateway>
</include>

172.20.8.243为SBC或者语音网关的地址,还需要再SBC上添加对应的freeswitch的地址
出局规则(diaplan)路径为:/usr/local/freeswitch/conf/dialplan/
目录下有俩个文件:default.xml——-外呼规则
Public.xml———呼入规则
编辑default.xml,添加一条规则:加前缀9外呼,打外线。默认输入为呼内线

<extension name="AC_243">
<condition field="destination_number" expression="^9(.*)$">
<action application="bridge" data="sofia/gateway/AC_243/$1"/>
</condition>
</extension>

配置呼入

奥科SBC+freeswitch的呼入。

  1. SBC添加项
    修改或添加SBC的呼入lan。IP修改为freeswitch的IP地址,freeswitch默认对应端口是5080,应添加SRD和sipinterface。切记语音编码改成711.729不支持


  2. Freeswitch修改项
    默认SBC和freeswitch添加trunk后。默认应该是不通的。会报如下错误

    这是因为sbc默认是开着呼叫鉴权的,可以看到sbc的报错如下:
    修改freeswitch的配置文件,将auth_calls改为false
    路径为:/usr/local/freeswitch/conf/vars.xml

    链接:https://blog.csdn.net/sinat_33384251/article/details/90477003

    修改完成后,查看sbc还是会报错:Rejected by acl “domains”. Falling back to Digest auth.
    这是因为freeswitch不接受外来域的请求,需要添加类似于白名单。
    配置文件路径:/usr/local/freeswitch/conf/autoload_configs/acl.conf.xml

    上图中172.20.8.243为SBC的ip地址。
    测试,可以呼通,录音也有,本呼入是G711编码,729没有测试通过,待能人异士可以补充

修改默认RTP端口范围

FreeSwitch启动之后,默认的RTP端口范围是16384-32768占用以下这些端口:
这个范围太大,有点夸张,假如要修改可以通过修改:
confautoload_configs switch.conf.xml 配置文件里面的:

<param name="rtp-start-port" value="10000"/>

<param name="rtp-end-port" value="20000"/>
修改之后重启FreeSwitch,就可以。

新增呼叫组

先在confdirectory 目录下的default.xml文件定义一个组,比如下面的salse组:

<group name="sales">

<users>

<user id="1000" type="pointer"/>

<user id="1001" type="pointer"/>

<user id="1002" type="pointer"/>

<user id="1003" type="pointer"/>

<user id="1004" type="pointer"/>
</users>
</group>
然后在confdialplan 目录下的default.xml 拨号计划里面加上:

<extension name="group_dial_sales">

<condition field="destination_number" expression="^2000$">

<action application="bridge" data="${group_call(sales@${domain_name})}"/>
</condition>
</extension>
这样用户拨打的时候整个组的人都会被呼叫。

Callcenter模块测试

1、在安装文件目录下,将modules.conf中的callcenter模块注释掉
2、安装callcenter模块
make mod_callcenter-install
安装过程遇到libtool版本不匹配,导致安装失败
wget http://mirrors.ustc.edu.cn/gnu/libtool/libtool-2.4.6.tar.gz
tar zxvf libtool-2.4.6.tar.gz && cd libtool-2.4.6
./configure —prefix=/usr
make && make install
make
autoconf -ivf
autoreconf —force —install
make
make install
make mod_callcenter-install
设置callcenter模块自动启动,取消注销callcenter模块
vim /usr/local/freeswitch/conf/autoload_configs/modules.conf.xml
3、编辑callcenter.conf.xml文件
vim /usr/local/freeswitch/conf/autoload_configs/callcenter.conf.xml
默认包含support@default队列


agent中的user后不能带@default,否则系统无法识别对应分机号码
tier:指定某一坐席归属哪一个队列

原文地址:https://www.cnblogs.com/allen-zhang/p/12166857.html