<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/3514/">https://reviewboard.asterisk.org/r/3514/</a>
     </td>
    </tr>
   </table>
   <br />




<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 rmudgett.</div>








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


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-23501">ASTERISK-23501</a>


</div>



<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;">Per rfc3892, the Referred-By header in a REFER must be copied into the referenced request (IE. The outgoing INVITE to the transfer target).

* Automatically put the Referred-By header in the outgoing INVITE message if the SIPREFERREDBYHDR channel variable is defined with a value.

* Made chan_sip.c:get_refer_info() set SIPREFERREDBYHDR for inheritance so chan_pjsip has a better chance to interoperate.

* Fixed refer_blind_callback() and refer_incoming_refer_request() to not modify the data in the pointer returned by pjsip_msg_find_hdr_by_name().  It seems wrong to modify that data since the calling routine doesn't own the buffer.</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;">The testsuite/tests/channels/pjsip/transfers/blind_transfer/caller_refer_only test now passes with this patch and the minor modification to allow SIPREFERREDBYHDR to have the optional inheritance '_' prefixes added.

Index: tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/test-config.yaml
===================================================================
--- tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/test-config.yaml    (revision 5006)
+++ tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/test-config.yaml    (working copy)
@@ -104,7 +104,7 @@
                 match:
                     Event: 'VarSet'
                     Channel: 'PJSIP/bob-.{8}'
-                    Variable: 'SIPREFERREDBYHDR'
+                    Variable: '_{0,2}SIPREFERREDBYHDR'
                     Value: 'alice <sip:alice@127.0.0.1>'
             count: 2
         -
@@ -112,7 +112,7 @@
             conditions:
                 match:
                     Event: 'VarSet'
-                    Variable: 'SIPREFERTOHDR'
+                    Variable: '_{0,2}SIPREFERTOHDR'
                     Value: 'sip:charlie@127.0.0.1'
             count: 2
         -
</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/12/res/res_pjsip_refer.c <span style="color: grey">(413157)</span></li>

 <li>/branches/12/channels/chan_sip.c <span style="color: grey">(413157)</span></li>

</ul>

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







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




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