[asterisk-commits] rmudgett: branch group/issue14068 r199783 - /team/group/issue14068/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 9 13:17:18 CDT 2009


Author: rmudgett
Date: Tue Jun  9 13:17:14 2009
New Revision: 199783

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199783
Log:
Add dial plan prefix to connected_line, redirecting to and from numbers.

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=199783&r1=199782&r2=199783
==============================================================================
--- team/group/issue14068/channels/chan_dahdi.c (original)
+++ team/group/issue14068/channels/chan_dahdi.c Tue Jun  9 13:17:14 2009
@@ -12975,6 +12975,7 @@
 			if (owner) {
 				struct ast_party_connected_line ast_connected;
 				const struct pri_party_connected_line *pri_connected;
+				char connected_number[AST_MAX_EXTENSION];
 
 				/* Extract the connected line information */
 				ast_party_connected_line_init(&ast_connected);
@@ -12982,19 +12983,21 @@
 				if (pri_connected->id.name.valid) {
 					ast_connected.id.name = (char *) pri_connected->id.name.str;
 
-					/* Save for Caller-ID update */
+					/* Save name for Caller-ID update */
 					ast_copy_string(pri->pvts[chanpos]->lastcid_name,
 						pri_connected->id.name.str,
 						sizeof(pri->pvts[chanpos]->lastcid_name));
 					pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
 				}
 				if (pri_connected->id.number.valid) {
-					ast_connected.id.number = (char *) pri_connected->id.number.str;
+					apply_plan_to_number(connected_number, sizeof(connected_number), pri,
+						pri_connected->id.number.str,
+						pri_connected->id.number.plan);
+					ast_connected.id.number = connected_number;
 					ast_connected.id.number_type = pri_connected->id.number.plan;
 
-					/* Save for Caller-ID update */
-					ast_copy_string(pri->pvts[chanpos]->lastcid_num,
-						pri_connected->id.number.str,
+					/* Save number for Caller-ID update */
+					ast_copy_string(pri->pvts[chanpos]->lastcid_num, connected_number,
 						sizeof(pri->pvts[chanpos]->lastcid_num));
 					pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
 				} else {
@@ -13022,6 +13025,8 @@
 			if (owner) {
 				struct ast_party_redirecting ast_redirecting;
 				const struct pri_party_redirecting *pri_redirecting;
+				char from_number[AST_MAX_EXTENSION];
+				char to_number[AST_MAX_EXTENSION];
 
 				ast_party_redirecting_set_init(&ast_redirecting, &owner->redirecting);
 
@@ -13032,8 +13037,10 @@
 					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;
+					apply_plan_to_number(from_number, sizeof(from_number), pri,
+						pri_redirecting->from.number.str,
+						pri_redirecting->from.number.plan);
+					ast_redirecting.from.number = from_number;
 					ast_redirecting.from.number_type = pri_redirecting->from.number.plan;
 				}
 				if (pri_redirecting->from.name.valid
@@ -13047,7 +13054,9 @@
 					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;
+					apply_plan_to_number(to_number, sizeof(to_number), pri,
+						pri_redirecting->to.number.str, pri_redirecting->to.number.plan);
+					ast_redirecting.to.number = to_number;
 					ast_redirecting.to.number_type = pri_redirecting->to.number.plan;
 				}
 				if (pri_redirecting->to.name.valid




More information about the asterisk-commits mailing list