[asterisk-users] can't define PJSIP endpoint from DB with proxy loose routing
Joshua C. Colp
jcolp at sangoma.com
Tue Dec 7 07:28:23 CST 2021
On Tue, Dec 7, 2021 at 9:26 AM Kingsley Tart <kingsley at dns99.co.uk> wrote:
> Hi,
>
> I'm using Asterisk 18.8.0 with pjsip version 2.10.
>
> With a database defined endpoint, I can't find a way to define
> outbound_proxy with ";lr" (without the quotes) on the end.
>
> It works fine if I configure an endpoint in pjsip.conf, eg:
>
> -- 8< -----------------------------------------------------
> [custom]
> type=endpoint
> outbound_proxy=sip:88.141.1.10\;lr
> ...
>
> # asterisk -r -x "pjsip show endpoint custom" | grep proxy
> outbound_proxy : sip:88.141.1.10;lr
> -- 8< -----------------------------------------------------
>
>
>
>
> but if I try to do that in the database, it ignores everything up to
> the semicolon, eg:
>
> -- 8< -----------------------------------------------------
> MariaDB [asterisk_realtime]> SELECT id,outbound_proxy FROM ps_endpoints
> WHERE id=30;
> +----+--------------------+
> | id | outbound_proxy |
> +----+--------------------+
> | 30 | sip:88.141.1.10;lr |
> +----+--------------------+
>
> # asterisk -r -x "pjsip show endpoint 30" | grep proxy
> outbound_proxy : lr
> -- 8< -----------------------------------------------------
>
>
>
> I tried a backshash, just in case:
>
> -- 8< -----------------------------------------------------
> +----+---------------------+
> | id | outbound_proxy |
> +----+---------------------+
> | 30 | sip:88.141.1.10\;lr |
> +----+---------------------+
>
> but this makes no difference.
> -- 8< -----------------------------------------------------
>
>
>
> I tried putting quotes round it:
>
> -- 8< -----------------------------------------------------
> +----+----------------------+
> | id | outbound_proxy |
> +----+----------------------+
> | 30 | "sip:88.141.1.10;lr" |
> +----+----------------------+
>
> but that makes no difference to the logic:
>
> # asterisk -r -x "pjsip show endpoint 30" | grep proxy
> outbound_proxy : lr"
> -- 8< -----------------------------------------------------
>
>
>
> I tried enclosing within < > but with the same problem.
>
> Is this a bug, or am I doing this wrong?
>
It's not a bug, it's a result of ";" having special meaning from the
database - it means multiple values. You have to encode it and use ^3B
instead of ; in the entry.
--
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20211207/a7a3552e/attachment.html>
More information about the asterisk-users
mailing list