快捷搜索:  汽车  科技

freeswitch模块开发,freeswitch拨打分机号源代码跟踪

freeswitch模块开发,freeswitch拨打分机号源代码跟踪因为dialplan中的流程是先“send_dtmf”,然后“sleep”,所以从上面的调用流程图中,可以看到流程起点都是从mod_dptools模块开始的。<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=&#

freeswitch模块开发,freeswitch拨打分机号源代码跟踪(1)

概述

freeswitch是一款非常好用的开源VOIP软交换平台。

之前我们有介绍过使用fs拨打分机号的方法,其中代码流程是比较复杂的,所以单独开一章介绍。

fs拨打分机号,是使用send_dtmf接口实现,本节主要介绍接口是如何把DTMF码发送出去的,经过了哪些模块。

环境

centos:CentOS release 7.0 (Final)或以上版本

freeswitch:v1.8.7

GCC:4.8.5

拨号计划

fs配置文件/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>源代码流程

图1,“FS CORE”是freeswitch的核心模块,“mod_dptools”和“mod_sofia”是fs的子模块。

freeswitch模块开发,freeswitch拨打分机号源代码跟踪(2)

因为dialplan中的流程是先“send_dtmf”,然后“sleep”,所以从上面的调用流程图中,可以看到流程起点都是从mod_dptools模块开始的。

总结

freeswitch核心模块的流程和子模块众多,模块之间的调用和注册回调函数比较复杂,流程多变。

梳理子模块功能代码流程有助于理解fs的整体架构。

空空如常

求真得真

猜您喜欢: