[asterisk-users] Prevent Dial if any extension is busy

Leif Neland leifn at neland.dk
Sun Nov 22 08:38:00 CST 2009


Magnus Benngård skrev:
> Hi!
>
> Part of extensions.conf:
>
> exten => 985,1,Dial(SIP/0317998985&H323/00702221448 at Avaya,20)
> exten => 985,2,Goto(985-${DIALSTATUS},1)
> exten => 985-BUSY,1,VoiceMail(0317998985 at inputinterior.se,b)
> exten => 985-BUSY,2,PlayBack(vm-goodbye)
> exten => 985-BUSY,3,HangUp()
> exten => 985-NOANSWER,1,VoiceMail(0317998985 at inputinterior.se,u)
> exten => 985-NOANSWER,2,PlayBack(vm-goodbye)
> exten => 985-NOANSWER,3,HangUp()
>
> 0317998985 is a direct connected SIP phone
> 0702221448 is a celluar phone.
>
> When dialing 985 both phones rings, perfect
> If none answer within 20 seconds, 
> VoiceMail(0317998985 at inputinterior.se,u), perfect
>
> But my problem comes when I speak on 0317998985 and someone calls on 
> 985, the call
> get to my celluar phone and ofc the other way around.
>
> Is there a way to check if any extension is busy and in that case jump 
> to VoiceMail(0317998985 at inputinterior.se,b)?

If both phones were directly connected sip, it could be done.
The problem is that you can't determine if the cellular is busy before 
you call it.

If the cell was only called via asterisk, you could set a flag, when 
asterisk called extension 985, and clear it, when hanging up, but I 
guess the phone is used for call out via regular cell service, and also 
called directly on its own number.


You don't own the cell-company, and can setup an API to get the status 
of the cell, right? I didn't think so :-)

You could do this:
check if sip is busy, using ChanIsAvail

If so, go to voicemail.
Else, dial cell, timeout 20 sec
if busy go to voicemail
else dial sip, timeout 20 sec
if not answered. go to voicemail.

But this will give 20 seconds delay before sip rings, and 40 seconds 
timeout for the caller before voicemail.

The other option is to modify the source, and add an option to the 
dial-command, to exit if any extension dialled is busy.
After all, this is open source :-)

Leif




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091122/18687af3/attachment.htm 


More information about the asterisk-users mailing list