New user Dialplan questions

Hello,

I have successfully setup and done a basic config of Asterisk 16.7.

I have these extensions configured and working currently:

exten = 1,1,Dial(PJSIP/6001,20)
exten = 2,1,Dial(PJSIP/6002,20)
exten = 3,1,Dial(PJSIP/6003,20)
exten = 4,1,Dial(PJSIP/6004,20)

There are two scenarios I would like to support:

  1. If any of these extensions dial ‘0’, all the other extensions should ring. The first extension to pick should be connected, the others should stop ringing.

I tried the following:

exten = 0,1,Dial(PJSIP/6001&PJSIP/6002&PJSIP/6003&PJSIP/6004,20)

The problem I had is that the VOIP software phone I dialled ‘0’ from (6001) received the call as well. Is there any way to change the dial plan to not include extension which is placing the call?

  1. If any of the extensions dial ‘5’, all of the other extensions should ring. The first extension to pick up should be connected into a conference with the caller. The other extensions should continue to ring for a while. If any others pickup while continuing to ring, they should be placed into the conference.

Is this even possible?!

Thanks in advance for any advice or direction.

Nick

#1
if you want to multi-dial with dynamic dial string, you can use a accountcode of channel.

#2
Yes. you can dial with ‘G, g’ option

You can play with dialplan using CALLERID(num) and REPLACE Asterisk functions to achieve your goal.

Yes that’s possible,
In your dialplan with extension 5, use Originate application (Originate asynchronously using option a) to dialout to other extensions/endpoints and place them in a conference and once done place the caller to the same conference.

Thank you very much for the pointers. After stumbling through the dial plan syntax, expressions and docs and coming across a post about the use of Local channels, I have ended up with the following which seems to achieve exactly what I was after:

[from-internal]

exten = 1,1,Dial(PJSIP/6001,20)
exten = 2,1,Dial(PJSIP/6002,20)
exten = 3,1,Dial(PJSIP/6003,20)
exten = 4,1,Dial(PJSIP/6004,20)


exten = 0,1,Set(incoming=${CALLERID(num)})
same = n,NoOp(${incoming})
same = n,ExecIf($[${incoming}=6001]?Set(outgoing=PJSIP/6002&PJSIP/6003&PJSIP/6004))
same = n,ExecIf($[${incoming}=6002]?Set(outgoing=PJSIP/6001&PJSIP/6003&PJSIP/6004))
same = n,ExecIf($[${incoming}=6003]?Set(outgoing=PJSIP/6001&PJSIP/6002&PJSIP/6004))
same = n,ExecIf($[${incoming}=6004]?Set(outgoing=PJSIP/6001&PJSIP/6002&PJSIP/6003))
same = n,NoOp(${outgoing})
same = n,Dial(${outgoing},20)


exten = 5,1,Set(incoming=${CALLERID(num)})
same = n,NoOp(${incoming})
same = n,ExecIf($[${incoming}!=6001]?Originate(Local/1@from-internal,app,ConfBridge,1234,,30,a)
same = n,ExecIf($[${incoming}!=6002]?Originate(Local/2@from-internal,app,ConfBridge,1234,,30,a)
same = n,ExecIf($[${incoming}!=6003]?Originate(Local/3@from-internal,app,ConfBridge,1234,,30,a)
same = n,ExecIf($[${incoming}!=6004]?Originate(Local/4@from-internal,app,ConfBridge,1234,,30,a)
same = n,ConfBridge(1234)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.