[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-dev
Subject: Re: [asterisk-dev] [Code Review] 2976: chan_sip: notify dialog info ignores presentation indicator i
From: "Mark Michelson" <reviewboard () asterisk ! org>
Date: 2013-10-31 21:30:03
Message-ID: 20131031213003.23593.51816 () 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/2976/#review10081
-----------------------------------------------------------
this review is much larger than it needs to be due to a lot of spacing changes made \
throughout chan_sip.c. Please try to keep reviews limited to the scope of the issue \
being fixed. If you want to fix spacing problems in chan_sip.c, that can be done as a \
separate review or just committed as its own changeset.
branches/11/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/2976/#comment19358>
I think the cid_num and name need the same logic applied to it as the connected \
line number and name.
branches/11/channels/chan_sip.c
<https://reviewboard.asterisk.org/r/2976/#comment19359>
When the number is to remain anonymous, you should obscure the domain portion as \
well. RFC 3261 gives the suggestion of using "anonymous.invalid" for this.
- Mark Michelson
On Oct. 30, 2013, 2:07 p.m., Kevin Harwell wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2976/
> -----------------------------------------------------------
>
> (Updated Oct. 30, 2013, 2:07 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: AST-1175
> https://issues.asterisk.org/jira/browse/AST-1175
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> The presentation indicator in a callerid (e.g. set by dialplan function \
> Set(CALLERID(name-pres)= ...)) is not checked when SIP Dialog Info Notifies are \
> generated during extension monitoring. Added a check to make sure the name and/or \
> number presentations on the callee (remote identity) are set to allow. If they are \
> restricted then "anonymous" is used instead.
>
> Diffs
> -----
>
> branches/11/channels/chan_sip.c 402221
>
> Diff: https://reviewboard.asterisk.org/r/2976/diff/
>
>
> Testing
> -------
>
> Using SIPp subscribed to dialog-info for a phone then made a call from another \
> phone to the subscribed phone and observed that the remote identity was being \
> replaced when either the name and/or number presentations were set to restricted.
>
> Thanks,
>
> Kevin Harwell
>
>
[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/2976/">https://reviewboard.asterisk.org/r/2976/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">this review is much \
larger than it needs to be due to a lot of spacing changes made throughout \
chan_sip.c. Please try to keep reviews limited to the scope of the issue being fixed. \
If you want to fix spacing problems in chan_sip.c, that can be done as a separate \
review or just committed as its own changeset.</pre> <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/2976/diff/1/?file=47802#file47802line14564" \
style="color: black; font-weight: bold; text-decoration: \
underline;">branches/11/channels/chan_sip.c</a> <span style="font-weight: normal;">
(Diff revision 1)
</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 \
void state_notify_build_xml(struct state_notify_data *data, int full, const char \
*exten, const char *context, struct ast_str **tmp, struct sip_pvt *p, int subscribed, \
const char *mfrom, const char *mto)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14564</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>cid_num = \
S_COR(ast_channel_caller(callee)->id.number.valid,</pre></td> <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">14564</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>cid_num = \
S_COR(ast_channel_caller(callee)->id.number.valid,</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14565</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span><span \
class="tb"> </span>ast_channel_caller(callee)->id.number.str, \
"");</pre></td> <th bgcolor="#f0f0f0" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">14565</font></th> <td bgcolor="#ffffff" 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="tb"> </span><span \
class="tb"> </span><span \
class="tb"> </span>ast_channel_caller(callee)->id.number.str, \
"");</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14566</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>need = strlen(cid_num) + \
strlen(p->fromdomain) + sizeof("sip:@");</pre></td> <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">14566</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>need = strlen(cid_num) + \
strlen(p->fromdomain) + sizeof("sip:@");</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14567</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>local_target = \
ast_alloca(need);</pre></td> <th bgcolor="#f0f0f0" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">14567</font></th> <td bgcolor="#ffffff" 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="tb"> </span><span \
class="tb"> </span>local_target = ast_alloca(need);</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14568</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>snprintf(local_target, need, \
"sip:%s@%s", cid_num, p->fromdomain);</pre></td> <th bgcolor="#f0f0f0" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14568</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>snprintf(local_target, need, \
"sip:%s@%s", cid_num, p->fromdomain);</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14569</font></th> <td bgcolor="#ffffff" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">14569</font></th> <td bgcolor="#ffffff" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td> \
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14570</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span \
class="tb"> </span>ast_xml_escape(S_COR(ast_channel_caller(callee)->id.name.valid,</pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px \
solid #C0C0C0;" align="right"><font size="2">14570</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span \
class="tb"> </span>ast_xml_escape(S_COR(ast_channel_caller(callee)->id.name.valid,</pre></td>
</tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14571</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span><span class="tb"> </span><span \
class="tb"> </span> ast_channel_caller(callee)->id.name.str, \
""),</pre></td> <th bgcolor="#f0f0f0" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">14571</font></th> <td bgcolor="#ffffff" 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="tb"> </span><span \
class="tb"> </span><span class="tb"> </span><span class="tb"> </span> \
ast_channel_caller(callee)->id.name.str, ""),</pre></td> </tr>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14572</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span><span class="tb"> </span> \
local_display, sizeof(local_display));</pre></td> <th bgcolor="#f0f0f0" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14572</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span><span class="tb"> </span> \
local_display, sizeof(local_display));</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 think the \
cid_num and name need the same logic applied to it as the connected line number and \
name.</pre> </div>
<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/2976/diff/1/?file=47802#file47802line14578" \
style="color: black; font-weight: bold; text-decoration: \
underline;">branches/11/channels/chan_sip.c</a> <span style="font-weight: normal;">
(Diff revision 1)
</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 \
void state_notify_build_xml(struct state_notify_data *data, int full, const char \
*exten, const char *context, struct ast_str **tmp, struct sip_pvt *p, int subscribed, \
const char *mfrom, const char *mto)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">14576</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>need = strlen(connected_num) + \
strlen(p->fromdomain) + sizeof("sip:@");</pre></td> <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">14578</font></th> <td bgcolor="#ffffff" \
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="tb"> </span><span class="tb"> </span>need = strlen(connected_num) + \
strlen(p->fromdomain) + sizeof("sip:@");</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;">When the \
number is to remain anonymous, you should obscure the domain portion as well. RFC \
3261 gives the suggestion of using "anonymous.invalid" for this.</pre> \
</div> <br />
<p>- Mark</p>
<br />
<p>On October 30th, 2013, 2:07 p.m. UTC, Kevin Harwell 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 Kevin Harwell.</div>
<p style="color: grey;"><i>Updated Oct. 30, 2013, 2:07 p.m.</i></p>
<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/AST-1175">AST-1175</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;">The presentation indicator in a callerid (e.g. set by dialplan function \
Set(CALLERID(name-pres)= ...)) is not checked when SIP Dialog Info Notifies are \
generated during extension monitoring. Added a check to make sure the name and/or \
number presentations on the callee (remote identity) are set to allow. If they are \
restricted then "anonymous" is used instead. </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;">Using SIPp subscribed to dialog-info for a phone then made a call from \
another phone to the subscribed phone and observed that the remote identity was being \
replaced when either the name and/or number presentations were set to \
restricted.</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/11/channels/chan_sip.c <span style="color: grey">(402221)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2976/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