[svn-commits] rmudgett: branch group/issue14068 r752 - /team/group/issue14068/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 17 12:16:18 CDT 2009


Author: rmudgett
Date: Fri Apr 17 12:16:15 2009
New Revision: 752

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=752
Log:
Merged revision 751 from
http://svn.digium.com/svn/libpri/team/group/rmudgett/facility

..........
r751 | rmudgett | 2009-04-17 12:02:43 -0500 (Fri, 17 Apr 2009) | 1 line

Added a note to prefix new global identifiers with PRI_ or pri_  and changed the new identifiers to comply.

Modified:
    team/group/issue14068/libpri.h
    team/group/issue14068/pri_facility.c

Modified: team/group/issue14068/libpri.h
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14068/libpri.h?view=diff&rev=752&r1=751&r2=752
==============================================================================
--- team/group/issue14068/libpri.h (original)
+++ team/group/issue14068/libpri.h Fri Apr 17 12:16:15 2009
@@ -26,7 +26,14 @@
  * provided with that copy of Asterisk, instead of the license
  * terms granted here.
  */
- 
+
+/*
+ * NOTE:
+ * All new global identifiers that are added to this file MUST be
+ * prefixed with PRI_ or pri_ to indicate that they are part of this
+ * library and to reduce potential naming conflicts.
+ */
+
 #ifndef _LIBPRI_H
 #define _LIBPRI_H
 
@@ -138,44 +145,44 @@
 #define PRI_UNKNOWN					0x0
 
 /* Presentation */
-#define PRES_NUMBER_TYPE					0x03
-#define PRES_USER_NUMBER_UNSCREENED			0x00
-#define PRES_USER_NUMBER_PASSED_SCREEN		0x01
-#define PRES_USER_NUMBER_FAILED_SCREEN		0x02
-#define PRES_NETWORK_NUMBER					0x03
-
-#define PRES_RESTRICTION					0x60
-#define PRES_ALLOWED						0x00
-#define PRES_RESTRICTED						0x20
-#define PRES_UNAVAILABLE					0x40
-#define PRES_RESERVED						0x60
+#define PRI_PRES_NUMBER_TYPE				0x03
+#define PRI_PRES_USER_NUMBER_UNSCREENED		0x00
+#define PRI_PRES_USER_NUMBER_PASSED_SCREEN	0x01
+#define PRI_PRES_USER_NUMBER_FAILED_SCREEN	0x02
+#define PRI_PRES_NETWORK_NUMBER				0x03
+
+#define PRI_PRES_RESTRICTION				0x60
+#define PRI_PRES_ALLOWED					0x00
+#define PRI_PRES_RESTRICTED					0x20
+#define PRI_PRES_UNAVAILABLE				0x40
+#define PRI_PRES_RESERVED					0x60
 
 #define PRES_ALLOWED_USER_NUMBER_NOT_SCREENED \
-	(PRES_ALLOWED | PRES_USER_NUMBER_UNSCREENED)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED)
 
 #define PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN \
-	(PRES_ALLOWED | PRES_USER_NUMBER_PASSED_SCREEN)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
 
 #define PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN \
-	(PRES_ALLOWED | PRES_USER_NUMBER_FAILED_SCREEN)
+	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
 
 #define PRES_ALLOWED_NETWORK_NUMBER	\
-	(PRES_ALLOWED | PRES_NETWORK_NUMBER)
+	(PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER)
 
 #define PRES_PROHIB_USER_NUMBER_NOT_SCREENED \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_UNSCREENED)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED)
 
 #define PRES_PROHIB_USER_NUMBER_PASSED_SCREEN \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_PASSED_SCREEN)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
 
 #define PRES_PROHIB_USER_NUMBER_FAILED_SCREEN \
-	(PRES_RESTRICTED | PRES_USER_NUMBER_FAILED_SCREEN)
+	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
 
 #define PRES_PROHIB_NETWORK_NUMBER \
-	(PRES_RESTRICTED | PRES_NETWORK_NUMBER)
+	(PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER)
 
 #define PRES_NUMBER_NOT_AVAILABLE \
-	(PRES_UNAVAILABLE | PRES_NETWORK_NUMBER)
+	(PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER)
 
 /* Causes for disconnection */
 #define PRI_CAUSE_UNALLOCATED					1

