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." _______________________________________________ --Bandwidth and Colocation sponsored by Easynews.com -- Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users