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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 4 12:28:11 CDT 2009


Author: rmudgett
Date: Thu Jun  4 12:28:04 2009
New Revision: 199124

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199124
Log:
Eliminated the need for some libpri structs that did not add anything useful.

struct pri_subcmd_connected_line
struct pri_subcmd_redirecting

Modified:
    team/group/issue14068/channels/chan_dahdi.c

Modified: team/group/issue14068/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14068/channels/chan_dahdi.c?view=diff&rev=199124&r1=199123&r2=199124
==============================================================================
--- team/group/issue14068/channels/chan_dahdi.c (original)
+++ team/group/issue14068/channels/chan_dahdi.c Thu Jun  4 12:28:04 2009
@@ -12951,44 +12951,44 @@
 			dahdi_pri_lock_owner(pri, chanpos);
 			owner = pri->pvts[chanpos]->owner;
 			if (owner) {
-				struct ast_party_connected_line connected;
-				const struct pri_subcmd_connected_line *cmdcl;
+				struct ast_party_connected_line ast_connected;
+				const struct pri_party_connected_line *pri_connected;
 
 				/* Extract the connected line information */
-				ast_party_connected_line_init(&connected);
-				cmdcl = &subcmd->u.connected_line;
-				if (cmdcl->party.id.name.valid) {
-					connected.id.name = (char *) cmdcl->party.id.name.str;
+				ast_party_connected_line_init(&ast_connected);
+				pri_connected = &subcmd->u.connected_line;
+				if (pri_connected->id.name.valid) {
+					ast_connected.id.name = (char *) pri_connected->id.name.str;
 
 					/* Save for Caller-ID update */
 					ast_copy_string(pri->pvts[chanpos]->lastcid_name,
-						cmdcl->party.id.name.str,
+						pri_connected->id.name.str,
 						sizeof(pri->pvts[chanpos]->lastcid_name));
 					pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
 				}
-				if (cmdcl->party.id.number.valid) {
-					connected.id.number = (char *) cmdcl->party.id.number.str;
-					connected.id.number_type = cmdcl->party.id.number.plan;
+				if (pri_connected->id.number.valid) {
+					ast_connected.id.number = (char *) pri_connected->id.number.str;
+					ast_connected.id.number_type = pri_connected->id.number.plan;
 
 					/* Save for Caller-ID update */
 					ast_copy_string(pri->pvts[chanpos]->lastcid_num,
-						cmdcl->party.id.number.str,
+						pri_connected->id.number.str,
 						sizeof(pri->pvts[chanpos]->lastcid_num));
 					pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
 				} else {
-					connected.id.number = "";
-				}
-				if (cmdcl->party.id.name.valid
-					|| cmdcl->party.id.number.valid) {
-					connected.id.number_presentation =
-						overall_ast_presentation(&cmdcl->party.id);
-				}
-				connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
+					ast_connected.id.number = "";
+				}
+				if (pri_connected->id.name.valid
+					|| pri_connected->id.number.valid) {
+					ast_connected.id.number_presentation =
+						overall_ast_presentation(&pri_connected->id);
+				}
+				ast_connected.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
 
 				/* Update the connected line information on the other channel */
 				if (event_id != PRI_EVENT_RING) {
 					/* This connected_line update was not from a SETUP message. */
-					ast_channel_queue_connected_line_update(owner, &connected);
+					ast_channel_queue_connected_line_update(owner, &ast_connected);
 				}
 
 				ast_channel_unlock(owner);
@@ -12998,50 +12998,51 @@
 			dahdi_pri_lock_owner(pri, chanpos);
 			owner = pri->pvts[chanpos]->owner;
 			if (owner) {
-				struct ast_party_redirecting redirecting;
-				const struct pri_subcmd_redirecting *cmdr;
-
-				ast_party_redirecting_set_init(&redirecting, &owner->redirecting);
-
-				cmdr = &subcmd->u.redirecting;
-
-				/* redirecting.from */
-				if (cmdr->party.from.name.valid) {
-					redirecting.from.name = (char *) cmdr->party.from.name.str;
-				}
-				if (cmdr->party.from.number.valid) {
-					redirecting.from.number = (char *) cmdr->party.from.number.str;
-					redirecting.from.number_type = cmdr->party.from.number.plan;
-				}
-				if (cmdr->party.from.name.valid
-					|| cmdr->party.from.number.valid) {
-					redirecting.from.number_presentation =
-						overall_ast_presentation(&cmdr->party.from);
-				}
-
-				/* redirecting.to */
-				if (cmdr->party.to.name.valid) {
-					redirecting.to.name = (char *) cmdr->party.to.name.str;
-				}
-				if (cmdr->party.to.number.valid) {
-					redirecting.to.number = (char *) cmdr->party.to.number.str;
-					redirecting.to.number_type = cmdr->party.to.number.plan;
-				}
-				if (cmdr->party.to.name.valid
-					|| cmdr->party.to.number.valid) {
-					redirecting.to.number_presentation =
-						overall_ast_presentation(&cmdr->party.from);
-				}
-
-				redirecting.count = cmdr->party.count;
-				redirecting.reason = pri_to_ast_reason(cmdr->party.reason);
+				struct ast_party_redirecting ast_redirecting;
+				const struct pri_party_redirecting *pri_redirecting;
+
+				ast_party_redirecting_set_init(&ast_redirecting, &owner->redirecting);
+
+				pri_redirecting = &subcmd->u.redirecting;
+
+				/* ast_redirecting.from */
+				if (pri_redirecting->from.name.valid) {
+					ast_redirecting.from.name = (char *) pri_redirecting->from.name.str;
+				}
+				if (pri_redirecting->from.number.valid) {
+					ast_redirecting.from.number =
+						(char *) pri_redirecting->from.number.str;
+					ast_redirecting.from.number_type = pri_redirecting->from.number.plan;
+				}
+				if (pri_redirecting->from.name.valid
+					|| pri_redirecting->from.number.valid) {
+					ast_redirecting.from.number_presentation =
+						overall_ast_presentation(&pri_redirecting->from);
+				}
+
+				/* ast_redirecting.to */
+				if (pri_redirecting->to.name.valid) {
+					ast_redirecting.to.name = (char *) pri_redirecting->to.name.str;
+				}
+				if (pri_redirecting->to.number.valid) {
+					ast_redirecting.to.number = (char *) pri_redirecting->to.number.str;
+					ast_redirecting.to.number_type = pri_redirecting->to.number.plan;
+				}
+				if (pri_redirecting->to.name.valid
+					|| pri_redirecting->to.number.valid) {
+					ast_redirecting.to.number_presentation =
+						overall_ast_presentation(&pri_redirecting->from);
+				}
+
+				ast_redirecting.count = pri_redirecting->count;
+				ast_redirecting.reason = pri_to_ast_reason(pri_redirecting->reason);
 
 /*! \todo XXX Original called data can be put in a channel data store that is inherited. */
 
-				ast_channel_set_redirecting(owner, &redirecting);
+				ast_channel_set_redirecting(owner, &ast_redirecting);
 				if (event_id != PRI_EVENT_RING) {
 					/* This redirection was not from a SETUP message. */
-					ast_channel_queue_redirecting_update(owner, &redirecting);
+					ast_channel_queue_redirecting_update(owner, &ast_redirecting);
 				}
 
 				ast_channel_unlock(owner);




More information about the svn-commits mailing list