首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在voicemail.conf中使用mailcmd将变量作为参数传递

在voicemail.conf中使用mailcmd将变量作为参数传递
EN

Stack Overflow用户
提问于 2018-08-16 15:15:07
回答 2查看 521关注 0票数 1

在我的voicemail.conf文件中,有一行如下所示:

mailcmd=php /path/to/file.php 1234

在这种情况下,传递给file.php的"1234“是一个扩展,但坦率地说,只要它可以用来标识语音邮件存储的收件箱,我就不在乎传递什么。因此,我真的需要能够传递一个变量,如下所示:

mailcmd=php /path/to/file.php "${VM_NAME}“

当我这样做时,我会在PHP文件中得到一个空参数。我尝试过几个不同的通道变量,但是,除非值是硬编码的,否则我从来没有得到任何工作。

我是否可以在这里做我想做的事,如果有,我做错了什么?

EN

回答 2

Stack Overflow用户

发布于 2018-08-16 17:55:03

简单地说,这是不可能的。voicemail.conf在使用mailcmd时无法使用星号的变量。

作为另一种选择,我需要在PHP脚本中使用STDIN来收集电子邮件头信息,这可以配置为相对容易地获得扩展。

票数 1
EN

Stack Overflow用户

发布于 2018-08-16 22:31:32

来自voicemail.sample.conf

代码语言:javascript
复制
externnotify

Want to run an external program whenever a caller leaves a voice mail message for a user? This is where the externnotify command comes in handy. Externnotify takes a string value which is the command line you want to execute when the caller finishes leaving a message.
Note: see an example of an external notification script here.
Note: This command will also run after a person who has logged into a mailbox exits the VoiceMailMain() application. (Remark: This seems not to be the case for Asterisk 1.2.x)

The way it works is basically any time that somebody leaves a voicemail on the system (regardless of mailbox number), the command specified for externnotify is run with the arguments (in this order): context, extension, new voicemails, old voicemails and urgent voicemails. These arguments are passed to the program that you set in the externnotify variable.

样品为这里

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51880359

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档