阅读说明
笔记根据freeswitch官方文档和FreeSWITCH权威指南简单介绍originate的基本用法,最后概述下自己的阅读测试结论
originate 概述
-Originate a new call.
Usage
originate <call_url> <exten>|&<application_name>(<app_args>) [<dialplan>] [<context>] [<cid_name>] [<cid_num>] [<timeout_sec>]
尖括号中是必选参数,方括号中是可选参数
FreeSWITCH will originate a call to <call_url> as Leg A. If that leg supervises within 60 seconds FS will continue by searching for an extension definition in the specified dialplan for <exten> or else execute the application that follows the & along with its arguments.
使用<call_url> (即呼叫字符串)作为A腿,如果60s超时后执行call_url后的<exten> dialplan或执行&后的APP。
supervises within 60 seconds 这里如果将supervises翻译为监督感觉怪怪的,我到FreeSWITCH mod_commands中看了下源码,在originate中调用了switch_ivr_originate接口,其中入参timelimit_sec 默认值为60 seconds,如果该函数在60s内执行成功,则后续会执行 <exten> 拨号计划或者 &后的APP。那么如何判断是执行<exten>还是&APP呢?源码中有一句话
if (*exten == '&' && *(exten + 1))
即如果 <call_url> 后面是 & 符号,且&后的<application_name>字符长度不为0,则执行APP,如果不是&符号,就执行<exten>的dialplan
originate 用法
标签:fs,dialplan,seconds,APP,originate,FreeSWITCH,执行,ext01 From: https://www.cnblogs.com/cpp-muggle/p/16835685.html