[asterisk-users] multiple softphone clients and same/different account credentials
C.Maj
chris at PenguinPBX.com
Tue Nov 26 14:14:40 CST 2019
On 2019-11-26 09:17, Greg Troxel wrote:
> For the second issue, it would be nice if Dial just discarded empty
> destinations, as in
>
> Dial(PJSIP/foo&)
> Dial(PJSIP/foo&&PJSIP/baz)
>
> as would result from the following if there were no bar registrations
>
> Dial(PJSIP/foo&${PJSIP_DIAL_CONTACTS/bar})
> Dial(PJSIP/foo&${PJSIP_DIAL_CONTACTS/bar}&PJSIP/baz)
>
> which seems to be how almost everyone (perhaps actually everyone) wants
> to use PJSIP_DIAL_CONTACTS.
Howdy!
I agree that would be nice for Dial to ignore dangling/extra ampersands.
Another option for a patch would be to extend the PJSIP_DIAL_CONTACTS
function with an argument such as 'please' to minimally return the
endpoint name in a Dialable format when no reachable contacts are found
eg. "PJSIP/bar" -- instead of the current empty string, which is not
Dialable.
Also the empty string is somewhat in conflict with the Synopsis "Return
a dial string for dialing all contacts on an AOR." (Maybe add " Or
returns empty string if no reachable contacts. Do not Dial directly." ?)
Regardless of patch status, I'd recommend looking at the PUSH function
to build up the dial list one line item at a time -- please pardon the
AEL format on my example:
Set(rgrp=);
Set(PUSH(rgrp,&)=PJSIP/foo);
Set(PUSH(rgrp,&)=PJSIP/baz);
if( "${PJSIP_DIAL_CONTACTS(bar)}" != "" ) {
Set(PUSH(rgrp,&)=${PJSIP_DIAL_CONTACTS(bar)});
}
Dial(${rgrp});
...that is likely easier to maintain in the long run because any
changes, such as from 'foo' to 'goo', will be more quickly visible with
a diff tool and in version control logs vs. untangling changes in one
really long Dial line.
Kind Regards,
--
🤠 C. Maj, Technology Captain @ Penguin PBX Solutions
📞 USA Toll Free 1-833-PNGNPBX (1-833-764-6729)
🤙 International & SMS Texting +1.720.32.42.72.9
🐧 Visit on the World Wide Web at PENGUINPBX.COM
More information about the asterisk-users
mailing list