[asterisk-users] Multiple phones when one is unregistered

Administrator TOOTAI admin at tootai.net
Tue Aug 30 10:56:35 CDT 2016


Le 30/08/2016 à 15:56, D'Arcy J.M. Cain a écrit :
> I have an extension that looks like this:
>
> exten => 5555551111,1,Verbose(Door buzzer calling)
>   same => n,Dial(SIP/user1&SIP/user2&SIP/user3)
>
> The idea is that any of the three users can answer the phone to let
> someone in.  The problem is that if, say, user2 unplugs his phone then
> the call immediately goes to his voice mail and the other two do not
> have the ability to open the door.
>
> Is there any way to direct only to phones in a list that are currently
> registered?  I am sure that I can write a rather convoluted extension
> to check for registrations and create a dial command but I am hoping
> that there is an easier way so that I can create these types of
> extensions for other clients easily as well as being able to add and
> remove destinations quickly.

Something like

exten => 5555551111,1,Verbose(Door buzzer calling)
same => n,Set(toRing=)
same => n,ExecIf($["${DEVICE_STATE(SIP/user1)}" = "NOT IN 
USE"]?Set(toRing=${toRing}&SIP/user1)
same => n,ExecIf($["${DEVICE_STATE(SIP/user2)}" = "NOT IN 
USE"]?Set(toRing=${toRing}&SIP/user2)
same => n,ExecIf($["${DEVICE_STATE(SIP/user3)}" = "NOT IN 
USE"]?Set(toRing=${toRing}&SIP/user3)
same => n,Dial(${toRing:1}) ;to remove the first &

would do the work
-- 
Daniel



More information about the asterisk-users mailing list