[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    [asterisk-dev] [Code Review] 3514: res_pjsip_refer: Add Referred-By header on INVITE for blind trans
From:       "rmudgett" <reviewboard () asterisk ! org>
Date:       2014-04-30 23:04:12
Message-ID: 20140430230412.28870.79925 () sonic ! digium ! api
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3514/
-----------------------------------------------------------

Review request for Asterisk Developers.


Bugs: ASTERISK-23501
    https://issues.asterisk.org/jira/browse/ASTERISK-23501


Repository: Asterisk


Description
-------

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.


Diffs
-----

  /branches/12/res/res_pjsip_refer.c 413157 
  /branches/12/channels/chan_sip.c 413157 

Diff: https://reviewboard.asterisk.org/r/3514/diff/


Testing
-------

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
         -


Thanks,

rmudgett


[Attachment #5 (text/html)]

<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&#39;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 &#39;_&#39; 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: &#39;VarSet&#39;
                     Channel: &#39;PJSIP/bob-.{8}&#39;
-                    Variable: &#39;SIPREFERREDBYHDR&#39;
+                    Variable: &#39;_{0,2}SIPREFERREDBYHDR&#39;
                     Value: &#39;alice &lt;sip:alice@127.0.0.1&gt;&#39;
             count: 2
         -
@@ -112,7 +112,7 @@
             conditions:
                 match:
                     Event: &#39;VarSet&#39;
-                    Variable: &#39;SIPREFERTOHDR&#39;
+                    Variable: &#39;_{0,2}SIPREFERTOHDR&#39;
                     Value: &#39;sip:charlie@127.0.0.1&#39;
             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>



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic