当前位置:网站首页>Freeswitch uses origin to dialplan
Freeswitch uses origin to dialplan
2022-06-28 06:23:00 【Be realistic】

summary
Freeswitch Is a very easy to use open source VOIP Softswitch platform .
I've been right recently fs Do some functional tests , A requirement generated during testing , How to go from fs Initiate a call and transfer the subsequent call flow to a dialplan On , This will be very convenient and easy to use when testing , It can be modified at any time dialplan Customize business processes .
Through to fs After official document search , Exclude “transfer”、“execute_extension”、“bind_meta_app”, By chance “originate” Interfaces can directly implement such functional requirements .
Environmental Science
centos:CentOS release 7.0 (Final) Or above
freeswitch:v1.8.7
GCC:4.8.5
originate
originate It's a API Interface , The interface format is as follows .
originate <call url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]
Interface instance .
originate {origination_caller_id_number=9005551212}sofia/default/[email protected] &bridge({origination_caller_id_number=8001234567}sofia/profile/[email protected])
From the interface format ,originate The interface can use “&” Pick up a APP Interface , Continue the process after the call is connected , But sometimes one APP It's not enough , So we need to be in “originate” Then transfer the call flow to dialplan Continue to deal with .
turn dialplan Interface instance of .
originate {origination_caller_id_number=9005551212}sofia/default/[email protected] 19005551212 XML default CALLER_ID_NAME CALLER_ID_NUMBER
In this case , Use originate The interface initiates a call , Then go to XML Type of dial plan “default” in .
To configure
Modify 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="1234"/>
<action application="sleep" data="5000"/>
<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 And play the prompt voice , The log is as follows .
[email protected]> originate {originator_codec=PCMA,origination_caller_id_number=0755110}sofia/external/sip:[email protected]:5080 1001 XML ext_test
...
2022-06-13 11:37:15.601015 [DEBUG] sofia.c:7084 Channel sofia/external/[email protected]:5080 entering state [ready][200]
...
2022-06-13 11:37:15.610983 [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(1234)
Dialplan: sofia/external/[email protected]:5080 Action sleep(5000)
Dialplan: sofia/external/[email protected]:5080 Action endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
...
EXECUTE sofia/external/[email protected]:5080 sched_hangup(+10)
EXECUTE sofia/external/[email protected]:5080 send_dtmf(1234)
2022-06-13 11:37:15.610983 [DEBUG] switch_core_io.c:1918 sofia/external/[email protected]:5080 send dtmf digit=1 ms=250 samples=2000
...
EXECUTE sofia/external/[email protected]:5080 sleep(5000)
...
EXECUTE sofia/external/[email protected]:5080 endless_playback(/usr/local/freeswitch/sounds/101-baidu-mp3.mp3)
...
2022-06-13 11:37:25.121013 [DEBUG] switch_ivr_play_say.c:1942 done playing file /usr/local/freeswitch/sounds/101-baidu-mp3.mp3
...
2022-06-13 11:37:25.121013 [DEBUG] mod_sofia.c:440 Channel sofia/external/[email protected]:5080 hanging up, cause: ALLOTTED_TIMEOUT
summary
Use originate Interface , Call forwarding can be realized directly dialplan Business process .
Think about it , adopt bridge Transfer to a dailplan It should also have the feasibility of implementation . The specific situation has not been thoroughly understood .
Empty as usual
Be serious
边栏推荐
- Object对象转 List集合
- Shell script one click deployment (MySQL)
- 报错--解决core-js/modules/es.error.cause.js报错
- Yygh-7-user management
- Xcode13.3.1 error reported after pod install
- How to add live chat in your Shopify store?
- What are the advantages of e-mail marketing? Why do sellers of shopline independent station attach so much importance to it?
- Yolact++ Pytorch环境
- 使用SQL select count distinct查询语句统计数据库中某个字段的唯一值总数量
- Boost the rising point | yolov5 combined with alpha IOU
猜你喜欢

Drop down list processing in Web Automation

自定义 cube-ui 弹出框dialog支持多个且多种类型的input框

Small ball playing

socke.io长连接实现推送、版本控制、实时活跃用户量统计

death_ satan/hyperf-validate

职场IT老鸟的几点小习惯

death_satan/hyperf-validate

AutoCAD C# 多段线自相交检测

【Paper Reading-3D Detection】Fully Convolutional One-Stage 3D Object Detection on LiDAR Range Images

socke.io長連接實現推送、版本控制、實時活躍用戶量統計
随机推荐
AttributeError: 'callable_iterator' object has no attribute 'next'
Lombok @equalsandhashcode annotation how to make objects The equals () method compares only some attributes
Online facing such an online world, the only limitation is our imagination
慢内容广告:品牌增长的长线主义
sql及list去重操作
cocoapod中的第三方库怎么引用本地头文件
YYGH-BUG-02
图片按日期批量导入WPS表格
ROS rviz_satellite功能包可视化GNSS轨迹,卫星地图的使用
Parsing ng template with let total in NZ Pagination
Apple MDM bypass jailfree bypass MDM configuration lock free
RN7302三相电量检测(基于STM32单片机)
语音增强-频谱映射
重载,重写的区别,抽象类,接口的区别
Common basic functions of Oracle
How popular are FB and WhatsApp mass messages in 2022?
Deleting MySQL under Linux
Using pytorch and tensorflow to calculate the confusion matrix of classification model
AutoCAD C# 多段线自相交检测
D3D11_ Chili_ Tutorial (3): design a bindable/drawable system