[asterisk-users] externnotify script not running

Mike Diehl mdiehl at diehlnet.com
Mon Mar 21 15:32:22 CDT 2022


Well, I didn't get it working, but I was able to work around this.  

I have an agi script, hangup.agi, assoicated with the h extension.

In that script, I make a call to system() that runs the script I wanted to run 
for vm delivery.  

This works for me.

Thanks for your time.

Mike.


On Thursday, March 17, 2022 5:23:19 PM EDT TTT wrote:
> Unless someone else chimes in (who knows for sure)...
> 
> I wonder if Asterisk restricts location of file it will run.  Try moving to
> /var/lib/asterisk as a test and see if it executes
> 
> Next I would start to wonder about the other obvious stuff...very hard to
> see if you have been looking at it for hours.  Try 777 permission on the
> file and perhaps up the path leading to the file.  (just to experiment)
> 
> Try complete service restart of Asterisk
> 
> ...and after that I'm out of helpful ideas.  You may have to retrace your
> steps for something you missed, since this all seems pretty straight
> forward.  (I haven't tryied, but if verbose it up on the CLI will you see a
> message/error when ast tries to run your scrip)
> 
> 
> -----Original Message-----
> From: asterisk-users [mailto:asterisk-users-bounces at lists.digium.com] On
> Behalf Of Mike Diehl Sent: Thursday, March 17, 2022 4:55 PM
> To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
> <asterisk-users at lists.digium.com> Subject: Re: [asterisk-users]
> externnotify script not running
> 
> These were all good ideas.  I changed my script to a bash script called
> deliver_vm.sh:
> 
> ======================================================
> #!/bin/bash
> 
> echo testme >> /home/phones/test.txt
> ======================================================
> 
> The permissions are correct:
> 
> # ls -la commands/deliver_vm.*
> -rwxr-xr-x 1 root root 254 Mar 16 21:12 commands/deliver_vm.pl -rwxrwxrwx 1
> root root  50 Mar 17 14:17 commands/deliver_vm.sh
> 
> It does run from the command line, but still not from Asterisk.
> 
> It feels like a configuration issue in Asterisk.  Here is what I have:
> 
> externnotify=/home/phones/commands/deliver_vm.sh ${VM_NAME} ${VM_DUR} $
> {VM_MSGNUM} ${VM_MAILBOX} ${VM_CALLERID} ${VM_DATE}
> 
> After I made the change, I did:
> 
> module reload app_voicemail.so
> 
> 
> Anything else I can check/do?
> 
> Thanks again,
> 
> Mike.
> 
> On Thursday, March 17, 2022 3:53:46 PM EDT TTT wrote:
> > Can I suggest you eliminate a few obvious factors...
> > 
> > Like 1. try a bash script first instead of perl, 2. Have the bash
> > script just issue a "logger' command
> > 
> > If that works go back to perl which does the same.  If that works,
> > change you perl script to dump all vars to a file..etc.
> > 
> > Also, check your script for nonprintable characters.  Does the script
> > run from the command line?  (if you feed it vars)
> > 
> > -----Original Message-----
> > From: asterisk-users [mailto:asterisk-users-bounces at lists.digium.com]
> > On Behalf Of Mike Diehl Sent: Thursday, March 17, 2022 3:37 PM
> > To: Asterisk Users Mailing List - Non-Commercial Discussion
> > <asterisk-users at lists.digium.com> Subject: Re: [asterisk-users]
> > externnotify script not running
> > 
> > No, this machine doesn't have selinus installed/configured/enforced.
> > 
> > Is there a debug setting I could use to debug this?  I didn't see
> > anything in the logs.
> > 
> > Perhaps there is a working configuration that someone would share?
> > 
> > Thanks again,
> > 
> > Mike.
> > 
> > On Thursday, March 17, 2022 2:22:47 AM EDT Marek Greško wrote:
> > > Hello,
> > > 
> > > maybe selinux could be the cause?
> > > 
> > > Marek
> > > 
> > > 
> > > Sent with ProtonMail secure email.
> > > 
> > > ------- Original Message -------
> > > 
> > > On Wednesday, March 16th, 2022 at 21:10, Mike Diehl
> > > <mdiehl at diehlnet.com>
> > 
> > wrote:
> > > > Hi all,
> > > > 
> > > > I'm trying to build a custom voicemail delivery system using
> > > > externnotify in
> > > > 
> > > > voicemail.conf. But, the configured script doesn't seem to run.
> > > > 
> > > > I have:
> > > > 
> > > > externnotify=/home/phones/commands/deliver_vm.pl ${VM_NAME}
> > > > ${VM_DUR} $
> > > > 
> > > > {VM_MSGNUM} ${VM_MAILBOX} ${VM_CALLERID} ${VM_DATE}
> > > > 
> > > > The deliver_vm.pl has read and execute permissions.
> > > > 
> > > > Here is the file I have:
> > > > 
> > > > ===============================================================
> > > > 
> > > > #!/usr/bin/perl
> > > > 
> > > > $a = join("\t", @ARGV);
> > > > 
> > > > open FILE, ">>/tmp/test.txt";
> > > > 
> > > > print FILE "$a\n";
> > > > 
> > > > close FILE;
> > > > 
> > > > ===============================================================
> > > > 
> > > > After I leave a voicemail message, I expect to find something in
> > > > /tmp/test.txt,
> > > > 
> > > > but I don't.
> > > > 
> > > > What am I missing?
> > > > 
> > > > Thanks in advance.
> > > > 
> > > > Mike.
> > > > 
> > > > --
> > > > 
> > > > __________________________________________________________________
> > > > __
> > > > _
> > > > 
> > > > -- Bandwidth and Colocation Provided by http://www.api-digital.com
> > > > --
> > > > 
> > > > Check out the new Asterisk community forum at:
> > > > https://community.asterisk.org/
> > > > 
> > > > New to Asterisk? Start here:
> > > > 
> > > > https://wiki.asterisk.org/wiki/display/AST/Getting+Started
> > > > 
> > > > asterisk-users mailing list
> > > > 
> > > > To UNSUBSCRIBE or update options visit:
> > > > 
> > > > http://lists.digium.com/mailman/listinfo/asterisk-users
> > 
> > --
> > _____________________________________________________________________
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> > 
> > Check out the new Asterisk community forum at:
> > https://community.asterisk.org/
> > 
> > New to Asterisk? Start here:
> >       https://wiki.asterisk.org/wiki/display/AST/Getting+Started
> > 
> > asterisk-users mailing list
> > 
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20220321/f6093fa2/attachment.sig>


More information about the asterisk-users mailing list