<p>Joe has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15896">View Change</a></p><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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/96/15896/1</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 2ea07fd..75635b0 100644</span><br><span>--- a/res/res_pjsip.c</span><br><span>+++ b/res/res_pjsip.c</span><br><span>@@ -3427,6 +3427,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 (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/+/15896">change 15896</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/+/15896"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I96f8d01dfdd5573ba7a28299e46271dd4210b619 </div>
<div style="display:none"> Gerrit-Change-Number: 15896 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joe <ynadiv@corpit.xyz> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>