From ba37dd65d3784196279c3dfe6ed22ed41fa85342 Mon Sep 17 00:00:00 2001 From: Daniel Tryba Date: Mon, 2 Oct 2017 14:48:41 +0200 Subject: 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 --- channels/chan_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'channels/chan_sip.c') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 909a5c85d..caf780282 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -18083,7 +18083,7 @@ static int get_pai(struct sip_pvt *p, struct sip_request *req) } 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) { -- cgit v1.2.3