当前位置:网站首页>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
边栏推荐
- three.js小结
- ONEFLOW source code parsing: automatic inference of operator signature
- Essay learning record essay multi label Global
- 利用百度地图查询全国地铁线路
- restframework-simpleJWT重写认证机制
- Build 2022 上开发者最应关注的七大方向主要技术更新
- 可动的机械挂钟
- How to add a gourd pie plate
- OpenGL es: (4) detailed explanation of EGL API (Continued)
- 解决麒麟V10上传文件乱码问题
猜你喜欢

千万不要把笔记视频乱放!

健康照明中应用的LED照明灯

FPGA - 7系列 FPGA内部结构之Clocking -01- 时钟架构概述

Talking from mlperf: how to lead the next wave of AI accelerator

亲爱的派盘用户,我要向您表白!

穿越派·派盘 + 思源笔记 = 私人笔记本

DHT11 温湿度传感器

Dear pie users, I want to confess to you!

数据库问题,如何优化Oracle SQL查询语句更快,效率更高

Small guide for rapid completion of mechanical arm (VI): stepping motor driver
随机推荐
Stack Title: parsing Boolean expressions
无限水平大理石游戏
Debug details under pycharm
He struggled day and night to protect his data
Database problems, how to optimize Oracle SQL query statements faster and more efficient
This is the necessary software for college students 𞓜 knowledge management
excel初级应用案例——杜邦分析仪
让厦门灌口镇田头村变甜头村的特色农产品之一是蚂蚁新村
excel動態圖錶
3D打印机穿线:5种简单的解决方案
Code shoe set - mt3114 · interesting balance - explain it with examples
Talking from mlperf: how to lead the next wave of AI accelerator
excel可视化
OpenGL es: (5) basic concepts of OpenGL, the process of OpenGL es generating pictures on the screen, and OpenGL pipeline
这才是大学生必备软件 | 知识管理
Diagramme dynamique Excel
OpenGL ES: (4) EGL API详解 (转)
Call us special providers of personal cloud services for College Students
【笔记】电商订单数据分析实战
π盘,让您电脑变成个人的私有云