[Home]

Summary:ASTERISK-22582: [patch] chan_sip refactor - sip_route
Reporter:Corey Farrell (coreyfarrell)Labels:
Date Opened:2013-09-25 16:35:21Date Closed:2014-02-10 12:39:03.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/General Tests/testsuite
Versions:SVN Frequency of
Occurrence
Related
Issues:
causesASTERISK-23306 chan_sip: Asterisk creates ACK with empty Route: headers
Environment:Attachments:( 0) chan_sip-route.patch
( 1) testsuite-sip-record-route.patch
Description:This patch isolates code that manages struct sip_route.
* Move route code to sip/route.c + sip/include/route.h
* Rename functions to sip_route_*
* Replace ad-hoc list code with macro's from linkedlists.h
* Create sip_route_process_header() to processes Path and Record-Route headers (previously done with different code in build_route and build_path)
* Make sip_route uri accessor return a const
* Move struct uriparams, struct contact and contactliststruct from sip.h to reqresp_parser.h.  sip/route.c uses reqresp_parser.h but not sip.h, this was a problem.  These moved declares are not used outside of reqresp_parser.
* While modifying reqprep() the lack of {} caused me trouble.  I added them.
* Code outside route.c treats sip_route as an opaque structure, using macro's or procedures for all access.

In the testsuite I ran tests/channels/SIP/path to verify that was still passing.  I found that no testsuite existed for Record-Route handling, so I created one.  I verified the patch does not change the request URI, Route or Record-Route headers sent by asterisk.  The test includes inbound and outbound INVITE, with both strict and loose routes.  This is the first testsuite code I've written so I'm sorry if it's not that good.  It produces useless messages on test failure, I'm open to suggestions.

This patch is intended to be the first in a series, I'd like to get feedback before I continue similar work.
Comments:By: Matt Jordan (mjordan) 2014-01-29 12:43:45.235-0600

So I took at quick peek over the patches and nothing looked glaring. I'd say put it up for a more formal review on Review Board.

By: Corey Farrell (coreyfarrell) 2014-02-03 06:53:00.834-0600

The testsuite has been improved for the version uploaded to [r3172|https://reviewboard.asterisk.org/r/3172/].
chan_sip patch posted to [r3173|https://reviewboard.asterisk.org/r/3173/].