[libpri-commits] rmudgett: branch group/issue14292 r754 - /team/group/issue14292/

SVN commits to the libpri project libpri-commits at lists.digium.com
Fri Apr 17 15:01:34 CDT 2009


Author: rmudgett
Date: Fri Apr 17 15:01:31 2009
New Revision: 754

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=754
Log:
Merged revisions 749,752-753 via svnmerge from 
https://origsvn.digium.com/svn/libpri/team/group/issue14068

................
  r749 | rmudgett | 2009-04-17 10:44:51 -0500 (Fri, 17 Apr 2009) | 1 line
  
  Comment change.
................
  r752 | rmudgett | 2009-04-17 12:16:15 -0500 (Fri, 17 Apr 2009) | 8 lines
  
  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.
................
  r753 | rmudgett | 2009-04-17 14:33:55 -0500 (Fri, 17 Apr 2009) | 1 line
  
  Comment changes and new names for new public identifiers.
................

Modified:
    team/group/issue14292/   (props changed)
    team/group/issue14292/libpri.h
    team/group/issue14292/pri_facility.c
    team/group/issue14292/pri_internal.h
    team/group/issue14292/q931.c

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
--- issue14292-integrated (original)
+++ issue14292-integrated Fri Apr 17 15:01:31 2009
@@ -1,1 +1,1 @@
-/team/group/issue14068:1-747
+/team/group/issue14068:1-753

Modified: team/group/issue14292/libpri.h
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14292/libpri.h?view=diff&rev=754&r1=753&r2=754
==============================================================================
--- team/group/issue14292/libpri.h (original)
+++ team/group/issue14292/libpri.h Fri Apr 17 15:01:31 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
@@ -343,131 +350,157 @@
 
 typedef struct q931_call q931_call;
 
-/* Connected line update source code */
+/*! \brief Connected line update source code */
 enum PRI_CONNECTED_LINE_UPDATE_SOURCE {
-	PRI_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN,   /* Update for unknown reason (May be interpreted to mean from answer) */
-	PRI_CONNECTED_LINE_UPDATE_SOURCE_ANSWER,    /* Update from normal call answering */
-	PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER,   /* Update from call transfer(active) (Party has already answered) */
-	PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER_ALERTING   /* Update from call transfer(alerting) (Party has not answered yet) */
-};
-
-/* Information needed to identify an endpoint in a call. */
+	/*! Update for unknown reason (May be interpreted to mean from answer) */
+	PRI_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN,
+	/*! Update from normal call answering */
+	PRI_CONNECTED_LINE_UPDATE_SOURCE_ANSWER,
+	/*! Update from call transfer(active) (Party has already answered) */
+	PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER,
+	/*! Update from call transfer(alerting) (Party has not answered yet) */
+	PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER_ALERTING
+};
+
+/*! \brief Information needed to identify an endpoint in a call. */
 struct pri_party_id {
-	char number[256];			/* Subscriber phone number */
-	char name[256];				/* Subscriber name */
-	int number_type;			/* Q.931 encoded "type of number" and "numbering plan identification" */
-	int number_presentation;	/* Q.931 encoded "presentation indicator" and "screening indicator" */
-};
-
-/* Connected Line/Party information */
+	/*! Subscriber phone number */
+	char number[256];
+	/*! Subscriber name */
+	char name[256];
+	/*! Q.931 encoded "type of number" and "numbering plan identification" */
+	int number_type;
+	/*! Q.931 encoded "presentation indicator" and "screening indicator" */
+	int number_presentation;
+};
+
+/*! \brief Connected Line/Party information */
 struct pri_party_connected_line {
-	struct pri_party_id id;		/* Connected party ID */
-	int source;					/* Information about the source of an update .
-	 							 * enum PRI_CONNECTED_LINE_UPDATE_SOURCE values
-	 							 * for Normal-Answer, Call-transfer */
-};
-
-/* Redirecting Line information.
+	/*! Connected party ID */
+	struct pri_party_id id;
+	/*!
+	 * \brief Information about the source of an update.
+	 * \details
+	 * enum PRI_CONNECTED_LINE_UPDATE_SOURCE values
+     * for Normal-Answer, Call-transfer
+	 */
+	int source;
+};
+
+/*!
+ * \brief Redirecting Line information.
+ * \details
  * RDNIS (Redirecting Directory Number Information Service)
- * Where a call diversion or transfer was invoked. */
+ * Where a call diversion or transfer was invoked.
+ */
 struct pri_party_redirecting {
-	struct pri_party_id from;	/* Who is redirecting the call (Sent to the party the call is redirected toward) */
-	struct pri_party_id to;		/* Call is redirecting to a new party (Sent to the caller) */
-	int count;					/* Number of times the call was redirected */
-	int reason;					/* Redirection reasons */
+	/*! Who is redirecting the call (Sent to the party the call is redirected toward) */
+	struct pri_party_id from;
+	/*! Call is redirecting to a new party (Sent to the caller) */
+	struct pri_party_id to;
+	/*! Number of times the call was redirected */
+	int count;
+	/*! Redirection reasons */
+	int reason;
 };
 
 /* Structures for qsig_cc_facilities */
