[prev in list] [next in list] [prev in thread] [next in thread]
List: asterisk-dev
Subject: Re: [asterisk-dev] [Code Review] chan_sip code cleanup
From: "Leif Madsen" <reviewboard () asterisk ! org>
Date: 2012-06-25 13:07:07
Message-ID: 20120625130707.20106.14184 () hotblack ! digium ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1993/#review6563
-----------------------------------------------------------
It looks like, as Mark pointed out, that you have about 3-4 changes related to Cisco \
device functionality. I think it would be best to break those out as a separate \
review and change from the cleanup aspects.
- Leif
On June 24, 2012, 10:27 p.m., gareth wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1993/
> -----------------------------------------------------------
>
> (Updated June 24, 2012, 10:27 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> 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 -> sip_{notify|refer}_alloc to match other *alloc \
> functions.
> - Replace get_msg_text, get_msg_text2 and get_pidf_body -> No, not \
> get_pidf_msg_text_body3 but get_content, to match add_content.
> - get_body doesn't get the request body, renamed to get_content_line.
>
> - get_body_by_line doesn'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 -> onhold, inUse \
> -> inuse, inRinging -> ringing.
> - Remove camelCase in struct sip_request rlPart1 -> rlpart1, rlPart2 -> rlpart2.
>
> - Rename instances of pvt->randdata to pvt->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) 'header' 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't need it.
> - Move extension state callback management in handle_request_subscribe to avoid \
> duplicate checking for packages that don't need it.
> - Remove duplicate append_date prototype.
>
> - Rename append_date -> 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't pass req->debug to request handle_request_XXXXX handlers if req is also \
> being passed.
> - Don't pass req->ignore to check_auth as req is already being passed.
>
> - Don't create a subscription in handle_request_subscribe if p->expiry == 0.
>
> - Don'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.
>
> Diffs
> -----
>
> /trunk/channels/chan_sip.c 369065
> /trunk/channels/sip/include/sip.h 369065
> /trunk/channels/sip/security_events.c 369065
>
> Diff: https://reviewboard.asterisk.org/r/1993/diff
>
>
> Testing
> -------
>
> It compiles.
>
>
> Thanks,
>
> gareth
>
>
[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/1993/">https://reviewboard.asterisk.org/r/1993/</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;">It looks like, as Mark \
pointed out, that you have about 3-4 changes related to Cisco device functionality. I \
think it would be best to break those out as a separate review and change from the \
cleanup aspects.</pre> <br />
<p>- Leif</p>
<br />
<p>On June 24th, 2012, 10:27 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 June 24, 2012, 10:27 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 -> sip_{notify|refer}_alloc to match other *alloc \
functions.
- Replace get_msg_text, get_msg_text2 and get_pidf_body -> No, not \
get_pidf_msg_text_body3 but get_content, to match add_content.
- get_body doesn't get the request body, renamed to get_content_line.
- get_body_by_line doesn'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 -> onhold, \
inUse -> inuse, inRinging -> ringing.
- Remove camelCase in struct sip_request rlPart1 -> rlpart1, rlPart2 -> \
rlpart2.
- Rename instances of pvt->randdata to pvt->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) 'header' 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't need it.
- Move extension state callback management in handle_request_subscribe to avoid \
duplicate checking for packages that don't need it.
- Remove duplicate append_date prototype.
- Rename append_date -> 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't pass req->debug to request handle_request_XXXXX handlers if req is \
also being passed.
- Don't pass req->ignore to check_auth as req is already being passed.
- Don't create a subscription in handle_request_subscribe if p->expiry == 0.
- Don'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">(369065)</span></li>
<li>/trunk/channels/sip/include/sip.h <span style="color: grey">(369065)</span></li>
<li>/trunk/channels/sip/security_events.c <span style="color: \
grey">(369065)</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>
--
_____________________________________________________________________
-- 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