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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 17 14:33:58 CDT 2009


Author: rmudgett
Date: Fri Apr 17 14:33:55 2009
New Revision: 753

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=753
Log:
Comment changes and new names for new public identifiers.

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

Modified: team/group/issue14068/libpri.h
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14068/libpri.h?view=diff&rev=753&r1=752&r2=753
==============================================================================
--- team/group/issue14068/libpri.h (original)
+++ team/group/issue14068/libpri.h Fri Apr 17 14:33:55 2009
@@ -344,67 +344,93 @@
 
 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) */
+	/*! 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
 };
 
-/* Information needed to identify an endpoint in a call. */
+/*! \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" */
+	/*! 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;
 };
 
-/* Connected Line/Party information */
+/*! \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 */
+	/*! 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;
 };
 
-/* Redirecting Line information.
+/*!
+ * \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;
 };
 
-/* Subcommand derived from Facility */
-#define CMD_REDIRECTING         1
-#define CMD_CONNECTEDLINE       2
-
-
-struct cmd_connectedline {
-	struct pri_party_connected_line connected;
+/* Subcommands derived from supplementary services. */
+#define PRI_SUBCMD_REDIRECTING		1
+#define PRI_SUBCMD_CONNECTED_LINE	2
+
+
+struct pri_subcmd_connected_line {
+	struct pri_party_connected_line party;
 };
 
-struct cmd_redirecting {
-	struct pri_party_redirecting redirecting;
+struct pri_subcmd_redirecting {
+	struct pri_party_redirecting party;
 };
 
-struct subcommand {
+struct pri_subcommand {
+	/*! PRI_SUBCMD_xxx defined values */
 	int cmd;
 	union {
-		struct cmd_connectedline connectedline;
-		struct cmd_redirecting   redirecting;
+		struct pri_subcmd_connected_line connected_line;
+		struct pri_subcmd_redirecting redirecting;
 	};
 };
 
 /* 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];
 };
 
 
@@ -468,7 +494,7 @@
 	int channel;
 	int cref;
 	q931_call *call;
-	struct subcommands subcmds;
+	struct pri_subcommands subcmds;
 };
 
 #define PRI_CALLINGPLANANI
@@ -668,10 +694,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/issue14068/q931.c
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14068/q931.c?view=diff&rev=753&r1=752&r2=753
==============================================================================
--- team/group/issue14068/q931.c (original)
+++ team/group/issue14068/q931.c Fri Apr 17 14:33:55 2009
@@ -3351,14 +3351,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];
@@ -3905,7 +3906,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;
@@ -3914,20 +3915,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;
@@ -3936,27 +3937,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;
 
@@ -3967,20 +3968,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;
 
@@ -3991,21 +3992,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 svn-commits mailing list