[asterisk-bugs] [JIRA] (ASTERISK-23306) chan_sip: Asterisk creates ACK with empty Route: headers

Walter Doekes (JIRA) noreply at issues.asterisk.org
Tue Feb 18 15:26:03 CST 2014


    [ https://issues.asterisk.org/jira/browse/ASTERISK-23306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=215399#comment-215399 ] 

Walter Doekes commented on ASTERISK-23306:
------------------------------------------

Yes.

If we view the patch in it's surroundings:
{noformat}
static void add_route(struct sip_request *req, struct sip_route *route, int skip)
{
        struct ast_str *r;

        if (sip_route_empty(route)) {
                return;
        }

        if ((r = sip_route_list(route, 0, skip))) {
                if (ast_str_strlen(r)) {
                        add_header(req, "Route", ast_str_buffer(r));
                }
                ast_free(r);
        }
}
{noformat}
We see that the ugliness is contained to a small function :)

And comparing to the old pre-r3173 code:
{noformat}
static void add_route(struct sip_request *req, struct sip_route *route)
{
        char r[SIPBUFSIZE * 2];

        if (!route)
                return;

        make_route_list(route, r, sizeof(r));
        add_header(req, "Route", r);
}
{noformat}

The only thing that stands out is that the route_list is apparently empty in the old case, whereas it is filled with a single entry in the new case.

AFAICT, we've traded that in for clarity here:
{noformat}
		add_route(req, is_strict ? p->route->next : p->route);
->
		add_route(req, &p->route, is_strict ? 1 : 0);
{noformat}

At the end of the day, I'm fine with the second patch.
                
> chan_sip: Asterisk creates ACK with empty Route: headers
> --------------------------------------------------------
>
>                 Key: ASTERISK-23306
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23306
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/General
>    Affects Versions: SVN
>            Reporter: Matt Jordan
>            Assignee: Matt Jordan
>         Attachments: chan_sip-add_route.patch, chan_sip-route.patch, typescript.gz
>
>
> When sending an ACK to a 200 OK, {{chan_sip}} is sending a Route: header unpopulated with any value. Hilarity ensues as the device continues to send the 200 OK to Asterisk.
> Example from the attached log file for channel {{SIP/200-00000002}}:
> {noformat}
> --- (11 headers 16 lines) ---
> Transmitting (NAT) to 10.10.6.214:5061:
> ACK sip:200 at 10.10.6.214:5061;ob SIP/2.0
> Via: SIP/2.0/UDP 10.10.9.206:5060;branch=z9hG4bK1d66c404;rport
> Route: 
> Max-Forwards: 70
> From: "F208" <sip:208 at 10.10.9.206>;tag=as7688ab8f
> To: <sip:200 at 10.10.6.214:5061;ob>;tag=575da22f-4f89-40c4-b8f3-6bee207b6f07
> Contact: <sip:208 at 10.10.9.206:5060>
> Call-ID: 5958b06f2925d5a2670f31f86dc90d01 at 10.10.9.206:5060
> CSeq: 102 ACK
> User-Agent: Asterisk PBX (digium)
> Content-Length: 0
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list