mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 00:00:09 +00:00
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
This commit is contained in:
@@ -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))) {
|
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);
|
ast_free(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user