<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15924">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip.c: Support endpoints with domain info in username<br><br>In multidomain environments, it is desirable to create<br>PJSIP endpoints with the domain info in the endpoint name<br>in pjsip_endpoint.conf. This resulted in an error with<br>registrations, NOTIFY, and OPTIONS packet generation.<br><br>This commit will detect if there is an @ in the endpoint<br>identifier and generate the URI accordingly so NOTIFY and<br>OPTIONS From headers will generate correctly.<br><br>ASTERISK-28393<br><br>Change-Id: I96f8d01dfdd5573ba7a28299e46271dd4210b619<br>---<br>A doc/CHANGES-staging/res_pjsip.txt<br>M res/res_pjsip.c<br>2 files changed, 16 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/CHANGES-staging/res_pjsip.txt b/doc/CHANGES-staging/res_pjsip.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..ffbf13a</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/res_pjsip.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: res_pjsip</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+PJSIP support of registrations of endpoints in multidomain</span><br><span style="color: hsl(120, 100%, 40%);">+scenarios, where the endpoint contains the domain info</span><br><span style="color: hsl(120, 100%, 40%);">+in pjsip_endpoint.conf</span><br><span>diff --git a/res/res_pjsip.c b/res/res_pjsip.c</span><br><span>index 3e9e454..809096d 100644</span><br><span>--- a/res/res_pjsip.c</span><br><span>+++ b/res/res_pjsip.c</span><br><span>@@ -3841,6 +3841,17 @@</span><br><span> type |= PJSIP_TRANSPORT_IPV6;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* In multidomain scenario, username may contain @ with domain info */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_sip_get_disable_multi_domain() && strchr(user, '@')) {</span><br><span style="color: hsl(120, 100%, 40%);">+ from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);</span><br><span style="color: hsl(120, 100%, 40%);">+ from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,</span><br><span style="color: hsl(120, 100%, 40%);">+ "<sip:%s%s%s>",</span><br><span style="color: hsl(120, 100%, 40%);">+ user,</span><br><span style="color: hsl(120, 100%, 40%);">+ (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? ";transport=" : "",</span><br><span style="color: hsl(120, 100%, 40%);">+ (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? pjsip_transport_get_type_name(type) : "");</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> if (!ast_strlen_zero(domain)) {</span><br><span> from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);</span><br><span> from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15924">change 15924</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15924"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I96f8d01dfdd5573ba7a28299e46271dd4210b619 </div>
<div style="display:none"> Gerrit-Change-Number: 15924 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joe <ynadiv@corpit.xyz> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>