Ugh! externnotify not running its script at all

I’m on asterisk and I have an externnotify=/usr/bin/myapp script defined.

Just to simplify things I have the script simply echo’ing values to a file. I can run it manually just fine. when I leave a vm it never gets run. Asterisk is installed from source, runs as root there is no asterisk user and so file is root:root with perms at 755.

Why is it never run? does something have to be compiled with asterisk that I missed?

this has to be something simple. asterisk simply isn’t even trying to run the externnotify script. I even moved my vm from its own context back to default thinking maybe it only fired for default context. didn’t help.

The script isn’t being executed.

Anyone figure this out yet ?

I’ve upgraded to 1.4.26-rc6

same issue.

It just comes down to externnotify= is being completely ignored.

rmalmstead, you have same issue?

I use a ubuntu hardy server and I’ve compiled asterisk from src each time. Is there something I’m missing in make menuselect that this might need?

I’m running CentOS.
I guess I just expect it to work… but it doesn’t … at all.

I’m begining to think it’s simply broken in versions.

I sincerely doubt it has anything to do with your installation.
I’m actually working with another person who has the same exact issue on

well being that i’m only using this for voicemail for callmanager I guess I can go to the latest 1.6.x and see if that magically fixes it. I just was trying to use this script to fire off/on mwi.

I was trying to use it for the same purpose…MWI

Though… I can live without it… it’s a “nice to have”.

I won’t be upgrading to 1.6, because it’s not worth the risks to the production environment.

I’m going to hold out for a patch, or other fix.

well its not 1.4.xx…

must be something we are doing wrong…

i’m now running same thing.

I’m thuroughly invested now…lol…
It’s personality flaw I have, if I can’t make something work…i get obsessed.

I will make this work…even if I have to fix the source code myself. (not a c programmer)

Everywhere I look, I find people who have had success using it in previous versions, and even trixbox… I follow exactly what they did, but do not get the same result.

In the wiki, I says the externnotify is passing three variables to whatever script you choose… (context, extension, numvmessages)…

However, in the source code of Voicemail.c It’s appears to be only accessing 2 variables, not 3. I don’t see any code to run the actual script…unless you enter smdi in the externnotify then it does the smdi routine.

I have a programmer friend who is going to look this over with me. There is definitely something strange with the source. I can’t identify where exactly it runs the script if you don’t use smdi.

OK… there’s something weird here.

Try this on your Asterisk CLI…


…let me know if it actually works… mine didn’t.

Got it working…

Not sure why this makes any difference…

I put my script in /root/

So my externnotify=/root/

echo “test” > /root/testfile

funny. got it working too but went a different way though i think related. I put my script whereever (/var/lib/asterisk/scripts/) but instead of having its output go right to the outgoing folder I have it going to /tmp/whatever first. then at the end I do a mv from /tmp/whatever to the asterisk/outgoing folder.

I think cause of same issue (something with having asterisk run as root) it wouldn’t output right there.

Your solution, having the script actually reside in the /root folder is probably another workaround for whatever the issue was.

I have found that restarting asterisk from the command line helps the scripts run correctly. Was pulling out my hair, part of my script seemed flawless and half just never seemed to never execute. Started restarting asterisk between changes and the issue disappeared.

This is an ancient thread, but replying here as it came up on a google search and I had the same problem. I got externnotify working on Asterisk 15 by:

  • ensure script and log (if you are logging from your script) are owned by asterisk user, if your process runs as asterisk
  • ensure executable, of course

The reason it worked (for scott_helinback) run manually, likely was the PrivateTmp setting in the systemd unit file for Asterisk. Meaning even if you point your custom log to /tmp/whatever, it’s actually going into something like /tmp/systemd-private-e57089c28483455199332e8d01528544-asterisk.service-LZ5tFn/tmp/notify.log.

Check /tmp for the systemd path to the asterisk dir. Hope that helps anyone with externnotify seeming like it’s not working.