summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-09-07 21:00:16 +0000
committerJoshua Colp <jcolp@digium.com>2016-09-07 21:01:30 +0000
commit5f19657710aa82c76f48a1a4f49cd92e6cd8e1f6 (patch)
tree1686bd87075c2d413cea90873da1f4163760fb91 /res
parent892536729188c29aecb6b2b5a6bab8928a63f530 (diff)
res_pjsip: Allow global headers to be overridden.
Currently when you add global headers from the dialplan both the header in the dialplan and the globally configured header are added to the resulting SIP INVITE. This change makes it so the headers in the dialplan take precedence and are the only ones added. Change-Id: I36f864298f38db3632ad503edc11267cb8ffb3ad
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip/pjsip_global_headers.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_global_headers.c b/res/res_pjsip/pjsip_global_headers.c
index 735008dcc..501f5f523 100644
--- a/res/res_pjsip/pjsip_global_headers.c
+++ b/res/res_pjsip/pjsip_global_headers.c
@@ -87,6 +87,14 @@ static void add_headers_to_message(struct header_list *headers, pjsip_tx_data *t
return;
}
AST_LIST_TRAVERSE(headers, iter, next) {
+ pj_str_t name;
+ pjsip_generic_string_hdr *hdr;
+
+ hdr = pjsip_msg_find_hdr_by_name(tdata->msg, pj_cstr(&name, iter->name), NULL);
+ if (hdr) {
+ continue;
+ }
+
ast_sip_add_header(tdata, iter->name, iter->value);
};
tdata->mod_data[global_header_mod.id] = &handled_id;