[asterisk-users] best practices for dialing multiple contacts of multiple extensions

Brian J. Murrell brian at interlinx.bc.ca
Thu Feb 21 10:17:41 CST 2019


In the past, I have created variables that hold multiple extensions
such as:

HOUSEPHONES=PJSIP/mom&PJSIP&dad&PJSIP/grandma

so that I can do a Dial(${HOUSEPHONES},...) with it, to ring multiple
phones.

But now some of those phones will be registering multiple times and
thus have multiple contacts, so I want to use ${PJSIP_DIAL_CONTACTS()
to expand all of the contacts of an endpoint.

But of course you can't pass a string such as what's in ${HOUSEPHONES}
to ${PJSIP_DIAL_CONTACTS()}.

I wonder what others are doing about this?

I had considered:

HOUSEPHONES=PJSIP/mom&PJSIP&dad&${PJSIP_DIAL_CONTACTS(grandma)}

but I suspect that that just adds the contacts for grandma at the time
the dialplan is loaded and is not updated as her contacts actually
change.  Correct?

I could imagine a bunch of "dialplan" code to break up a & separated
string, strip off the PJSIP/ and then run each item through
${PJSIP_DIAL_CONTACTS()} and concatenate it all back together with &s.

Even in AEL (which is probably what I'd do it in) it seems like this
could be a bit hairy and possibly somebody else must have invented this
while already.

Or is there some other best known practice to handle all of this that I
am not considering?

Cheers,
b.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20190221/5c096a02/attachment.sig>


More information about the asterisk-users mailing list