[asterisk-commits] mmichelson: branch 13 r421783 - in /branches/13: ./ res/res_pjsip_caller_id.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 21 16:18:23 CDT 2014


Author: mmichelson
Date: Thu Aug 21 16:18:21 2014
New Revision: 421783

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=421783
Log:
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

Modified:
    branches/13/   (props changed)
    branches/13/res/res_pjsip_caller_id.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/res/res_pjsip_caller_id.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip_caller_id.c?view=diff&rev=421783&r1=421782&r2=421783
==============================================================================
--- branches/13/res/res_pjsip_caller_id.c (original)
+++ branches/13/res/res_pjsip_caller_id.c Thu Aug 21 16:18:21 2014
@@ -467,17 +467,15 @@
 
 	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);
 	}
 }
 




More information about the asterisk-commits mailing list