<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/5931">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  George Joseph: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_pjsip:  Fix ability to send UPDATE on COLP<br><br>When connected_line_method is "invite", we're supposed to determine<br>if the client can support UPDATE and if it can, send UPDATE instead<br>of INVITE to avoid the SDP renegotiation.  Not only was pjproject<br>not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing<br>that invite_tsx wasn't NULL which isn't always the case.<br><br>* Updated chan_pjsip/update_connected_line_information to drop the<br>  requirement that invite_tsx isn't NULL.<br>* Submitted patch to pjproject sip_inv.c that sets the<br>  PJSIP_INV_SUPPORT_UPDATE flag correctly.<br>* Updated pjsip.conf.sample to clarify what happens when "invite"<br>  is specified.<br><br>ASTERISK-27095<br><br>Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560<br>---<br>M channels/chan_pjsip.c<br>M configs/samples/pjsip.conf.sample<br>M res/res_pjsip.c<br>A third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>4 files changed, 48 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c<br>index f565ea8..abf3507 100644<br>--- a/channels/chan_pjsip.c<br>+++ b/channels/chan_pjsip.c<br>@@ -1272,8 +1272,7 @@<br>                   int generate_new_sdp;<br> <br>                      method = session->endpoint->id.refresh_method;<br>-                 if (session->inv_session->invite_tsx<br>-                           && (session->inv_session->options & PJSIP_INV_SUPPORT_UPDATE)) {<br>+                   if (session->inv_session->options & PJSIP_INV_SUPPORT_UPDATE) {<br>                             method = AST_SIP_SESSION_REFRESH_METHOD_UPDATE;<br>                       }<br> <br>diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample<br>index f1bb87d..6510fcf 100644<br>--- a/configs/samples/pjsip.conf.sample<br>+++ b/configs/samples/pjsip.conf.sample<br>@@ -608,8 +608,15 @@<br> ;direct_media_glare_mitigation=none     ; Mitigation of direct media re INVITE<br>                                         ; glare (default: "none")<br> ;direct_media_method=invite     ; Direct Media method type (default: "invite")<br>-;connected_line_method=invite   ; Connected line method type (default:<br>-                                ; "invite")<br>+;connected_line_method=invite   ; Connected line method type.<br>+                                ; When set to "invite", check the remote's<br>+                                ; Allow header and if UPDATE is allowed, send<br>+                                ; UPDATE instead of INVITE to avoid SDP<br>+                                ; renegotiation.  If UPDATE is not Allowed,<br>+                                ; send INVITE.<br>+                                ; If set to "update", send UPDATE regardless<br>+                                ; of what the remote Allows.<br>+                                ; (default: "invite")<br> ;direct_media=yes       ; Determines whether media may flow directly between<br>                         ; endpoints (default: "yes")<br> ;disable_direct_media_on_nat=no ; Disable direct media session refreshes when<br>diff --git a/res/res_pjsip.c b/res/res_pjsip.c<br>index d2e4a67..5e4ac86 100644<br>--- a/res/res_pjsip.c<br>+++ b/res/res_pjsip.c<br>@@ -193,11 +193,18 @@<br>                                  <description><br>                                           <para>Method used when updating connected line information.</para><br>                                                <enumlist><br>-                                                     <enum name="invite" /><br>+                                                       <enum name="invite"><br>+                                                 <para>When set to <literal>invite</literal>, check the remote's Allow header and<br>+                                                       if UPDATE is allowed, send UPDATE instead of INVITE to avoid SDP<br>+                                                     renegotiation.  If UPDATE is not Allowed, send INVITE.</para><br>+                                                  </enum><br>                                                         <enum name="reinvite"><br>                                                                <para>Alias for the <literal>invite</literal> value.</para><br>                                                   </enum><br>-                                                        <enum name="update" /><br>+                                                       <enum name="update"><br>+                                                 <para>If set to <literal>update</literal>, send UPDATE regardless of what the remote<br>+                                                       Allows. </para><br>+                                                        </enum><br>                                                 </enumlist><br>                                     </description><br>                          </configOption><br>diff --git a/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch b/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>new file mode 100644<br>index 0000000..9238e3e<br>--- /dev/null<br>+++ b/third-party/pjproject/patches/0070-Set-PJSIP_INV_SUPPORT_UPDATE-correctly-in-pjsip_inv_.patch<br>@@ -0,0 +1,29 @@<br>+From 1193681959816effa121c4470748d5faa3a59272 Mon Sep 17 00:00:00 2001<br>+From: George Joseph <gjoseph@digium.com><br>+Date: Thu, 29 Jun 2017 13:42:10 -0600<br>+Subject: [PATCH] Set PJSIP_INV_SUPPORT_UPDATE correctly in<br>+ pjsip_inv_verify_request3<br>+<br>+pjsip_inv_verify_request3 was setting rem_options when UPDATE was<br>+detected in the Allow header.  That's just an internal variable and<br>+doesn't go anywhere.  It's '*options' that needs to be set.<br>+---<br>+ pjsip/src/pjsip-ua/sip_inv.c | 2 +-<br>+ 1 file changed, 1 insertion(+), 1 deletion(-)<br>+<br>+diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c<br>+index fbc8ebe..6db7e6b 100644<br>+--- a/pjsip/src/pjsip-ua/sip_inv.c<br>++++ b/pjsip/src/pjsip-ua/sip_inv.c<br>+@@ -1237,7 +1237,7 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request3(pjsip_rx_data *rdata,<br>+ <br>+       if (i != allow->count) {<br>+      /* UPDATE is present in Allow */<br>+-            rem_option |= PJSIP_INV_SUPPORT_UPDATE;<br>++     *options |= PJSIP_INV_SUPPORT_UPDATE;<br>+    }<br>+ <br>+     }<br>+-- <br>+2.9.4<br>+<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5931">change 5931</a>. To unsubscribe, 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/5931"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560 </div>
<div style="display:none"> Gerrit-Change-Number: 5931 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>