[Home]

Summary:ASTERISK-26670: [patch] Outgoing SIP-URI Dialing via PJSIP
Reporter:Alexander Traud (traud)Labels:
Date Opened:2016-12-22 09:20:42.000-0600Date Closed:2021-01-11 08:40:08.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip_session
Versions:13.13.1 14.2.1 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) pjsip_dialplan_sipdomain.patch
Description:Asterisk can be used as [B2BUA|//en.wikipedia.org/wiki/Back-to-back_user_agent]. In that scenario, Asterisk is able to cope/fix/overcome software bugs in VoIP/SIP phones. Therefore, some VoIP/SIP providers use their Asterisk not only as Registrar but as Outbound Proxy – for all outgoing calls. Furthermore, some VoIP/SIP apps use the Registrar as Outbound Proxy automatically, because they cannot dial other SIP proxies themselves. In these scenarios, Asterisk must be able to detect whether an extension can be resolved internally or whether a remote domain must be contacted (Outgoing SIP-URI Dialing).

For example, the user dials <bob@example.com> on his phone. Then, Asterisk should not dial <sip:bob> but the whole URI including the domain: <sip:bob@example.com>. For this, Asterisk must know that the domain is not the local domain (otherwise, a local "bob" is called) and Asterisk must know the remote domain to start contacting its SIP proxy.

In the channel driver chan_sip, this was solved via the dialplan parameter SIPDOMAIN. Currently with Asterisk 13.13, I am not aware of a similar approach for the new SIP channel driver res_pjsip, which is based on PJSIP. The same rules and extensions for chan_sip should work for res_pjsip as well. Therefore, this issue report is about implementing SIPDOMAIN in res_pjsip.

The attached patch makes sure, SIPDOMAIN is set even when res_pjsip is used. PJSIP_HEADER(read, To) did not work for me, because I do not need the URI in the header To but the Request-URI actually.
Comments:By: Rusty Newton (rnewton) 2016-12-22 15:55:26.885-0600

Thanks Alexander!

By: Friendly Automation (friendly-automation) 2017-01-05 07:44:38.590-0600

Change 4653 merged by zuul:
res_pjsip_session: Access SIPDOMAIN via Dialplan.

[https://gerrit.asterisk.org/4653|https://gerrit.asterisk.org/4653]

By: Friendly Automation (friendly-automation) 2017-01-05 08:26:08.139-0600

Change 4651 merged by Joshua Colp:
res_pjsip_session: Access SIPDOMAIN via Dialplan.

[https://gerrit.asterisk.org/4651|https://gerrit.asterisk.org/4651]

By: Friendly Automation (friendly-automation) 2017-01-05 10:01:53.548-0600

Change 4652 merged by zuul:
res_pjsip_session: Access SIPDOMAIN via Dialplan.

[https://gerrit.asterisk.org/4652|https://gerrit.asterisk.org/4652]

By: Grigoriy Puzankin (boroda) 2017-03-23 08:37:33.734-0500

Sorry for bothering, but this patch sets global variable SIPDOMAIN, which is useless.

[Mar 23 16:34:01]   == Setting global variable 'SIPDOMAIN' to '192.168.79.160'
[Mar 23 16:34:01]     -- Executing [101@catch-office:1] Gosub("PJSIP/ext_100-00000002", "sub-rec,s,1(100,101,1490276041.2)") in new stack

I'm using Asterisk 13.14.0.

By: Joshua C. Colp (jcolp) 2017-03-23 08:46:39.009-0500

[~boroda] Please file a new issue for that.

By: Alexander Traud (traud) 2017-04-09 07:53:10.306-0500

[~boroda], what exactly do you mean with useless – which behavior did you expect? Furthermore, in your case, the SIP domain is an local IP address and therefore not an SIP-URI. Therefore, does this variable kill anything in your scenario?

By: Alexander Traud (traud) 2021-01-11 08:39:26.175-0600

[~boroda], does ASTERISK-29240 address/fix your issue?

By: Asterisk Team (asteriskteam) 2021-01-11 08:39:26.693-0600

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.