当前位置:网站首页>Freeswitch dial the extension number
Freeswitch dial the extension number
2022-07-01 06:02:00 【Be true】
summary
Telephone voice service , There is a slightly more complex scenario , It is the landing scene of the switchboard extension , After the customer dials the switchboard number , You need to dial the extension number to transfer to the designated telephone .
The extension number is usually dialed after the switchboard is connected , There will be a voice prompt , After the switchboard receives the number, it will be transferred to the extension .
The implementation of extension number transfer is actually the same as IVR The implementation of is consistent , It's all through DTMF Code receipt No .
This document does not cover how to land the switchboard extension , But how to pass fs Automatically dial the extension .
Environmental Science
centos:CentOS release 7.0 (Final) Or above
freeswitch:v1.8.7
GCC:4.8.5
APP Interface
Freeswitch Yes app Interface “send_dtmf”, It is very convenient to send DTMF code , The source code in mod_dptools modular .
The method is simple to use , The format is as follows .
send_dtmf <dtmf digits>[@<tone_duration>]
example , Dial plan
<action application="send_dtmf" data="0123456789ABCD*#@100"/>
example ,C++ Code .
char *extnum = "123456";
if (SWITCH_STATUS_SUCCESS != switch_core_session_execute_application(session, "send_dtmf", extnum))
{
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"send_dtmf failed, extnum = %s\n", extnum);
}
Dial plan configuration
modify fs The configuration file /usr/local/freeswitch/conf/dialplan/test.xml
<include>
<context name="ext_test">
<extension name="test" continue="false">
<condition field="destination_number" expression="^(\d+)$">
<action application="sched_hangup" data="+10"/>
<action application="send_dtmf" data="987654321"/>
<action application="endless_playback" data="/usr/local/freeswitch/sounds/101-baidu-mp3.mp3"/>
</condition>
</extension>
</context>
</include>
test
stay freeswitch Use in command line originate Make a call , Then go to the dial plan ext_test send out DTMF.
[email protected]> originate {originator_codec=PCMA,origination_caller_id_number=0755110}sofia/external/sip:[email protected]:5080 1001 XML ext_test
fs call 138 On the server 1001, After the call is connected , send out DTMF, The log is as follows .
2022-06-10 15:57:57.810985 [INFO] mod_dialplan_xml.c:637 Processing <0755110>->1001 in context ext_test
Dialplan: sofia/external/[email protected]:5080 parsing [ext_test->test] continue=false
Dialplan: sofia/external/[email protected]:5080 Regex (PASS) [test] destination_number(1001) =~ /^(\d+)$/ break=on-false
Dialplan: sofia/external/[email protected]:5080 Action sched_hangup(+10)
Dialplan: sofia/external/[email protected]:5080 Action send_dtmf(987654321)
Dialplan: sofia/external/[email protected]:5080 Action endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
...
EXECUTE sofia/external/[email protected]:5080 send_dtmf(987654321)
2022-06-10 15:57:57.810985 [DEBUG] switch_core_io.c:1918 sofia/external/[email protected]:5080 send dtmf
digit=9 ms=250 samples=2000
2022-06-10 15:57:57.810985 [DEBUG] switch_core_io.c:1918 sofia/external/[email protected]:5080 send dtmf
digit=8 ms=250 samples=2000
...
EXECUTE sofia/external/[email protected]:5080 endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
2022-06-10 15:57:57.810985 [DEBUG] switch_ivr_play_say.c:1498 Codec Activated [email protected] 1 channels 20ms
2022-06-10 15:57:57.820986 [DEBUG] switch_rtp.c:5237 Send start packet for [9] ts=160 dur=160/160/2000 seq=65154 lw=160
2022-06-10 15:57:57.820986 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=320/320/2000 seq=65155 lw=320
2022-06-10 15:57:57.841015 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=480/480/2000 seq=65156 lw=480
2022-06-10 15:57:57.841015 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=640/640/2000 seq=65157 lw=640
2022-06-10 15:57:57.861013 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=800/800/2000 seq=65158 lw=800
2022-06-10 15:57:57.861013 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=960/960/2000 seq=65159 lw=960
2022-06-10 15:57:57.881025 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1120/1120/2000 seq=65160 lw=1120
2022-06-10 15:57:57.881025 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1280/1280/2000 seq=65161 lw=1280
2022-06-10 15:57:57.901015 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1440/1440/2000 seq=65162 lw=1440
2022-06-10 15:57:57.901015 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1600/1600/2000 seq=65163 lw=1600
2022-06-10 15:57:57.921012 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1760/1760/2000 seq=65164 lw=1760
2022-06-10 15:57:57.921012 [DEBUG] switch_rtp.c:5136 Send middle packet for [9] ts=160 dur=1920/1920/2000 seq=65165 lw=1920
2022-06-10 15:57:57.941013 [DEBUG] switch_rtp.c:5136 Send end packet for [9] ts=160 dur=2080/2080/2000 seq=65166 lw=1920
2022-06-10 15:57:57.941013 [DEBUG] switch_rtp.c:5136 Send end packet for [9] ts=160 dur=2080/2080/2000 seq=65167 lw=1920
2022-06-10 15:57:57.941013 [DEBUG] switch_rtp.c:5136 Send end packet for [9] ts=160 dur=2080/2080/2000 seq=65168 lw=1920
2022-06-10 15:57:57.941013 [DEBUG] switch_rtp.c:5084 Queue digit delay of 40ms
2022-06-10 15:57:57.980986 [DEBUG] switch_rtp.c:5237 Send start packet for [8] ts=1440 dur=160/160/2000 seq=65171 lw=1440
2022-06-10 15:57:57.980986 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=320/320/2000 seq=65172 lw=1600
2022-06-10 15:57:57.991013 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=480/480/2000 seq=65173 lw=1760
2022-06-10 15:57:57.991013 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=640/640/2000 seq=65174 lw=1920
2022-06-10 15:57:58.021023 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=800/800/2000 seq=65175 lw=2080
2022-06-10 15:57:58.021023 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=960/960/2000 seq=65176 lw=2240
2022-06-10 15:57:58.041014 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1120/1120/2000 seq=65177 lw=2400
2022-06-10 15:57:58.041014 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1280/1280/2000 seq=65178 lw=2560
2022-06-10 15:57:58.061012 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1440/1440/2000 seq=65179 lw=2720
2022-06-10 15:57:58.061012 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1600/1600/2000 seq=65180 lw=2880
2022-06-10 15:57:58.081014 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1760/1760/2000 seq=65181 lw=3040
2022-06-10 15:57:58.081014 [DEBUG] switch_rtp.c:5136 Send middle packet for [8] ts=1440 dur=1920/1920/2000 seq=65182 lw=3200
2022-06-10 15:57:58.101024 [DEBUG] switch_rtp.c:5136 Send end packet for [8] ts=1440 dur=2080/2080/2000 seq=65183 lw=3200
2022-06-10 15:57:58.101024 [DEBUG] switch_rtp.c:5136 Send end packet for [8] ts=1440 dur=2080/2080/2000 seq=65184 lw=3200
2022-06-10 15:57:58.101024 [DEBUG] switch_rtp.c:5136 Send end packet for [8] ts=1440 dur=2080/2080/2000 seq=65185 lw=3200
2022-06-10 15:57:58.101024 [DEBUG] switch_rtp.c:5084 Queue digit delay of 40ms
...
summary
After the call is connected , Use send_dtmf send out DTMF code , But in actual use , There are two problems .
The first question is , send out DTMF The code will be superimposed with the playback voice .
The second question is , send out DTMF code app After performing , Not immediately , Instead, wait for the media stream to be sent and start sending .
I wanted to finish the source code flow together , But after tracing the source code , It is found that the logic of code calls is complex , There are many jumps between different modules , A separate chapter will be devoted to the code flow .
Empty as usual
Be serious
边栏推荐
- 表格中el-tooltip 实现换行展示
- Infinite horizontal marble game
- Thesis learning record essay multi label lift
- Oracle 序列+触发器
- 69 cesium code datasource loading geojson
- Preliminary level of C language -- selected good questions on niuke.com
- It's not that you have a bad mind, but that you haven't found the right tool
- OpenGL ES: (5) OpenGL的基本概念、OpenGL ES 在屏幕产生图片的过程、OpenGL管线(pipeline)
- 【文件系统】如何在ubi之上运行squashfs
- 健康照明中应用的LED照明灯
猜你喜欢
OpenGL es: (5) basic concepts of OpenGL, the process of OpenGL es generating pictures on the screen, and OpenGL pipeline
芯片,建立在沙粒上的帝国!
Crossing pie · pie pan + Mountain duck = local data management
kotlin位运算的坑(bytes[i] and 0xff 报错)
linux 关闭redis 进程 systemd+
69 cesium code datasource loading geojson
【文件系统】如何在ubi之上运行squashfs
[note] e-commerce order data analysis practice
Linux closes the redis process SYSTEMd+
skywalking集成nacos动态配置
随机推荐
He struggled day and night to protect his data
Retention rate of SQL required questions
利用百度地图查询全国地铁线路
关于一道01背包问题的·拓展题的思考
ArcServer密码重置(账号不可以重置)
Linux closes the redis process SYSTEMd+
可动的机械挂钟
Pla ne colle pas sur le lit: 6 solutions simples
el-table 动态表头渲染 固定第一列 高度问题
穿越派·派盘 + 思源笔记 = 私人笔记本
浏览器端保存数据到本地文件
DEV XPO对比之UOW
蚂蚁新村田头村变甜头村 让厦门灌口镇田头村变甜头村的特色农产品之一是
Infinite horizontal marble game
In win10 and win11, the scroll direction of Elan touch panel is reversed, and "double finger click to open the right-click menu" and "double finger scroll" are started“
How to transmit and share 4GB large files remotely in real time?
[note] e-commerce order data analysis practice
excel可视化
It's not that you have a bad mind, but that you haven't found the right tool
2022第八届中国国际“互联网+”大学生创新创业大赛产业命题赛道开启报名!