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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 3 16:26:14 CST 2009


Author: rmudgett
Date: Tue Feb  3 16:26:14 2009
New Revision: 692

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=692
Log:
*  Made use new structs instead of new typdefs.
*  Moved new COLP fields to the end of existing structures to
attempt to preserve ABI compatibility.
*  Removed unused PRI_CONNECTED_LINE_UPDATE_SOURCE_DIVERSION.
*  Added new PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER_ALERTING.

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=692&r1=691&r2=692
==============================================================================
--- team/group/issue14068/libpri.h (original)
+++ team/group/issue14068/libpri.h Tue Feb  3 16:26:14 2009
@@ -339,8 +339,8 @@
 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_DIVERSION, /* Update from call diversion */
-	PRI_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER   /* Update from call transfer */
+	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. */
@@ -356,7 +356,7 @@
 	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, Call-diversion */
+	 							 * for Normal-Answer, Call-transfer */
 };
 
 /* Redirecting Line information.
@@ -374,35 +374,35 @@
 #define CMD_CONNECTEDLINE       2
 
 
-typedef struct cmd_connectedline {
+struct cmd_connectedline {
 	int e;
 	int channel;
 	q931_call *call;
 	struct pri_party_connected_line connected;
-} cmd_connectedline;
-
-typedef struct cmd_redirecting {
+};
+
+struct cmd_redirecting {
 	int e;
 	int channel;
 	q931_call *call;
 	struct pri_party_redirecting redirecting;
-} cmd_redirecting;
-
-typedef	struct subcommand {
+};
+
+struct subcommand {
 	int cmd;
 	union {
-		cmd_connectedline      connectedline;
-		cmd_redirecting        redirecting;
+		struct cmd_connectedline connectedline;
+		struct cmd_redirecting   redirecting;
 	};
-} subcommand;
+};
 
 /* Max number of subcommands per event message */
 #define MAX_SUBCOMMANDS	4
 
-typedef	struct subcommands {
+struct subcommands {
 	int counter_subcmd;
-	subcommand subcmd[MAX_SUBCOMMANDS];
-} subcommands;
+	struct subcommand subcmd[MAX_SUBCOMMANDS];
+};
 
 
 typedef struct pri_event_generic {
@@ -442,10 +442,10 @@
 	int progressmask;
 	q931_call *call;
 	char useruserinfo[260];		/* User->User info */
+	char connectednum[256];
+	char connectedname[256];
 	int connectedpres;
 	int connectedplan;
-	char connectednum[256];
-	char connectedname[256];
 	int source;
 } pri_event_answer;
 
@@ -460,13 +460,13 @@
 	int callingplan;			/* Dialing plan of Calling entity */
 } pri_event_facname;
 
-typedef struct pri_event_facility {
+struct pri_event_facility {
 	int e;
 	int channel;
 	int cref;
 	q931_call *call;
 	struct subcommands subcmds;
-} pri_event_facility;
+};
 
 #define PRI_CALLINGPLANANI
 #define PRI_CALLINGPLANRDNIS
@@ -484,9 +484,7 @@
 	char callednum[256];		/* Called number */
 	char redirectingnum[256];	/* Redirecting number */
 	char redirectingname[256];	/* Redirecting name */
-	int redirectingpres;
 	int redirectingreason;		/* Reason for redirect */
-	int redirectingcount;
 	int callingplanrdnis;			/* Dialing plan of Redirecting Number */
 	char useruserinfo[260];		/* User->User info */
 	int flexible;				/* Are we flexible with our channel selection? */
@@ -502,6 +500,8 @@
 	char origcallednum[256];
 	int callingplanorigcalled;		/* Dialing plan of Originally Called Number */
 	int origredirectingreason;
+	int redirectingpres;
+	int redirectingcount;
 } pri_event_ring;
 
 typedef struct pri_event_hangup {
@@ -564,7 +564,7 @@
 	pri_event_setup_ack   setup_ack;	/* SETUP_ACKNOWLEDGE structure */
 	pri_event_notify notify;		/* Notification */
 	pri_event_keypad_digit digit;			/* Digits that come during a call */
-	pri_event_facility facility;
+	struct pri_event_facility facility;
 } pri_event;
 
 struct pri;

Modified: team/group/issue14068/q931.c
URL: http://svn.digium.com/svn-view/libpri/team/group/issue14068/q931.c?view=diff&rev=692&r1=691&r2=692
==============================================================================
--- team/group/issue14068/q931.c (original)
+++ team/group/issue14068/q931.c Tue Feb  3 16:26:14 2009
@@ -992,8 +992,7 @@
 				prefix, ie->data[2] >> 7, redirection_reason2str(ie->data[2] & 0x7f), ie->data[2] & 0x7f);
 			break;
 		}
-	}
-	while(!(ie->data[i++]& 0x80));
+	} while(!(ie->data[i++]& 0x80));
 	q931_get_number(cnum, sizeof(cnum), ie->data + i, ie->len - i);
 	pri_message(pri, "  '%s' ]\n", cnum);
 }
