<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/4378/">https://reviewboard.asterisk.org/r/4378/</a>
     </td>
    </tr>
   </table>
   <br />











<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/4378/diff/2/?file=71100#file71100line1182" style="color: black; font-weight: bold; text-decoration: underline;">/branches/13/res/res_pjsip_sdp_rtp.c</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int apply_negotiated_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media,</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1182</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="tb">  </span><span class="k">if</span> <span class="p">((</span><span class="n">pjmedia_sdp_neg_was_answer_remote</span><span class="p">(</span><span class="n">session</span><span class="o">-></span><span class="n">inv_session</span><span class="o">-></span><span class="n">neg</span><span class="p">)</span> <span class="o">==</span> <span class="n">PJ_FALSE</span><span class="p">)</span> <span class="o">&&</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">1183</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="tb">  </span><span class="tb">  </span><span class="p">(</span><span class="n">session</span><span class="o">-></span><span class="n">inv_session</span><span class="o">-></span><span class="n">state</span> <span class="o">==</span> <span class="n">PJSIP_INV_STATE_CONFIRMED</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'll nitpick here and say I like it when the boolean operator is on the next line:

if (long_foo_statement
    && long_bar_statement) {
    ...
}

It makes it a bit easier to see the relationship between the two clauses.
</pre>
</div>
<br />



<p>- Matt Jordan</p>


<br />
<p>On January 27th, 2015, 10:27 a.m. CST, Joshua Colp wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By Joshua Colp.</div>


<p style="color: grey;"><i>Updated Jan. 27, 2015, 10:27 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Currently there exists two issues which prevent direct media from being reinvited depending on the scenario:

1. During a swap operation for a brief period of time there will exist 3 channels in a bridge. This is NOT handled by the bridge_native_rtp module and causes it to not reinvite one of the channels that it should when it may be leaving. As it's a reasonable expectation for a bridge technology which can only handle 2 channels to only ever see 2 I've moved the operation which causes the swap channel to leave to before the new channel is actually added to the bridge. This means bridge_native_rtp only sees the two channels it saw previously and reinvites occur as expected.

2. If the res_pjsip_sdp_rtp module received a re-invite *AFTER* the session had been established it did not notify upstream that things such as the bridge_native_rtp module should re-evaluate and potentially reinvite the remote side. The res_pjsip_sdp_rtp module will now do this using the UPDATE_RTP_PEER control frame if an offer is received after the session is established.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tried various scenarios including attended transfers and multiple Asterisk instances in the path. Previously media would go via the wrong route or not at all. With patch reinvites occur as expected.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/13/res/res_pjsip_sdp_rtp.c <span style="color: grey">(431113)</span></li>

 <li>/branches/13/main/bridge_channel.c <span style="color: grey">(431113)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/4378/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>