在我的voicemail.conf文件中,有一行如下所示:
mailcmd=php /path/to/file.php 1234
在这种情况下,传递给file.php的"1234“是一个扩展,但坦率地说,只要它可以用来标识语音邮件存储的收件箱,我就不在乎传递什么。因此,我真的需要能够传递一个变量,如下所示:
mailcmd=php /path/to/file.php "${VM_NAME}“
当我这样做时,我会在PHP文件中得到一个空参数。我尝试过几个不同的通道变量,但是,除非值是硬编码的,否则我从来没有得到任何工作。
我是否可以在这里做我想做的事,如果有,我做错了什么?
发布于 2018-08-16 17:55:03
简单地说,这是不可能的。voicemail.conf在使用mailcmd时无法使用星号的变量。
作为另一种选择,我需要在PHP脚本中使用STDIN来收集电子邮件头信息,这可以配置为相对容易地获得扩展。
发布于 2018-08-16 22:31:32
来自voicemail.sample.conf
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.样品为这里
https://stackoverflow.com/questions/51880359
复制相似问题