@@ -1013,8 +1012,7 @@
 			call->connectedpres = ie->data[i] & 0x7f;
 			break;
 		}
-	}
-	while(!(ie->data[i++] & 0x80));
+	} while(!(ie->data[i++] & 0x80));
 	q931_get_number((unsigned char *) call->connectednum, sizeof(call->connectednum), ie->data + i, ie->len - i);
 
 	return 0;
@@ -1050,8 +1048,7 @@
 				prefix, ie->data[1] >> 7, pri_pres2str(ie->data[1] & 0x7f), ie->data[1] & 0x7f);
 			break;
 		}
-	}
-	while(!(ie->data[i++]& 0x80));
+	} while(!(ie->data[i++]& 0x80));
 	q931_get_number(cnum, sizeof(cnum), ie->data + i, ie->len - i);
 	pri_message(pri, "  '%s' ]\n", cnum);
 }
@@ -1075,8 +1072,7 @@
 			call->redirectingreason = ie->data[i] & 0x0f;
 			break;
 		}
-	}
-	while(!(ie->data[i++] & 0x80));
+	} while(!(ie->data[i++] & 0x80));
 	q931_get_number((unsigned char *) call->redirectingnum, sizeof(call->redirectingnum), ie->data + i, ie->len - i);
 	return 0;
 }
@@ -2513,8 +2509,7 @@
 						maxlen -= res;
 						iet = (q931_ie *)((char *)iet + res);
 					}
-				}
-				while (res > 0 && order < ies_count);
+				} while (res > 0 && order < ies_count);
 				if (have_shift && total_res) {
 					if (Q931_IE_CODESET(ies[x].ie))
 						*codeset = Q931_IE_CODESET(ies[x].ie);
@@ -3300,12 +3295,12 @@
 	return 0;
 }
 
-static void clr_subcommands(subcommands *sub)
+static void clr_subcommands(struct subcommands *sub)
 {
 	sub->counter_subcmd = 0;
 }
 
-static subcommand *get_ptr_subcommand(subcommands *sub)
+static struct subcommand *get_ptr_subcommand(struct subcommands *sub)
 {
 	if (sub->counter_subcmd < MAX_SUBCOMMANDS) {
 		int count = sub->counter_subcmd;
@@ -3746,7 +3741,7 @@
 
 				if (c->ctcompletecallstatus == 0) {
 					/* answered(0) */
-					subcommand *subcmd;
+					struct subcommand *subcmd;
 
 					pri_message(pri, "Got CT-Complete, callStatus = answered(0)\n");
 					pri->ev.e = PRI_EVENT_FACILITY;
@@ -3755,8 +3750,9 @@
 
 					subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 					if (subcmd) {
+						struct cmd_connectedline *cmdcl = &subcmd->connectedline;
+
 						subcmd->cmd = CMD_CONNECTEDLINE;
-						cmd_connectedline *cmdcl = &subcmd->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;
@@ -3767,7 +3763,7 @@
 					}
 				} else if (c->ctcompletecallstatus == 1) {
 					/* alerting(1) */
-					subcommand *subcmd;
+					struct subcommand *subcmd;
 
 					pri_message(pri, "Got CT-Complete, callStatus = alerting(1)\n");
 					pri->ev.e = PRI_EVENT_FACILITY;
@@ -3776,8 +3772,9 @@
 
 					subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 					if (subcmd) {
+						struct cmd_redirecting *cmdr = &subcmd->redirecting;
+
 						subcmd->cmd = CMD_REDIRECTING;
-						cmd_redirecting *cmdr = &subcmd->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;
@@ -3795,7 +3792,8 @@
 					pri_message(pri, "illegal value for callStatus=%d\n", c->ctcompletecallstatus);
 				}
 			} else if (c->ctactiveflag) {
-				subcommand *subcmd;
+				struct subcommand *subcmd;
+
 				c->ctactiveflag = 0;
 
 				pri_message(pri, "Got CT-Active\n");
@@ -3805,8 +3803,9 @@
 
 				subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 				if (subcmd) {
+					struct cmd_connectedline *cmdcl = &subcmd->connectedline;
+
 					subcmd->cmd = CMD_CONNECTEDLINE;
-					cmd_connectedline *cmdcl = &subcmd->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;
@@ -3817,7 +3816,8 @@
 				}
 			}
 			else if (c->divleginfo1activeflag) {
-				subcommand *subcmd;
+				struct subcommand *subcmd;
+
 				c->divleginfo1activeflag = 0;
 
 				pri_message(pri, "Got DivertingLegInformation1\n");
@@ -3827,8 +3827,9 @@
 
 				subcmd = get_ptr_subcommand(&pri->ev.facility.subcmds);
 				if (subcmd) {
+					struct cmd_redirecting *cmdr = &subcmd->redirecting;
+
 					subcmd->cmd = CMD_REDIRECTING;
-					cmd_redirecting *cmdr = &subcmd->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;




More information about the svn-commits mailing list