<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8453">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, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Fix improper RTP framing on outgoing calls<br><br>The "ptime" SDP parameter received in a SIP response was not honoured.<br>Moreover, in the abscence of this "ptime" parameter, locally configured<br>framing was lost during response processing.<br><br>This patch systematically stores the framing information in the<br>ast_rtp_codecs structure, taking it from the response or from the<br>configuration as appropriate.<br><br>ASTERISK-27674<br><br>Change-Id: I828a6a98d27a45a8afd07236a2bd0aa3cbd3fb2c<br>---<br>M channels/chan_sip.c<br>1 file changed, 9 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index 8570163..f0cc2a6 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -10964,22 +10964,25 @@<br>   if (portno != -1 || vportno != -1 || tportno != -1) {<br>                 /* We are now ready to change the sip session and RTP structures with the offered codecs, since<br>                  they are acceptable */<br>+            unsigned int framing;<br>                 ast_format_cap_remove_by_type(p->jointcaps, AST_MEDIA_TYPE_UNKNOWN);<br>               ast_format_cap_append_from_cap(p->jointcaps, newjointcapability, AST_MEDIA_TYPE_UNKNOWN); /* Our joint codec profile for this call */<br>              ast_format_cap_remove_by_type(p->peercaps, AST_MEDIA_TYPE_UNKNOWN);<br>                ast_format_cap_append_from_cap(p->peercaps, newpeercapability, AST_MEDIA_TYPE_UNKNOWN); /* The other side's capability in latest offer */<br>              p->jointnoncodeccapability = newnoncodeccapability;     /* DTMF capabilities */<br> <br>+                tmp_fmt = ast_format_cap_get_format(p->jointcaps, 0);<br>+             framing = ast_format_cap_get_format_framing(p->jointcaps, tmp_fmt);<br>                /* respond with single most preferred joint codec, limiting the other side's choice */<br>            if (ast_test_flag(&p->flags[1], SIP_PAGE2_PREFERRED_CODEC)) {<br>-                 unsigned int framing;<br>-<br>-                     tmp_fmt = ast_format_cap_get_format(p->jointcaps, 0);<br>-                     framing = ast_format_cap_get_format_framing(p->jointcaps, tmp_fmt);<br>                        ast_format_cap_remove_by_type(p->jointcaps, AST_MEDIA_TYPE_UNKNOWN);<br>                       ast_format_cap_append(p->jointcaps, tmp_fmt, framing);<br>-                    ao2_ref(tmp_fmt, -1);<br>                 }<br>+            if (!ast_rtp_codecs_get_framing(&newaudiortp)) {<br>+                 /* Peer did not force us to use a specific framing, so use our own */<br>+                        ast_rtp_codecs_set_framing(&newaudiortp, framing);<br>+               }<br>+            ao2_ref(tmp_fmt, -1);<br>         }<br> <br>  /* Setup audio address and port */<br>@@ -11488,6 +11491,7 @@<br>           if (framing && p->autoframing) {<br>                   ast_debug(1, "Setting framing to %ld\n", framing);<br>                  ast_format_cap_set_framing(p->caps, framing);<br>+                     ast_rtp_codecs_set_framing(newaudiortp, framing);<br>             }<br>             found = TRUE;<br>         } else if (sscanf(a, "rtpmap: %30u %127[^/]/%30u", &codec, mimeSubtype, &sample_rate) == 3) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8453">change 8453</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/8453"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I828a6a98d27a45a8afd07236a2bd0aa3cbd3fb2c </div>
<div style="display:none"> Gerrit-Change-Number: 8453 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jean Aunis - Prescom <jean.aunis@prescom.fr> </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: Richard Mudgett <rmudgett@digium.com> </div>