<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/2429/">https://reviewboard.asterisk.org/r/2429/</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.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers and Joshua Colp.</div>
<div>By Mark Michelson.</div>
<p style="color: grey;"><i>Updated April 8, 2013, 4:30 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</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;">Address review feedback.</pre>
</td>
</tr>
</table>
<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-21257">ASTERISK-21257</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;">This introduces Caller ID support into the new SIP work.
A new module, res_sip_caller_id.c has been added. It contains a session supplement that allows for caller ID and connected line information to be learned from incoming requests and responses and to be added to outbound requests and responses.
This module supports learning caller ID from the following sources:
1. P-Asserted-Identity header on an incoming INVITE
2. Remote-Party-ID header on an incoming INVITE
3. From header on an incoming INVITE
4. Configured caller ID on an endpoint.
This module is capable of learning of connected line updates in the following ways:
1. On an initial outbound INVITE, we can queue a connected line update based on the configured caller ID of the target
2. On an inbound INVITE or INVITE response, we can queue a connected line update based on Remote-Party-ID or P-Asserted-Identity headers.
Privacy is implemented here a bit differently than it is in chan_sip. Here, there are two options, trust_id_inbound, and trust_id_outbound. trust_id_inbound is similar to the trust_rpid option from chan_sip. It determines whether we use ID information from external sources when communicating caller ID and connected line information. trust_id_outbound determines if we should send identity information to an endpoint if the caller ID or connected line information is marked as private. The idea here is that we more closely follow a "trust domain" model where trust indicates whether we can forward private information along or not. If trust_id_outbound is not true, then we will only send identity information if it is not private.
One difference between this and chan_sip's implementation is that there are two separate options, send_pai and send_rpid, that determine if we should communicate caller ID and connected line via the P-Asserted-Identity or Remote-Party-ID headers, respectively. By having two options, it becomes possible to send both types of headers if we wish.
Preserved from chan_sip is the callerid_tag setting that allows for setting some sort of "tag" on the caller ID. This is never communicated externally and it cannot be set based on SIP signaling since it is an Asterisk-specific value. It is mainly useful for planning your dialplan.
What is meant by "limited" connected line support? We will communicate connected line information to a caller during initial call setup. So on INVITE responses such as 180 Ringing and 200 OK, we will send connected line information if we received it from the far end or if it was set via the CONNECTEDLINE dialplan function. We do not support "on demand" or mid-call connected line updates. In other words, if the CONNECTEDLINE dialplan function were to be called multiple times, we would not send multiple provisional responses with new connected line values to the caller. Similarly, if we were to receive a reinvite in mid-call, we would not update the connected line properly on the other side of the bridge. The reason this is missing is simply because chan_gulp does not currently handle AST_CONTROL_CONNECTED_LINE frames in gulp_indicate(). The other thing we do not support is the UPDATE method for sending or receiving connected line. This is because the session supplement in res_sip_caller_id.c only cares about the INVITE method for the time being. A second supplement could be added to work with UPDATE pretty easily.
In addition to the direct work done for caller ID, the session supplement structure has been changed. For res_sip_caller_id's supplement to function properly, it needs to run before the channel is created. This way, the session creation stasis event will have the caller ID populated properly. In order to guarantee that the new supplement runs before channel creation, I added an integer priority member to the ast_sip_session_supplement structure. The lower this number is, the earlier the supplement will execute. I devised an enum to give pre-defined values for the priorities based on certain milestones during INVITE handling. At the moment, the only such milestone is the creation of the channel. Certain supplements will likely wish to be run before channel creation, while others will wish to run after. This enum can be expanded on as new session milestones are introduced.</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;">I ran many calls between phones and SIPp, testing a variety of options that exercised different code paths in res_sip_callerid.c</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/team/group/pimp_my_sip/channels/chan_gulp.c <span style="color: grey">(384967)</span></li>
<li>/team/group/pimp_my_sip/include/asterisk/res_sip.h <span style="color: grey">(384967)</span></li>
<li>/team/group/pimp_my_sip/include/asterisk/res_sip_session.h <span style="color: grey">(384967)</span></li>
<li>/team/group/pimp_my_sip/res/res_sip/sip_configuration.c <span style="color: grey">(384967)</span></li>
<li>/team/group/pimp_my_sip/res/res_sip_caller_id.c <span style="color: grey">(PRE-CREATION)</span></li>
<li>/team/group/pimp_my_sip/res/res_sip_session.c <span style="color: grey">(384967)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2429/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>