[asterisk-users] Forwarding call if extension busy

Kevin Larsen kevin.larsen at pioneerballoon.com
Mon Jan 4 09:22:55 CST 2016


asterisk-users-bounces at lists.digium.com wrote on 01/04/2016 08:55:40 AM:

> My question:
> 
> - two extensions: 1111 and 2222
> - an active call on 1111
> - incoming calls to 1111 should be forwarded to 1111 (call advice!) and 
2222
> 
> I know how can I forward an incoming call to more than an extension, 
> but I have no idea how can I get the information, that 1111 has 
> already an active call...
> 

I am not sure if I completely understand what you are trying to do, but it 
sounds like you want to query the DEVICE_STATE function.

For instance, my customer service department has this thing against ever 
having their phone ring a call while they are already on a call, so for 
these special little snowflakes, I have  the following line:

same => n(voice),GotoIf($["${DEVICE_STATE(sip/${EXTEN})}" != 
"NOT_INUSE"]?voicebusy)

Basically, this little line looks at the extension and if it shows 
anything other than free (NOT_INUSE), it jumps to the voicebusy line in 
the dialplan. The voicebusy line just hits voicemail directly.

You can use this same idea to branch your logic and handle a variety of 
situations. In my case, I only want to actually perform the dial if the 
phone is currently not in use, so my logic was fairly simple.

See here for reference:
https://wiki.asterisk.org/wiki/display/AST/Device+State

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20160104/fa65bb4d/attachment.html>


More information about the asterisk-users mailing list