Modified: team/group/issue14068/pri_facility.c
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14068/pri_facility.c?view=diff&rev=752&r1=751&r2=752
==============================================================================
--- team/group/issue14068/pri_facility.c (original)
+++ team/group/issue14068/pri_facility.c Fri Apr 17 12:16:15 2009
@@ -334,22 +334,22 @@
 {
 	int value;
 
-	switch (presentation & PRES_RESTRICTION) {
-	case PRES_ALLOWED:
+	switch (presentation & PRI_PRES_RESTRICTION) {
+	case PRI_PRES_ALLOWED:
 		value = 0;	/* presentationAllowed<Number/Address> */
 		break;
 	default:
 		pri_message(ctrl, "!! Unsupported Q.931 number presentation value (%d)\n",
 			presentation);
 		/* fall through */
-	case PRES_RESTRICTED:
+	case PRI_PRES_RESTRICTED:
 		if (number_present) {
 			value = 3;	/* presentationRestricted<Number/Address> */
 		} else {
 			value = 1;	/* presentationRestricted */
 		}
 		break;
-	case PRES_UNAVAILABLE:
+	case PRI_PRES_UNAVAILABLE:
 		value = 2;	/* numberNotAvailableDueToInterworking */
 		break;
 	}
@@ -373,7 +373,7 @@
 
 	switch (presentation) {
 	case 0:	/* presentationAllowed<Number/Address> */
-		value = PRES_ALLOWED;
+		value = PRI_PRES_ALLOWED;
 		break;
 	default:
 		pri_message(ctrl,
@@ -382,10 +382,10 @@
 		/* fall through */
 	case 1:	/* presentationRestricted */
 	case 3:	/* presentationRestricted<Number/Address> */
-		value = PRES_RESTRICTED;
+		value = PRI_PRES_RESTRICTED;
 		break;
 	case 2:	/* numberNotAvailableDueToInterworking */
-		value = PRES_UNAVAILABLE;
+		value = PRI_PRES_UNAVAILABLE;
 		break;
 	}
 
@@ -396,12 +396,12 @@
 {
 	/* derive subscription value from presentation value */
 
-	switch (presentation & PRES_RESTRICTION) {
-	case PRES_ALLOWED:
+	switch (presentation & PRI_PRES_RESTRICTION) {
+	case PRI_PRES_ALLOWED:
 		return QSIG_NOTIFICATION_WITH_DIVERTED_TO_NR;
-	case PRES_RESTRICTED:
+	case PRI_PRES_RESTRICTED:
 		return QSIG_NOTIFICATION_WITHOUT_DIVERTED_TO_NR;
-	case PRES_UNAVAILABLE:	/* Number not available due to interworking */
+	case PRI_PRES_UNAVAILABLE:	/* Number not available due to interworking */
 		return QSIG_NOTIFICATION_WITHOUT_DIVERTED_TO_NR;	/* ?? QSIG_NO_NOTIFICATION */
 	default:
 		pri_message(pri, "!! Unknown Q.SIG presentationIndicator 0x%02x\n",
@@ -614,7 +614,7 @@
 	msg.invoke_id = get_invokeid(ctrl);
 
 	/* 'connectedpres' also indicates if name presentation is allowed */
-	if ((call->divertedtopres & PRES_RESTRICTION) == PRES_ALLOWED) {
+	if ((call->divertedtopres & PRI_PRES_RESTRICTION) == PRI_PRES_ALLOWED) {
 		msg.args.qsig.DivertingLegInformation3.presentation_allowed_indicator = 1;	/* TRUE */
 
 		if (call->divertedtoname[0]) {
@@ -2336,7 +2336,7 @@
 		}
 		call->redirectingreason = redirectingreason_for_q931(ctrl,
 			invoke->args.qsig.DivertingLegInformation2.diversion_reason);
-		call->redirectingpres = PRES_UNAVAILABLE;
+		call->redirectingpres = PRI_PRES_UNAVAILABLE;
 		call->redirectingnum[0] = '\0';
 		call->redirectingplan = (PRI_TON_UNKNOWN << 4) | PRI_NPI_E163_E164;
 		if (invoke->args.qsig.DivertingLegInformation2.diverting_present) {




More information about the svn-commits mailing list