<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/1993/">https://reviewboard.asterisk.org/r/1993/</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/1993/diff/3/?file=30312#file30312line25075" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/channels/chan_sip.c</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

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

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

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, int debug, uint32_t seqno, int *nounlock)</pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int handle_request_refer(struct sip_pvt *p, struct sip_request *req, struct ast_sockaddr *addr, uint32_t seqno, const char *e, int *nounlock)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">25030</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="k">static</span> <span class="kt">int</span> <span class="nf">handle_request_refer</span><span class="p">(</span><span class="k">struct</span> <span class="n">sip_pvt</span> <span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="k">struct</span> <span class="n">sip_request</span> <span class="o">*</span><span class="n">req</span><span class="p">,</span> <span class="kt"><span class="hl">int</span></span><span class="hl"> </span><span class="n"><span class="hl">debug</span></span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">seqno</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">nounlock</span><span class="p">)</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">24980</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="k">static</span> <span class="kt">int</span> <span class="nf">handle_request_refer</span><span class="p">(</span><span class="k">struct</span> <span class="n">sip_pvt</span> <span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="k">struct</span> <span class="n">sip_request</span> <span class="o">*</span><span class="n">req</span><span class="p">,</span> <span class="k"><span class="hl">struct</span></span><span class="hl"> </span><span class="n"><span class="hl">ast_sockaddr</span></span><span class="hl"> </span><span class="o"><span class="hl">*</span></span><span class="n"><span class="hl">addr</span></span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">seqno</span><span class="p">,</span> <span class="k"><span class="hl">const</span></span><span class="hl"> </span><span class="kt"><span class="hl">char</span></span><span class="hl"> </span><span class="o"><span class="hl">*</span></span><span class="n"><span class="hl">e</span></span><span class="p"><span class="hl">,</span></span><span class="hl"> </span><span class="kt">int</span> <span class="o">*</span><span class="n">nounlock</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;">Why are addr and e added here when they aren&#39;t used?  Should this be part of another change instead?</pre>
</div>
<br />



<p>- opticron</p>


<br />
<p>On July 16th, 2012, 11:19 p.m., gareth wrote:</p>






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

<div>Review request for Asterisk Developers.</div>
<div>By gareth.</div>


<p style="color: grey;"><i>Updated July 16, 2012, 11:19 p.m.</i></p>




<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;">This is the first part split out from the much larger patch at https://reviewboard.asterisk.org/r/1976/ - it contains just the various chan_sip code cleanups.

- struct sip_refer converted to use the stringfields API.

- sip_{refer|notify}_allocate -&gt; sip_{notify|refer}_alloc to match other *alloc functions.

- Replace get_msg_text, get_msg_text2 and get_pidf_body -&gt; No, not get_pidf_msg_text_body3 but get_content, to match add_content.

- get_body doesn&#39;t get the request body, renamed to get_content_line.

- get_body_by_line doesn&#39;t get the body line, and is just a simple if test. Moved code inline and removed function.

- Remove camelCase in struct sip_peer peer state variables, onHold -&gt; onhold, inUse -&gt; inuse, inRinging -&gt; ringing.

- Remove camelCase in struct sip_request rlPart1 -&gt; rlpart1, rlPart2 -&gt; rlpart2.

- Rename instances of pvt-&gt;randdata to pvt-&gt;nonce because that is what it is, no need to update struct sip_pvt because _it already has a nonce field_.

- Removed struct sip_pvt randdata stringfield.

- Remove useless (and inconsistent) &#39;header&#39; suffix on variables in handle_request_subscribe.

- Use ast_strdupa on Event header in handle_request_subscribe to avoid overly complicated strncmp calls to find the event package.

- Move get_destination check in handle_request_subscribe to avoid duplicate checking for packages that don&#39;t need it.

- Move extension state callback management in handle_request_subscribe to avoid duplicate checking for packages that don&#39;t need it.

- Remove duplicate append_date prototype.

- Rename append_date -&gt; add_date to match other add_xxx functions.

- Added add_expires helper function, removed code that manually added expires header.

- Remove _header suffix on add_diversion_header (no other header adding functions have this).

- Don&#39;t pass req-&gt;debug to request handle_request_XXXXX handlers if req is also being passed.

- Don&#39;t pass req-&gt;ignore to check_auth as req is already being passed.

- Don&#39;t create a subscription in handle_request_subscribe if p-&gt;expiry == 0.

- Don&#39;t walk of the back of referred_by_name when splitting string in get_refer_info

- Remove duplicate check for no dialog in handle_incoming when sipmethod == SIP_REFER, handle_request_refer checks for that.
</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;">It compiles.</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>/trunk/channels/chan_sip.c <span style="color: grey">(370151)</span></li>

 <li>/trunk/channels/sip/include/sip.h <span style="color: grey">(370151)</span></li>

 <li>/trunk/channels/sip/security_events.c <span style="color: grey">(370151)</span></li>

</ul>

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




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








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