[svn-commits] mmichelson: branch group/v14_colp r146710 - /team/group/v14_colp/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Oct 6 11:50:09 CDT 2008


Author: mmichelson
Date: Mon Oct  6 11:50:08 2008
New Revision: 146710

URL: http://svn.digium.com/view/asterisk?view=rev&rev=146710
Log:
Backport rev 146681 from issue8824 branch


Modified:
    team/group/v14_colp/channels/chan_sip.c

Modified: team/group/v14_colp/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/v14_colp/channels/chan_sip.c?view=diff&rev=146710&r1=146709&r2=146710
==============================================================================
--- team/group/v14_colp/channels/chan_sip.c (original)
+++ team/group/v14_colp/channels/chan_sip.c Mon Oct  6 11:50:08 2008
@@ -6329,6 +6329,7 @@
 	const char *fromdomain;
 	const char *privacy = NULL;
 	const char *screen = NULL;
+	int private = 0;
 
 	if (p->owner && p->owner->connected.id.number)
 		lid_num = p->owner->connected.id.number;
@@ -6342,7 +6343,10 @@
 		lid_name = lid_num;
 	fromdomain = S_OR(p->fromdomain, ast_inet_ntoa(p->ourip));
 
-	snprintf(tmp, sizeof(tmp), "\"%s\" <sip:%s@%s>;party=%s", lid_name, lid_num, fromdomain, ast_test_flag(&p->flags[0], SIP_OUTGOING) ? "calling" : "called");
+	snprintf(tmp, sizeof(tmp), "\"%s\" <sip:%s@%s>", lid_name, lid_num, fromdomain);
+	if (ast_test_flag(&p->flags[1], SIP_SENDRPID_RPID)) {
+		snprintf(tmp + strlen(tmp), sizeof(tmp) - strlen(tmp), ";party=%s", ast_test_flag(&p->flags[0], SIP_OUTGOING) ? "calling" : "called");
+	}
 
 	switch (lid_pres) {
 	case AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED:
@@ -6359,18 +6363,21 @@
 	case AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN:
 		privacy = "full";
 		screen = "no";
+		private = 1;
 		break;
 	case AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN:
 	case AST_PRES_PROHIB_NETWORK_NUMBER:
 		privacy = "full";
 		screen = "yes";
+		private = 1;
 		break;
 	case AST_PRES_NUMBER_NOT_AVAILABLE:
 		break;
 	default:
-		if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED)
+		if ((lid_pres & AST_PRES_RESTRICTION) != AST_PRES_ALLOWED) {
 			privacy = "full";
-		else
+			private = 1;
+		} else
 			privacy = "off";
 		screen = "no";
 		break;
@@ -6381,7 +6388,7 @@
 
 	if (ast_test_flag(&p->flags[0], SIP_PAGE2_SENDRPID_RPID)) {
 		add_header(req, "Remote-Party-ID", tmp);
-	} else {
+	} else if (!private) {
 		add_header(req, "P-Asserted-Identity", tmp);
 	}
 	return 0;




More information about the svn-commits mailing list