[Asterisk-Users] SIP extension "busy" when not available ??
Vic Cross
vicc at veejoe.com.au
Mon Feb 23 23:31:19 MST 2004
G'day Soren,
On Tue, 24 Feb 2004, Soren Rathje wrote:
> [dnd]
> ; *61# turns it on
> ; *60# turns it off
> ;
> exten => _*61,1,DBput(DND/${CALLERIDNUM}=YES})
> exten => _*61,2,Playback(vm-goodbye)
> exten => _*61,3,SoftHangup
>
> exten => _*60,1,DBdel(DND/${CALLERIDNUM})
> exten => _*61,2,Playback(vm-goodbye)
> exten => _*60,3,SoftHangup
This looks cool! Going to give it a try -- but first I'll fix the couple
of bugs that have crept in! ;-)) Also, I don't think you need the _ at
the start of the extension number, as you are not doing any pattern
matching.
> Now I just have to figure out a way to tell if it's on or not..
Standard on the PSTN down here is to use *#featnum# to check if a feature
is set or unset.
Say you call Do-Not-Disturb feature number *60. You might then use *60*1#
to turn on, *60*0# to turn off, and have *#60# play an announcement for
off or on...
exten => *60*1#,1,DBput(DND/${CALLERIDNUM}=YES)
exten => *60*1#,2,Playback(do-not-disturb-is-on)
exten => *60*1#,3,SoftHangup
exten => *60*0#,1,DBdel(DND/${CALLERIDNUM})
exten => *60*0#,2,Playback(do-not-disturb-is-off)
exten => *60*0#,3,SoftHangup
exten => *#60#,1,DBget(temp=DND/${CALLERIDNUM})
exten => *#60#,2,Playback(do-not-disturb-is-on)
exten => *#60#,3,SoftHangup
exten => *#60#,102,Playback(do-not-disturb-is-off)
exten => *#60#,103,SoftHangup
YMMV (especially since I've probably got the DBget coding wrong). Of
course you could do the same thing with the numbers you have, just add
*62# (for example) as the status check. Of course you might have to
record the announcements too... ;-)
Another thing that's used down here is modification to the dial tone.
Our normal dial tone is modulated (so it comes out 'warbling') -- when we
have a feature such as Call Forward enabled we get a single unmodulated
tone as dial tone. It's a bit like the stutter dial tone some systems use
for voicemail alerting. Doesn't tell us *which* feature is enabled, but
reminds us that we've done something to the service. Asterisk supports
two different dial tones in the indications.conf, but I don't know how to
select one or the other (other than having a voicemail message left) -- of
course, if your dial tone is generated outside Asterisk (say in your SIP
device) then you'd be SOL...
Hope this helps.
Cheers,
Vic Cross
More information about the asterisk-users
mailing list