summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorDaniel Tryba <daniel@pocos.nl>2017-10-02 14:48:41 +0200
committerdtryba <daniel@tryba.nl>2017-10-05 07:46:44 -0500
commitba37dd65d3784196279c3dfe6ed22ed41fa85342 (patch)
tree10c507b7d25d94614420b1f6c05c2932f6283fd8 /res
parent88e8c22b028ebd18fdf870f52e1e2e673d7b5180 (diff)
res_pjsip_caller_id chan_sip: Comply to RFC 3323 values for privacy
Currently privacy requests are only granted if the Privacy header value is exactly "id" (defined in RFC 3325). It ignores any other possible value (or a combination there of). This patch reverses the logic from testing for "id" to grant privacy, to testing for "none" and granting privacy for any other value. "none" must not be used in combination with any other value (RFC 3323 section 4.2). ASTERISK-27284 #close Change-Id: If438a21f31a962da32d7a33ff33bdeb1e776fe56
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_caller_id.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index 470d90f43..64191a750 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -149,12 +149,12 @@ static int set_id_from_pai(pjsip_rx_data *rdata, struct ast_party_id *id)
}
privacy = pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &privacy_str, NULL);
- if (privacy && !pj_stricmp2(&privacy->hvalue, "id")) {
- id->number.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
- id->name.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
- } else {
+ if (!privacy || !pj_stricmp2(&privacy->hvalue, "none")) {
id->number.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
id->name.presentation = AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
+ } else {
+ id->number.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
+ id->name.presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
}
return 0;