[Asterisk-Users] Help with shell script for externnotify

Hadley Rich asterisk at nice.net.nz
Thu Nov 17 21:45:28 MST 2005


On Friday 18 November 2005 15:32, Tom Rymes wrote:
> Basically, I have 14 after-hours mailboxes that all have different e-
> mail addresses. I want this script to parse the mailbox number from  
> the original command ($2), and then somehow look that up mailbox's  
> address and send an e-mail. It then checks every five minutes to see  
> if the message has been retrieved, and escalates things as necessary.  
> I don't mind the messy solution of defining all 14 addresses in the  
> script itself, though it would be nice to look it up from  
> voicemail.conf or something eventually.

I'm not sure I understand what you are trying to do, but this may (or may not) 
help.

You mentioned looking up the email field from voicemail.conf, this should do 
that:

EXTEN=`echo $2 | cut -f 1 -d @`
EMAIL=`cat voicemail.conf | grep '^$EXTEN' | cut -d ',' -f 3`

The above ignores contexts so if you have more than one it will not work.

HTH

hads

-- 
"At a recent meeting in Snowmass, Colorado, a participant from Los
Angeles fainted from hyperoxygenation, and we had to hold his head
under the exhaust of a bus until he revived."



More information about the asterisk-users mailing list