Kevin Smith wrote:> Hey everyone,
>
> We have a special mail box for certain customers when we are out of
> the office. Basically they enter a pin number and if it is valid they
> leave a message and it notifies the on call techs. My question is
> regarding externnotify for the voice mail.conf. If I enabled that and
> set up a call file, will it do it for every voice mail box I have on
> the system?
Yes
> Is there a way I can limit it to just the one voice mail box on the
> system?
This is what I do:
Create a database entry for that extension, I call it vmcallback. The
entries can either be YES or NO. At every point in your dial plan you
need to check for that entry against the extension that voice mail is
being left for. If the value is YES, then run the script that copies
the .call file to the outgoing.
[macro-sip.extensions]
exten => s,1,Set(CALLBACK=${DB(vmcallback/${ARG1})})
exten => s,2,NoOP(${CALLBACK})
exten => s,3,SetMusicOnHold(epi-cd)
exten => s,4,Dial(SIP/${ARG1},28,t)
exten => s,5,NoOP(Dial Status: ${DIALSTATUS})
exten => s,6,NoOP(Hangup Cause: ${HANGUPCAUSE})
exten => s,7,Goto(s-${DIALSTATUS},1)
exten => s-CHANUNAVAIL,1,Voicemail(u${ARG1}@sip)
exten => s-NOANSWER,1,GotoIf($["${CALLBACK}" =
"YES"]?s-NOANSWER,2:s-NOANSWER,3)
exten => s-NOANSWER,2,System(/usr/local/bin/vm-callout.sh ${ARG1})
exten => s-NOANSWER,3,Voicemail(u${ARG1}@sip)
exten => s-BUSY,1,Voicemail(b${ARG1}@sip)
exten => s-CANCEL,1,Congestion()
exten => h,1,NoOP(Hungup)
My callout script copies a pre-created .call file, sets the date 5
minutes into the future, copies it to the outgoing directory (While
preserving the time stamps). When the 5 minutes have passed, Asterisk
acts on it. Script contents below:
#!/bin/sh
cd /usr/local/bin
/bin/touch /usr/local/bin/$1.call
/bin/touch -r /usr/local/bin/$1.call -m -F 300 /usr/local/bin/$1.call
cp --preserve=timestamps /usr/local/bin/$1.call
/var/spool/asterisk/outgoing/
--
Ben Franklin quote:
"Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety."