Pass Parms to externnotify


#1

I wrote a perl program that will send a SMS message to my cell phone.
Now I would like pass caller ID information to my program when someone leaves me a Voice mail.

It looks like the externotify feature in voicemail.conf will do what I want it to but how do you pass the following variables to the external program?

VM_NAME
VM_DUR
VM_MSGNUM
VM_MAILBOX
VM_CIDNUM
VM_CIDNAME
VM_CALLERID
VM_DATE

Thank you

Todd


#2

I think I figured it out!!

But it is not as clean as it should be.

By default the externotify program is passed 3 parms

Context
vmail box number
current message number

Subtract 1 from the current message number

then open file

/var/spool/asterisk/voicemail/default/$ext/INBOX/msg$padnum.txt

where $ext = vmail box number
$padnum = a padded message number
ie if your message number was 5 then the $padnum = 0005
if your message number was 10 then the $padnum =0010

Inside the file you will find the caller ID information and date and time the message was sent.
[message]
origmailbox=213
context=macro-vm
macrocontext=from-internal
exten=s-NOANSWER
priority=1
callerchan=SIP/216-1f24
callerid=“device” <216>
origdate=Sat Apr 8 11:21:46 PM EDT 2006
origtime=1144552906
category=
duration=7