[Asterisk-Users] How to differentiate a *busy* call from not available?
Soren Rathje
asterisk at lolle.org
Fri Jul 9 12:45:20 MST 2004
Jean-Yves Avenard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello
>
> I'm trying to find a way to differentiate wether a SIP extension is
> currently busy (e.g. on the phone) or not registered.
>
> So i do something like:
> exten => 100,1,Dial(SIP/foo,20,tr)
> exten => 100,2,VoiceMail,u100
> exten => 100,102,VoiceMail,b100
>
> If the phone doesn't answer I get the message: User is not available
> if the phone is currently in used i get the message: User is on the
> phone
>
> But if the phone is unplugged, I also get the message: User is on the
> phone!
>
Based on extensions.conf.sample from CVS-HEAD...
[macro-stdexten]
;
; ${ARG1} - Extension
; ${ARG2} - Device(s) to ring
;
; ${DIALSTATUS} = CHANUNAVAIL CONGESTION NOANSWER BUSY ANSWER CANCEL
exten => s,1,Dial(${ARG2},20,tmg)
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-CHANUNAVAIL,1,Playback(tt-monkeysintro)
exten => s-CHANUNAVAIL,2,Voicemail(u${ARG1})
exten => s-CHANUNAVAIL,3,Goto(default,s,1)
exten => s-CONGESTION,1,Playback(tt-somethingwrong)
exten => s-CONGESTION,2,Voicemail(u${ARG1})
exten => s-CONGESTION,3,Goto(default,s,1)
exten => s-NOANSWER,1,Voicemail(u${ARG1})
exten => s-NOANSWER,2,Goto(default,s,1)
exten => s-BUSY,1,Voicemail(b${ARG1})
exten => s-BUSY,2,Goto(default,s,1)
exten => s-ANSWER,1,Playback(demo-thanks)
exten => s-ANSWER,2,Hangup()
exten => s-CANCEL,1,Playback(demo-thanks)
exten => s-CANCEL,2,Hangup()
exten => s-.,1,Goto(s-NOANSWER,1)
exten => a,1,VoicemailMain(${ARG1})
exten => a,2,Hangup()
-- Soren
More information about the asterisk-users
mailing list