Call every extension in a context but exclude myself

Hello!

I started working with Asterisk (16.2.1) recently so i’m not really experienced and still learning and i’ve hit a problem that i’m not really able to solve on my own.

I want to be able to call every extension in my context, where as soon as the first one picks up it stops ringing for everyone else(like a group call, not a conference!). I’ve managed to write a dialplan that allows me to do exactly that but something bothers me:

When i call my “group call number”, it rings for everyone, including my own number. I’m basically calling myself and thats a problem. So i need to find a way to tell asterisk “call everyone else but not me”. I’m not sure how to define an exception for my own callerID. Currently i’m working with a simple Dial()-Application.

To make it more clear here an example:
Let’s say i’ve got my context [group1] with my extensions <3001>, <3002>, 3003>, <3004> & <3005>, to start my “group call” i’m dialing “3999” with the 3001:


exten => 3999,n,Dial(SIP/3001&SIP/3002&SIP/3003&SIP/3004&SIP/3005)

Is there a specific application that allows me to do exactly that and i just simply missed it?
Again, i’m working with asterisk for the first time so sorry in advance if i don’t get a few things at first.

Thank you for your help! I apprechiate it!
Best regards

If you just started with Asterisk 16 in 2019, please consider chan_pjsip moving forward instead of chan_sip. You can find many examples in the Asterisk sample configuration directory, including information on PJSIP WIZARD, which is excellent enough to make the switch now at five (test?!) extensions totally worth the time it saves in the future IMHO. :cowboy_hat_face:

Either way, you might solve your group self-call issue with extra dialplan configuration and internal Asterisk functions including DB, CUT, FILTER, etc.

Assuming caller ID numbers match extension numbers on these phones, you might try the Dial like this instead:

exten => 3999,n,Set(allmembers=${DB(group/${EXTEN}/members)});
exten => 3999,n,Set(me=SIP/${FILTER(0-9,${CALLERID(num)})});
exten => 3999,n,Set(others=${LISTFILTER(allmembers,&,${me})});
exten => 3999,n,Dial(${others})

Then from Asterisk CLI:

  1. database put group/3999 members SIP/3001&SIP/3002&SIP/3003&SIP/3004&SIP/3005
  2. dialplan reload

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