-struct qsig_cc_extension {
+struct pri_qsig_cc_extension {
 	int	cc_extension_tag;
 	char extension[256];
 };
 
-struct qsig_cc_optional_arg {
+struct pri_qsig_cc_optional_arg {
 	char number_A[256];
 	char number_B[256];
 	int	service;
-	struct qsig_cc_extension cc_extension;
-};
-
-struct qsig_cc_request_res {
+	struct pri_qsig_cc_extension cc_extension;
+};
+
+struct pri_qsig_cc_request_res {
 	int	no_path_reservation;
 	int	retain_service;
-	struct qsig_cc_extension cc_extension;
-};
-
-/* Subcommand derived from Facility */
-#define CMD_REDIRECTING         1
-#define CMD_CONNECTEDLINE       2
-#define CMD_CC_CCBSREQUEST_RR   3
-#define CMD_CC_CCNRREQUEST_RR   4
-#define CMD_CC_CANCEL_INV       5
-#define CMD_CC_EXECPOSIBLE_INV  6
-#define CMD_CC_RINGOUT_INV      7
-#define CMD_CC_SUSPEND_INV      8
-#define CMD_CC_ERROR            9
-
-#define CCERROR_UNSPECIFIED		1008
-#define CCERROR_REMOTE_USER_BUSY_AGAIN	1012
-#define CCERROR_FAILURE_TO_MATCH	1013
-
-struct cmd_connectedline {
-	struct pri_party_connected_line connected;
-};
-
-struct cmd_redirecting {
-	struct pri_party_redirecting redirecting;
-};
-
-struct cmd_cc_ccbs_rr {
-	struct qsig_cc_request_res	cc_request_res;
-};
-
-struct cmd_cc_ccnr_rr {
-	struct qsig_cc_request_res	cc_request_res;
-};
-
-struct cmd_cc_cancel_inv {
-	struct qsig_cc_optional_arg	cc_optional_arg;
-};
-
-struct cmd_cc_execposible_inv {
-	struct qsig_cc_optional_arg	cc_optional_arg;
-};
-
-struct cmd_cc_suspend_inv {
-	struct qsig_cc_extension	cc_extension;
-};
-
-struct cmd_cc_ringout_inv {
-	struct qsig_cc_extension	cc_extension;
-};
-
-struct cmd_cc_error {
+	struct pri_qsig_cc_extension cc_extension;
+};
+
+/* Subcommands derived from supplementary services. */
+#define PRI_SUBCMD_REDIRECTING			1
+#define PRI_SUBCMD_CONNECTED_LINE		2
+#define PRI_SUBCMD_CC_CCBSREQUEST_RR	3
+#define PRI_SUBCMD_CC_CCNRREQUEST_RR	4
+#define PRI_SUBCMD_CC_CANCEL_INV		5
+#define PRI_SUBCMD_CC_EXECPOSIBLE_INV	6
+#define PRI_SUBCMD_CC_RINGOUT_INV		7
+#define PRI_SUBCMD_CC_SUSPEND_INV		8
+#define PRI_SUBCMD_CC_ERROR				9
+
+#define PRI_CCERROR_UNSPECIFIED				1008
+#define PRI_CCERROR_REMOTE_USER_BUSY_AGAIN	1012
+#define PRI_CCERROR_FAILURE_TO_MATCH		1013
+
+struct pri_subcmd_connected_line {
+	struct pri_party_connected_line party;
+};
+
+struct pri_subcmd_redirecting {
+	struct pri_party_redirecting party;
+};
+
+struct pri_subcmd_cc_ccbs_rr {
+	struct pri_qsig_cc_request_res cc_request_res;
+};
+
+struct pri_subcmd_cc_ccnr_rr {
+	struct pri_qsig_cc_request_res cc_request_res;
+};
+
+struct pri_subcmd_cc_cancel_inv {
+	struct pri_qsig_cc_optional_arg	cc_optional_arg;
+};
+
+struct pri_subcmd_cc_execposible_inv {
+	struct pri_qsig_cc_optional_arg	cc_optional_arg;
+};
+
+struct pri_subcmd_cc_suspend_inv {
+	struct pri_qsig_cc_extension cc_extension;
+};
+
+struct pri_subcmd_cc_ringout_inv {
+	struct pri_qsig_cc_extension cc_extension;
+};
+
+struct pri_subcmd_cc_error {
 	int	error_value;
 };
 
-struct subcommand {
+struct pri_subcommand {
+	/*! PRI_SUBCMD_xxx defined values */
 	int cmd;
 	union {
-		struct cmd_connectedline      connectedline;
-		struct cmd_redirecting        redirecting;
-		struct cmd_cc_ccbs_rr         cc_ccbs_rr;
-		struct cmd_cc_ccnr_rr         cc_ccnr_rr;
-		struct cmd_cc_cancel_inv      cc_cancel_inv;
-		struct cmd_cc_execposible_inv cc_execposible_inv;
-		struct cmd_cc_suspend_inv     cc_suspend_inv;
-		struct cmd_cc_ringout_inv     cc_ringout_inv;
-		struct cmd_cc_error           cc_error;
+		struct pri_subcmd_connected_line connected_line;
+		struct pri_subcmd_redirecting redirecting;
+		struct pri_subcmd_cc_ccbs_rr cc_ccbs_rr;
+		struct pri_subcmd_cc_ccnr_rr cc_ccnr_rr;
+		struct pri_subcmd_cc_cancel_inv cc_cancel_inv;
+		struct pri_subcmd_cc_execposible_inv cc_execposible_inv;
+		struct pri_subcmd_cc_suspend_inv cc_suspend_inv;
+		struct pri_subcmd_cc_ringout_inv cc_ringout_inv;
+		struct pri_subcmd_cc_error cc_error;
 	};
 };
 
 /* Max number of subcommands per event message */
-#define MAX_SUBCOMMANDS	4
-
-struct subcommands {
+#define PRI_MAX_SUBCOMMANDS	4
+
+struct pri_subcommands {
 	int counter_subcmd;
-	struct subcommand subcmd[MAX_SUBCOMMANDS];
+	/*!
+	 * \note This is set to sizeof(struct pri_subcommand) to
+     * maintain ABI compatibility if more subcommand events are addd.
+	 */
+	unsigned size_subcmd;
+	struct pri_subcommand subcmd[PRI_MAX_SUBCOMMANDS];
 };
 
 
@@ -498,7 +531,7 @@
 	char callednum[256];
 	int calledpres;
 	int calledplan;
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 } pri_event_ringing;
 
 typedef struct pri_event_answer {
@@ -514,7 +547,7 @@
 	int connectedpres;
 	int connectedplan;
 	int source;
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 } pri_event_answer;
 
 typedef struct pri_event_facname {
@@ -533,7 +566,7 @@
 	int channel;
 	int cref;
 	q931_call *call;
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 };
 
 #define PRI_CALLINGPLANANI
@@ -570,7 +603,7 @@
 	int origredirectingreason;
 	int redirectingpres;
 	int redirectingcount;
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 } pri_event_ring;
 
 typedef struct pri_event_hangup {
@@ -581,7 +614,7 @@
 	q931_call *call;			/* Opaque call pointer */
 	long aoc_units;				/* Advise of Charge number of charged units */
 	char useruserinfo[260];		/* User->User info */
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 } pri_event_hangup;	
 
 typedef struct pri_event_restart_ack {
@@ -735,10 +768,10 @@
    Set non-isdn to non-zero if you are not connecting to ISDN equipment */
 int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
 
-/* Give connected line information to a call */
+/*! \brief Give connected line information to a call */
 int pri_connected_line_update(struct pri *pri, q931_call *call, struct pri_party_connected_line *connected);
 
-/* Give redirection information to a call */
+/*! \brief Give redirection information to a call */
 int pri_redirecting_update(struct pri *pri, q931_call *call, struct pri_party_redirecting *redirecting);
 
 /* Set CRV reference for GR-303 calls */

Modified: team/group/issue14292/pri_facility.c
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14292/pri_facility.c?view=diff&rev=754&r1=753&r2=754
==============================================================================
--- team/group/issue14292/pri_facility.c (original)
+++ team/group/issue14292/pri_facility.c Fri Apr 17 15:01:31 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]) {
@@ -1793,9 +1793,9 @@
 }
 /* ===== End Call Completion Supplementary Service (ETS 300 366/ECMA 186) ===== */
 
-static struct subcommand *get_ptr_subcommand(struct subcommands *sub)
-{
-	if (sub->counter_subcmd < MAX_SUBCOMMANDS) {
+static struct pri_subcommand *get_ptr_subcommand(struct pri_subcommands *sub)
+{
+	if (sub->counter_subcmd < PRI_MAX_SUBCOMMANDS) {
 		int count = sub->counter_subcmd;
 
 		sub->counter_subcmd++;
@@ -2096,7 +2096,7 @@
 	const struct fac_extension_header *header, const struct rose_msg_error *error)
 {
 	const char *dms100_operation;
-	struct subcommand *c_subcmd;
+	struct pri_subcommand *c_subcmd;
 
 	switch (ctrl->switchtype) {
 	case PRI_SWITCH_QSIG:
@@ -2105,8 +2105,8 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_ERROR;
-		c_subcmd->cc_error.error_value = CCERROR_UNSPECIFIED;
+		c_subcmd->cmd = PRI_SUBCMD_CC_ERROR;
+		c_subcmd->cc_error.error_value = PRI_CCERROR_UNSPECIFIED;
 		break;
 	default:
 		break;
@@ -2152,7 +2152,7 @@
 void rose_handle_result(struct pri *ctrl, q931_call *call, q931_ie *ie,
 	const struct fac_extension_header *header, const struct rose_msg_result *result)
 {
-	struct subcommand *c_subcmd;
+	struct pri_subcommand *c_subcmd;
 
 	switch (ctrl->switchtype) {
 	case PRI_SWITCH_DMS100:
@@ -2273,7 +2273,7 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_CCBSREQUEST_RR;
+		c_subcmd->cmd = PRI_SUBCMD_CC_CCBSREQUEST_RR;
 		c_subcmd->cc_ccbs_rr.cc_request_res.no_path_reservation =
 			result->args.qsig.CcbsRequest.no_path_reservation;
 		c_subcmd->cc_ccbs_rr.cc_request_res.retain_service =
@@ -2286,7 +2286,7 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_CCNRREQUEST_RR;
+		c_subcmd->cmd = PRI_SUBCMD_CC_CCNRREQUEST_RR;
 		c_subcmd->cc_ccnr_rr.cc_request_res.no_path_reservation =
 			result->args.qsig.CcnrRequest.no_path_reservation;
 		c_subcmd->cc_ccnr_rr.cc_request_res.retain_service =
@@ -2328,7 +2328,7 @@
 void rose_handle_invoke(struct pri *ctrl, q931_call *call, q931_ie *ie,
 	const struct fac_extension_header *header, const struct rose_msg_invoke *invoke)
 {
-	struct subcommand *c_subcmd;
+	struct pri_subcommand *c_subcmd;
 
 	switch (invoke->operation) {
 #if 0	/* Not handled yet */
@@ -2663,7 +2663,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) {
@@ -2773,7 +2773,7 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_CANCEL_INV;
+		c_subcmd->cmd = PRI_SUBCMD_CC_CANCEL_INV;
 		c_subcmd->cc_cancel_inv.cc_optional_arg.number_A[0] = '\0';
 		c_subcmd->cc_cancel_inv.cc_optional_arg.number_B[0] = '\0';
 		c_subcmd->cc_cancel_inv.cc_optional_arg.cc_extension.cc_extension_tag = 0;
@@ -2792,7 +2792,7 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_EXECPOSIBLE_INV;
+		c_subcmd->cmd = PRI_SUBCMD_CC_EXECPOSIBLE_INV;
 		c_subcmd->cc_execposible_inv.cc_optional_arg.number_A[0] = '\0';
 		c_subcmd->cc_execposible_inv.cc_optional_arg.number_B[0] = '\0';
 		c_subcmd->cc_execposible_inv.cc_optional_arg.cc_extension.cc_extension_tag = 0;
@@ -2815,7 +2815,7 @@
 			pri_error(ctrl, "ERROR: Too many facility subcommands\n");
 			break;
 		}
-		c_subcmd->cmd = CMD_CC_RINGOUT_INV;
+		c_subcmd->cmd = PRI_SUBCMD_CC_RINGOUT_INV;
 		c_subcmd->cc_ringout_inv.cc_extension.cc_extension_tag = 0;
 		break;
 #if 0	/* Not handled yet */

Modified: team/group/issue14292/pri_internal.h
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14292/pri_internal.h?view=diff&rev=754&r1=753&r2=754
==============================================================================
--- team/group/issue14292/pri_internal.h (original)
+++ team/group/issue14292/pri_internal.h Fri Apr 17 15:01:31 2009
@@ -247,7 +247,7 @@
 	int ccrequestresult;
 	int cctimer2;			/* Timer for QSIG-timer2 */
 	/* QSIG cc infos (receive) */
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 
 	char keypad_digits[64];		/* Buffer for digits that come in KEYPAD_FACILITY */
 

Modified: team/group/issue14292/q931.c
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14292/q931.c?view=diff&rev=754&r1=753&r2=754
==============================================================================
--- team/group/issue14292/q931.c (original)
+++ team/group/issue14292/q931.c Fri Apr 17 15:01:31 2009
@@ -3400,14 +3400,15 @@
 	return 0;
 }
 
-static void clr_subcommands(struct subcommands *sub)
+static void clr_subcommands(struct pri_subcommands *sub)
 {
 	sub->counter_subcmd = 0;
-}
-
-static struct subcommand *get_ptr_subcommand(struct subcommands *sub)
-{
-	if (sub->counter_subcmd < MAX_SUBCOMMANDS) {
+	sub->size_subcmd = sizeof(struct pri_subcommand);
+}
+
+static struct pri_subcommand *get_ptr_subcommand(struct pri_subcommands *sub)
+{
+	if (sub->counter_subcmd < PRI_MAX_SUBCOMMANDS) {
 		int count = sub->counter_subcmd;
 		sub->counter_subcmd++;
 		return &sub->subcmd[count];
@@ -3416,9 +3417,9 @@
 	return NULL;
 }
 
-static struct subcommand *get_ptr_q931_subcommand_by_index(struct subcommands *sub, int index)
-{
-	if (index < MAX_SUBCOMMANDS) {
+static struct pri_subcommand *get_ptr_q931_subcommand_by_index(struct pri_subcommands *sub, int index)
+{
+	if (index < PRI_MAX_SUBCOMMANDS) {
 		sub->counter_subcmd--;
 		return &sub->subcmd[index];
 	}
@@ -3426,12 +3427,12 @@
 	return NULL;
 }
 
-static int q931_facilities2eventfacilities(struct pri *pri, q931_call *c, struct subcommands *subcmds)
+static int q931_facilities2eventfacilities(struct pri *pri, q931_call *c, struct pri_subcommands *subcmds)
 {
 	int facilitypos;
 	int facility_number;
-	struct subcommand *c_subcmd;
-	struct subcommand *e_subcmd;
+	struct pri_subcommand *c_subcmd;
+	struct pri_subcommand *e_subcmd;
 
 	if (c->subcmds.counter_subcmd) {
 		facility_number = c->subcmds.counter_subcmd;
@@ -3442,7 +3443,7 @@
 			e_subcmd = get_ptr_subcommand(subcmds);
 			if (c_subcmd && e_subcmd) {
 				switch (c_subcmd->cmd) {
-				case CMD_CC_CCBSREQUEST_RR:
+				case PRI_SUBCMD_CC_CCBSREQUEST_RR:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_ccbs_rr, &e_subcmd->cc_ccbs_rr, sizeof(c_subcmd->cc_ccbs_rr));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3453,7 +3454,7 @@
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					c->ccrequestresult = 1;
 					break;
-				case CMD_CC_CCNRREQUEST_RR:
+				case PRI_SUBCMD_CC_CCNRREQUEST_RR:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_ccnr_rr, &e_subcmd->cc_ccnr_rr, sizeof(c_subcmd->cc_ccnr_rr));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3464,7 +3465,7 @@
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					c->ccrequestresult = 1;
 					break;
-				case CMD_CC_CANCEL_INV:
+				case PRI_SUBCMD_CC_CANCEL_INV:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_cancel_inv, &e_subcmd->cc_cancel_inv, sizeof(c_subcmd->cc_cancel_inv));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3474,7 +3475,7 @@
 					if (pri->debug & PRI_DEBUG_APDU)
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					break;
-				case CMD_CC_EXECPOSIBLE_INV:
+				case PRI_SUBCMD_CC_EXECPOSIBLE_INV:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_execposible_inv, &e_subcmd->cc_execposible_inv, sizeof(c_subcmd->cc_execposible_inv));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3484,7 +3485,7 @@
 					if (pri->debug & PRI_DEBUG_APDU)
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					break;
-				case CMD_CC_RINGOUT_INV:
+				case PRI_SUBCMD_CC_RINGOUT_INV:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_ringout_inv, &e_subcmd->cc_ringout_inv, sizeof(c_subcmd->cc_ringout_inv));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3493,7 +3494,7 @@
 					if (pri->debug & PRI_DEBUG_APDU)
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					break;
-				case CMD_CC_SUSPEND_INV:
+				case PRI_SUBCMD_CC_SUSPEND_INV:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_suspend_inv, &e_subcmd->cc_suspend_inv, sizeof(c_subcmd->cc_suspend_inv));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -3502,7 +3503,7 @@
 					if (pri->debug & PRI_DEBUG_APDU)
 						pri_message(pri, "counter_subcmd(%d)\n", subcmds->counter_subcmd);
 					break;
-				case CMD_CC_ERROR:
+				case PRI_SUBCMD_CC_ERROR:
 					e_subcmd->cmd = c_subcmd->cmd;
 					memcpy(&c_subcmd->cc_error, &e_subcmd->cc_error, sizeof(c_subcmd->cc_error));
 					if (pri->debug & PRI_DEBUG_APDU)
@@ -4110,7 +4111,7 @@
 
 				if (c->ctcompletecallstatus == 0) {
 					/* answered(0) */
-					struct subcommand *subcmd;
+					struct pri_subcommand *subcmd;
 
 					pri_message(pri, "Got CT-Complete, callStatus = answered(0)\n");
 					pri->ev.e = PRI_EVENT_FACILITY;
@@ -4119,20 +4120,20 @@
 
 					subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 					if (subcmd) {
-						struct cmd_connectedline *cmdcl = &subcmd->connectedline;
-
-						subcmd->cmd = CMD_CONNECTEDLINE;
-						libpri_copy_string(cmdcl->connected.id.number, c->ctcompletenum, sizeof(cmdcl->connected.id.number));
-						libpri_copy_string(cmdcl->connected.id.name, c->ctcompletename, sizeof(cmdcl->connected.id.name));
-						cmdcl->connected.id.number_type = c->ctcompleteplan;
-						cmdcl->connected.id.number_presentation = c->ctcompletepres;
-						cmdcl->connected.source = PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
+						struct pri_subcmd_connected_line *cmdcl = &subcmd->connected_line;
+
+						subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
+						libpri_copy_string(cmdcl->party.id.number, c->ctcompletenum, sizeof(cmdcl->party.id.number));
+						libpri_copy_string(cmdcl->party.id.name, c->ctcompletename, sizeof(cmdcl->party.id.name));
+						cmdcl->party.id.number_type = c->ctcompleteplan;
+						cmdcl->party.id.number_presentation = c->ctcompletepres;
+						cmdcl->party.source = PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 						haveevent = 1;
-						pri_message(pri, "CT-Complete, sending facility/CMD_CONNECTEDLINE (%s/%s)\n", cmdcl->connected.id.name, cmdcl->connected.id.number);
+						pri_message(pri, "CT-Complete, sending facility/PRI_SUBCMD_CONNECTED_LINE (%s/%s)\n", cmdcl->party.id.name, cmdcl->party.id.number);
 					}
 				} else if (c->ctcompletecallstatus == 1) {
 					/* alerting(1) */
-					struct subcommand *subcmd;
+					struct pri_subcommand *subcmd;
 
 					pri_message(pri, "Got CT-Complete, callStatus = alerting(1)\n");
 					pri->ev.e = PRI_EVENT_FACILITY;
@@ -4141,27 +4142,27 @@
 
 					subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 					if (subcmd) {
-						struct cmd_redirecting *cmdr = &subcmd->redirecting;
-
-						subcmd->cmd = CMD_REDIRECTING;
-						libpri_copy_string(cmdr->redirecting.from.number, c->connectednum, sizeof(cmdr->redirecting.from.number));
-						libpri_copy_string(cmdr->redirecting.from.name, c->connectedname, sizeof(cmdr->redirecting.from.name));
-						cmdr->redirecting.from.number_type = c->connectedplan;
-						cmdr->redirecting.from.number_presentation = c->connectedpres;
-						libpri_copy_string(cmdr->redirecting.to.number, c->ctcompletenum, sizeof(cmdr->redirecting.to.number));
-						libpri_copy_string(cmdr->redirecting.to.name, c->ctcompletename, sizeof(cmdr->redirecting.to.name));
-						cmdr->redirecting.to.number_type = c->ctcompleteplan;
-						cmdr->redirecting.to.number_presentation = c->ctcompletepres;
-						cmdr->redirecting.count = 0;
-						cmdr->redirecting.reason = PRI_REDIR_UNKNOWN;
+						struct pri_subcmd_redirecting *cmdr = &subcmd->redirecting;
+
+						subcmd->cmd = PRI_SUBCMD_REDIRECTING;
+						libpri_copy_string(cmdr->party.from.number, c->connectednum, sizeof(cmdr->party.from.number));
+						libpri_copy_string(cmdr->party.from.name, c->connectedname, sizeof(cmdr->party.from.name));
+						cmdr->party.from.number_type = c->connectedplan;
+						cmdr->party.from.number_presentation = c->connectedpres;
+						libpri_copy_string(cmdr->party.to.number, c->ctcompletenum, sizeof(cmdr->party.to.number));
+						libpri_copy_string(cmdr->party.to.name, c->ctcompletename, sizeof(cmdr->party.to.name));
+						cmdr->party.to.number_type = c->ctcompleteplan;
+						cmdr->party.to.number_presentation = c->ctcompletepres;
+						cmdr->party.count = 0;
+						cmdr->party.reason = PRI_REDIR_UNKNOWN;
 						haveevent = 1;
-						pri_message(pri, "CT-Complete, sending facility/CMD_REDIRECTING (%s/%s)\n", cmdr->redirecting.to.name, cmdr->redirecting.to.number);
+						pri_message(pri, "CT-Complete, sending facility/PRI_SUBCMD_REDIRECTING (%s/%s)\n", cmdr->party.to.name, cmdr->party.to.number);
 					}
 				} else {
 					pri_message(pri, "illegal value for callStatus=%d\n", c->ctcompletecallstatus);
 				}
 			} else if (c->ctactiveflag) {
-				struct subcommand *subcmd;
+				struct pri_subcommand *subcmd;
 
 				c->ctactiveflag = 0;
 
@@ -4172,20 +4173,20 @@
 
 				subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 				if (subcmd) {
-					struct cmd_connectedline *cmdcl = &subcmd->connectedline;
-
-					subcmd->cmd = CMD_CONNECTEDLINE;
-					libpri_copy_string(cmdcl->connected.id.number, c->ctcompletenum, sizeof(cmdcl->connected.id.number));
-					libpri_copy_string(cmdcl->connected.id.name, c->ctcompletename, sizeof(cmdcl->connected.id.name));
-					cmdcl->connected.id.number_type = c->ctcompleteplan;
-					cmdcl->connected.id.number_presentation = c->ctcompletepres;
-					cmdcl->connected.source = PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
+					struct pri_subcmd_connected_line *cmdcl = &subcmd->connected_line;
+
+					subcmd->cmd = PRI_SUBCMD_CONNECTED_LINE;
+					libpri_copy_string(cmdcl->party.id.number, c->ctcompletenum, sizeof(cmdcl->party.id.number));
+					libpri_copy_string(cmdcl->party.id.name, c->ctcompletename, sizeof(cmdcl->party.id.name));
+					cmdcl->party.id.number_type = c->ctcompleteplan;
+					cmdcl->party.id.number_presentation = c->ctcompletepres;
+					cmdcl->party.source = PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 					haveevent = 1;
-					pri_message(pri, "CT-Active, sending facility CMD_CONNECTEDLINE (%s/%s)\n", cmdcl->connected.id.name, cmdcl->connected.id.number);
+					pri_message(pri, "CT-Active, sending facility PRI_SUBCMD_CONNECTED_LINE (%s/%s)\n", cmdcl->party.id.name, cmdcl->party.id.number);
 				}
 			}
 			else if (c->divleginfo1activeflag) {
-				struct subcommand *subcmd;
+				struct pri_subcommand *subcmd;
 
 				c->divleginfo1activeflag = 0;
 
@@ -4196,21 +4197,21 @@
 
 				subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 				if (subcmd) {
-					struct cmd_redirecting *cmdr = &subcmd->redirecting;
-
-					subcmd->cmd = CMD_REDIRECTING;
-					libpri_copy_string(cmdr->redirecting.from.number, c->callednum, sizeof(cmdr->redirecting.from.number));
-					cmdr->redirecting.from.name[0] = '\0';
-					cmdr->redirecting.from.number_type = c->calledplan;
-					cmdr->redirecting.from.number_presentation = PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
-					libpri_copy_string(cmdr->redirecting.to.number, c->divertedtonum, sizeof(cmdr->redirecting.to.number));
-					cmdr->redirecting.to.name[0] = '\0';
-					cmdr->redirecting.to.number_type = c->divertedtoplan;
-					cmdr->redirecting.to.number_presentation = c->divertedtopres;
-					cmdr->redirecting.count = c->divertedtocount;
-					cmdr->redirecting.reason = c->divertedtoreason;
+					struct pri_subcmd_redirecting *cmdr = &subcmd->redirecting;
+
+					subcmd->cmd = PRI_SUBCMD_REDIRECTING;
+					libpri_copy_string(cmdr->party.from.number, c->callednum, sizeof(cmdr->party.from.number));
+					cmdr->party.from.name[0] = '\0';
+					cmdr->party.from.number_type = c->calledplan;
+					cmdr->party.from.number_presentation = PRES_ALLOWED_USER_NUMBER_NOT_SCREENED;
+					libpri_copy_string(cmdr->party.to.number, c->divertedtonum, sizeof(cmdr->party.to.number));
+					cmdr->party.to.name[0] = '\0';
+					cmdr->party.to.number_type = c->divertedtoplan;
+					cmdr->party.to.number_presentation = c->divertedtopres;
+					cmdr->party.count = c->divertedtocount;
+					cmdr->party.reason = c->divertedtoreason;
 					haveevent = 1;
-					pri_message(pri, "DivertingLegInformation1, sending facility/CMD_REDIRECTING (%s/%s)\n", cmdr->redirecting.to.name, cmdr->redirecting.to.number);
+					pri_message(pri, "DivertingLegInformation1, sending facility/PRI_SUBCMD_REDIRECTING (%s/%s)\n", cmdr->party.to.name, cmdr->party.to.number);
 				}
 			}
 




More information about the libpri-commits mailing list