chan_sip: prevent add_route from adding empty header.

Fix regression caused by ASTERISK-22582.  Empty Route
headers were added when the route had a single strict
hop.

(closes issue ASTERISK-23306)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3236/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/97/197/1
Corey Farrell 11 years ago
parent b88c818153
commit 3cfa1c8826

@ -11687,7 +11687,9 @@ static void add_route(struct sip_request *req, struct sip_route *route, int skip
}
if ((r = sip_route_list(route, 0, skip))) {
add_header(req, "Route", ast_str_buffer(r));
if (ast_str_strlen(r)) {
add_header(req, "Route", ast_str_buffer(r));
}
ast_free(r);
}
}

Loading…
Cancel
Save