<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="default">
<!--语音会议-->
<extension name="conferences">
<condition field="destination_number" expression="^(d{4})$" >
<action application="answer"/>
<action application="conference" data="$1-${domain_name}@default"/>
</condition>
</extension>
<!--视频会议融屏-->
<extension name="conferences">
<condition field="destination_number" expression="^(d{5})$" >
<action application="answer"/>
<action application="set" data="video_possible=true"/>
<action application="set" data="video_initial_canvas=2"/>
<action application="set" data="video_initial_watching_canvas=2"/>
<action application="set" data="video_use_dedicated_encoder=true"/>
<action application="conference" data="$1-${domain_name}@video-mcu-stereo"/>
</condition>
</extension>
<!--通过拨号方案修改SDP信息-->
<extension name="show_info">
<condition field="destination_number" expression="^9192$">
<action application="answer"/>
<action application="info"/>
<action application="log" data="INFO ===switch_r_sdp Before:========${switch_r_sdp}"/>
<action application="set"><![CDATA[switch_r_sdp=v=0
o=- 123456 123 IN IP4 192.168.1.112
s=etmedia
c=IN IP4 192.168.1.113
t=0 0
a=X-nat:0 Unknown
m=audio 4002 RTP/AVP 18 103 102 117 3 0 8 9 118 119 104 4 101
a=rtpmap:18 G729/8000
]]>
</action>
<action application="log" data="INFO ===switch_r_sdp After:============${switch_r_sdp}"/>
<action application="sleep" data="250"/>
<action application="hangup"/>
</condition>
</extension>
<!--分机之间互通-->
<extension name="Extension">
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="bypass_media=true"/>
<action application="bridge" data="user/$1"/>
</condition>
</extension>
<!--路由到其他Freeswitch服务器上-->
<extension name="192.168.100.104">
<condition field="destination_number" expression="^0(.*)$" >
<action application="bridge" data="sofia/external/sip:$1@xxx.xxx.xxx.xxx:5090"/>
</condition>
</extension>
<!--播放菜单语音及按键菜单-->
<extension name="callin">
<condition field="destination_number" expression="^7777$" >
<action application="answer"/>
<action application="set" data="hangup_after_bridge=false"/>
<action application="playback" data="$${base_dir}/recordings/archive/2018-01-09-11-14-06_999.wav"/>
<action application="ivr" data="welcome"/>
</condition>
</extension>
<!--绕过媒体路由到其他服务器-->
<extension name="Telemcu">
<condition field="destination_number" expression="^(9d{3})$" >
<action application="set" data="proxy_media=true"/>
<action application="bridge" data="sofia/${use_profile}/9$1@xxx.xxx.xxx.xxx:5060"/>
</condition>
</extension>
<!--IVR菜单配置-->
<extension name="incoming_call">
<condition field="destination_number" expression="^1234567890$">
<action application="answer" data=""/>
<action application="sleep" data="1000"/>
<action application="ivr" data="welcome"/>
</condition>
</extension>
<!--Group分组-->
<extension name="group_dial_cainiao">
<condition field="destination_number" expression="^2002$">
<action application="bridge" data="group/cainiao@${domain_name}"/>
</condition>
</extension>
<!--双腿录音-->
<extension name="Extension1">
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="RECORD_STEREO=true"/>
<action application="set" data="media_bug_answer_req=true"/>
<action application="export" data="execute_on_answer=record_session $${base_dir}/recordings/archive/$1-${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
<action application="bridge" data="user/$1"/>
</condition>
</extension>
<!--单腿录音-->
<extension name="Single_Leg_Record">
<condition field="destination_number" expression="^999$">
<action application="answer"/>
<action application="record" data="$${base_dir}/recordings/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}.wav"/>
</condition>
</extension>
<!--播放音乐文件-->
<extension name="play_wav">
<condition field="destination_number" expression="^911$">
<action application="answer"/>
<action application="playback" data="$${base_dir}/recordings/archive/2018-01-09-11-14-06_999.wav"/>
</condition>
</extension>
<!--顺振-->
<extension name="group_dial_seq">
<condition field="destination_number" expression="^9000$">
<action application="bridge" data="user/1004@xxx.xxx.xxx.xxx|user/1000@xxx.xxx.xxx.xxx"/>
</condition>
</extension>
<!--同振-->
<extension name="group_dial_sim">
<condition field="destination_number" expression="^2000$">
<action application="bridge" data="sofia/internal/1000@xxx.xxx.xxx.xxx,sofia/sip/1001@xxx.xxx.xxx.xxx"/>
</condition>
</extension>
<!--测试几个APP-->
<extension name="Show Channel Variable">
<condition field="destination_number" expression="^1235$">
<action application="answer"/>
<action application="info" data=""/>
<action application="sleep" data="5000"/>
<action application="hangup"/>
</condition>
</extension>
<!--录像-->
<extension name="Local_video">
<condition field="destination_number" expression="^10086$">
<action application="set" data="call_timeout=30"/>
<action application="set" data="record_concat_video=true"/>
<action application="set" data="RECORD_STEREO=true"/>
<action application="set" data="enable_file_write_buffering=false"/>
<action application="export" data="execute_on_answer=record_session $${base_dir}/recordings/archive/10086.fsv"/>
<action application="bridge" data="user/1004"/>
</condition>
</extension>
<!--录像-->
<extension name="voide_record">
<condition field="destination_number" expression="^9193$">
<action application="answer"/>
<action application="record_fsv" data="/home/${strftime(%Y-%m-%d-%H-%M-%S)}.fsv"/>
</condition>
</extension>
<!--播放录像-->
<extension name="voide_playback">
<condition field="destination_number" expression="^9194$">
<action application="answer"/>
<action application="play_fsv" data="/tmp/test.fsv"/>
</condition>
</extension>
<!--不阻塞录音-->
<extension name="Double_Leg_Record">
<condition field="destination_number" expression="^(10[01][0-9])$">
<action application="set" data="RECORD_STEREO=true"/>
<action application="record_session" data="/tmp/$1.wav"/>
<action application="bridge" data="user/$1@${domain_name}"/>
</condition>
</extension>
<!--呼叫停泊电话分配-->
<extension name="park">
<condition field="destination_number" expression="^5900$">
<action application="set" data="fifo_muisc=$${hold_music}"/>
<action application="fifo" data="5900@${domain_name} in"/>
</condition>
</extension>
<!--呼叫取出-->
<extension name="unpark">
<condition field="destination_number" expression="^5901$">
<action application="answer"/>
<action application="fifo" data="5900@${domain_name} out nowait"/>
</condition>
</extension>
<X-PRE-PROCESS cmd="include" data="default/*.xml"/>
</context>
</include>