[asterisk-bugs] [JIRA] (ASTERISK-18207) externnotify script called with (null) context parameter during pollmessages run, essentially stopping it from running.
Karsten Wemheuer (JIRA)
noreply at issues.asterisk.org
Wed Mar 6 11:59:01 CST 2013
[ https://issues.asterisk.org/jira/browse/ASTERISK-18207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=203920#comment-203920 ]
Karsten Wemheuer commented on ASTERISK-18207:
---------------------------------------------
Hi,
I stumbled into the same issue and created a patch (See attached patch-20130306).
The message in the log is printed, because "poll_subscribed_mailbox" calls {code}run_externnotify(NULL, mwi_sub->mailbox, NULL);{code}
In all other cases the first parameter is not NULL.
This NULL parameter leads to the text "(null)" in the logging. Directly behind the logging there is a call to "ast_safe_system". The string in the log is used as parameter „s“ for a shell in „ast_safe_system“:{code}execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL);{code}
The external script is not executed because the shell command is broken.
The attached patch sets an empty parameter in the call to the external script. In my case the logging is changed from {code}Executing /usr/bin/voicemail_notify (null) 289 at default 0 2 0 &{code} to {code}Executing /usr/bin/voicemail_notify "" 289 at default 0 2 0 &{code}
The patch works for asterisk 1.8 (trunk)
> externnotify script called with (null) context parameter during pollmessages run, essentially stopping it from running.
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: ASTERISK-18207
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-18207
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Applications/app_voicemail
> Affects Versions: 1.8.5.0
> Environment: CentOS5.6, Asterisk 1.8.5, IMAP voicemail storage.
> Reporter: Barry L. Kline
> Attachments: patch-20130306
>
>
> The documentation for Voicemail notes that the externnotify script will be called whenever a voicemail message is left. Provided that pollmailboxes is set to 'yes' and pollfreq is non-zero. I have been unable to get the script to run when I've listened to the voicemail message via an email client.
> With debug sent to the messages log and turning on debug, I note:
> [asterisk at crpsvvoip001 asterisk]$ tail -f /var/log/asterisk/messages -n500 | grep mwi.pl
> [Jul 28 17:45:41] DEBUG[17349] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl (null) 134 at VREC 0 3 0 &
> [Jul 28 17:46:02] DEBUG[17358] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl VREC 134 1 3 0 &
> [Jul 28 17:46:11] DEBUG[17354] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl (null) 134 at VREC 1 3 0 &
> [Jul 28 17:47:11] DEBUG[17354] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl (null) 134 at VREC 0 4 0 &
> [Jul 28 17:47:41] DEBUG[17354] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl (null) 134 at VREC 0 0 0 &
> The only time the parameters will called with the correct order was when the message was left. The times where is was called from the polling routine is incorrect and causes the script to be ignored.
> To perhaps make clearer what I'm trying to convey, the problem is like this:
> * A voicemail is left in a mailbox, in this case 134.
> * Asterisk executes properly the mwi script:
> [Jul 28 17:46:02] DEBUG[17358] app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl VREC 134 1 3 0 &
> * The voicemail is listened to (doesn't matter how)
> * Asterisk then executes the mwi script:
> app_voicemail.c: Executing /opt/asterisk/bin/mwi.pl (null) 134 at VREC 0 3 0 &
> * Because of the (null) the script will not be executed by the shell.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the asterisk-bugs
mailing list