summaryrefslogtreecommitdiff
path: root/res/res_pjsip_caller_id.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2014-08-21 21:19:06 +0000
committerMark Michelson <mmichelson@digium.com>2014-08-21 21:19:06 +0000
commit2150daf748a7ea0a32d2160ba5959041e9dfe07a (patch)
tree9fc5c3acec9b0cf7461042555f5ca3cd78f7cce8 /res/res_pjsip_caller_id.c
parent77ddc5b713233674127e13ceef73f1e20d7fa6e6 (diff)
Improve consistency of party ID privacy usage.
Prior to this change, the Remote-Party-ID header took the position of "If caller name and number are not explicitly allowed, then they are private" and P-Asserted-Identity took the position of "Caller name and number are only private if marked explicitly so" Now both mechanisms of conveying party identification use the former approach. ........ Merged revisions 421778 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 421783 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_caller_id.c')
-rw-r--r--res/res_pjsip_caller_id.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index cffb45342..5e2f762b3 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -467,17 +467,15 @@ static void add_privacy_header(pjsip_tx_data *tdata, const struct ast_party_id *
old_privacy = pjsip_msg_find_hdr_by_name(tdata->msg, &pj_privacy_name, NULL);
- if ((id->name.presentation & AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED ||
- (id->name.presentation & AST_PRES_RESTRICTION) == AST_PRES_RESTRICTED) {
- if (!old_privacy) {
- pjsip_generic_string_hdr *privacy_hdr = pjsip_generic_string_hdr_create(
- tdata->pool, &pj_privacy_name, &pj_privacy_value);
- pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)privacy_hdr);
- }
- } else {
+ if ((id->name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED &&
+ (id->name.presentation & AST_PRES_RESTRICTION) == AST_PRES_ALLOWED) {
if (old_privacy) {
pj_list_erase(old_privacy);
}
+ } else if (!old_privacy) {
+ pjsip_generic_string_hdr *privacy_hdr = pjsip_generic_string_hdr_create(
+ tdata->pool, &pj_privacy_name, &pj_privacy_value);
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *)privacy_hdr);
}
}