Patrick
2004-Oct-24 18:48 UTC
[Asterisk-Users] Howto get voicemail $VM_ vars into externnotify script?
Hi all, I am trying to slap together a script that will email2sms the details of the voicemails left on my * box to my gsm phone. I can't figure out how to get my script to pick up the voicemail vars like ${VM_MSGNUM}, ${VM_DATE}, ${VM_MAILBOX}, ${VM_CALLERID}, ${VM_DUR}. Right now I have this: #!/bin/sh /bin/mail -s "Voicemail received with details: Msg nr : `echo $VM_MSGNUM` Msg date: `echo $VM_DATE` For : `echo $VM_MAILBOX`>From : `echo $VM_CALLERID`Length : `echo $VM_DUR`" email@domain Which doesn't work as all the $VM_ vars show up blank. Any ideas? TIA, Patrick
Wilson Pickett
2004-Oct-25 02:09 UTC
[Asterisk-Users] Howto get voicemail $VM_ vars into externnotify script?
> I am trying to slap together a script that will email2sms the details of > the voicemails left on my * box to my gsm phone. I can't figure out how > to get my script to pick up the voicemail vars like ${VM_MSGNUM}, > ${VM_DATE}, ${VM_MAILBOX}, ${VM_CALLERID}, ${VM_DUR}.change the voicemail.conf to include them in the body using the emailbody as in emailbody=${VM_NAME} <${VM_MAILBOX}>\n\nYou have received a ${VM_DUR} message from ${VM_CALLERID}. The message was left on ${VM_DATE}. The above probably needs to be on one line. Just change the wording the way you want it.
usedcanon
2004-Oct-25 13:33 UTC
[Asterisk-Users] Re: Howto get voicemail $VM_ vars into externnotify script?
On Mon, 2004-10-25 at 11:09, Wilson Pickett wrote:> > I am trying to slap together a script that will email2sms the details of > > the voicemails left on my * box to my gsm phone. I can't figure out how > > to get my script to pick up the voicemail vars like ${VM_MSGNUM}, > > ${VM_DATE}, ${VM_MAILBOX}, ${VM_CALLERID}, ${VM_DUR}. > change the voicemail.conf to include them in the body using the emailbodyas in> > emailbody=${VM_NAME} <${VM_MAILBOX}>\n\nYou have received a ${VM_DUR} > message from ${VM_CALLERID}. The message was left on ${VM_DATE}.Hi Wilson, Thanks for your suggestion. I already have normal voicemail notification via email working. Just as you pointed out. What I want to do besides this is use a script configured in externnotify=/home/patrick/myapp.sh in voicemail.conf to email this same data to a special email address that will forward that data automatically as an sms message to my gsm phone. This simple script doesn't even work: $cat myapp.sh #!/bin/sh echo $emailbody So either I am doing something not right or maybe these vars are not exported (or whatever the right word is) by app_voicemail and can't be accessed by other applications. Any ideas? Thanks, Patrick>>>>Patrick, For every voicemail message left there is a text file placed in the voicemail folder that has the information you are seeking. Your external script or application good check this file and and extract the information accordingly. Bear in mind that the last message left will be the highest filename so for example if you have the following files in the INBOX msg0000.txt msg0001.txt msg0002.txt in this case msg0002.txt would be the latest message and the message that you are being notified about by externnotify. I hope this information helps you solve your problem. Umar