[Asterisk-code-review] res pjsip caller id chan sip: Comply to RFC 3323 values for ... (asterisk[master])
dtryba
asteriskteam at digium.com
Thu Oct 5 07:53:04 CDT 2017
dtryba has uploaded this change for review. ( https://gerrit.asterisk.org/6652
Change subject: res_pjsip_caller_id chan_sip: Comply to RFC 3323 values for privacy
......................................................................
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
---
M channels/chan_sip.c
M res/res_pjsip_caller_id.c
2 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/6652/1
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8a30e0c..62ff505 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -18127,7 +18127,7 @@
}
ast_copy_string(privacy, sip_get_header(req, "Privacy"), sizeof(privacy));
- if (!ast_strlen_zero(privacy) && !strncmp(privacy, "id", 2)) {
+ if (!ast_strlen_zero(privacy) && strcasecmp(privacy, "none")) {
callingpres = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
}
if (!cid_name) {
diff --git a/res/res_pjsip_caller_id.c b/res/res_pjsip_caller_id.c
index 470d90f..64191a7 100644
--- a/res/res_pjsip_caller_id.c
+++ b/res/res_pjsip_caller_id.c
@@ -149,12 +149,12 @@
}
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;
--
To view, visit https://gerrit.asterisk.org/6652
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If438a21f31a962da32d7a33ff33bdeb1e776fe56
Gerrit-Change-Number: 6652
Gerrit-PatchSet: 1
Gerrit-Owner: dtryba <daniel at tryba.nl>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171005/4c914d19/attachment.html>
More information about the asterisk-code-review
mailing list