curl - Freeswitch dialplan cURL - 如何设置超时
问题描述
我正在尝试配置 FreeSWITCH 拨号计划,我在这里尝试实现的是在使用外部 Web 服务将呼叫者连接到代理之前获取有关呼叫者的更多信息。我面临的问题是,有时网络服务需要比平时更多的时间来响应请求。那么有没有办法在拨号计划的 cURL 请求上设置超时?下面是 XML 配置:
<condition field="${IS_INTIME}" expression="true">
<action inline="true" application="curl" data="https://test.com/service?caller_id_number=${caller_id_number}&token=123"/>
<action application="set" data="IS_VIP=${curl_response_data}" inline="true"/>
</condition>
提前致谢!
解决方案
根据curl 命令的mod_curl 文档语法如下:
curl url [headers|json|content-type <mime-type>|connect-timeout <seconds>|timeout <seconds>] [get|head|post|delete|put [data]]
所以尝试使用data="https://test.com/service?caller_id_number=${caller_id_number}&token=123 timeout 60"/>
推荐阅读
- cuda - Cuda Occupancy Calculator 的更新版本或替代品是什么?
- node.js - 你如何实现一个 HTML 表单,它接受用于标签/主题标签值的文本输入?
- mysql - 通过始终包含所有语言从表中获取翻译,即使没有翻译
- c# - 如何仅为某个类层次结构创建通用函数?
- encoding - 使用 Java 9 和使用日语语言环境时,来自 JVM 的异常消息未在控制台中正确打印(可能是由于字符串紧凑)
- java - 即使在关闭应用程序后仍保留文本字段中的值
- scilab - 对于给定的示例,我应该使用什么数值方法?
- laravel - 用于搜索的 Laravel 查询
- python - 为什么 gdspy 库在尝试使用布局查看器时会出现 tkinter tcl 错误
- r - 如果值存在于环境中