summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2014-02-21 16:49:03 +0000
committerCorey Farrell <git@cfware.com>2014-02-21 16:49:03 +0000
commit3cfa1c882618d0a8828f8109567884898f0e437b (patch)
tree063d06617072ba0cb1c3f2eb43b4714f75e00348
parentb88c818153c47dec313e8986e24fc5ac9f133113 (diff)
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
-rw-r--r--channels/chan_sip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a54437a53..f717c77ee 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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);
}
}