[asterisk-commits] rmudgett: branch rmudgett/cid r264625 - in /team/rmudgett/cid: channels/ incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 20 12:22:13 CDT 2010


Author: rmudgett
Date: Thu May 20 12:22:10 2010
New Revision: 264625

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=264625
Log:
Move ast_channel.cid.cid_ani to ast_channel.caller.ani.
Move ast_channel.cid.cid_ani2 to ast_channel.caller.ani2.

Modified:
    team/rmudgett/cid/channels/chan_dahdi.c
    team/rmudgett/cid/channels/chan_iax2.c
    team/rmudgett/cid/channels/chan_jingle.c
    team/rmudgett/cid/channels/chan_mgcp.c
    team/rmudgett/cid/channels/chan_misdn.c
    team/rmudgett/cid/channels/chan_oss.c
    team/rmudgett/cid/channels/chan_phone.c
    team/rmudgett/cid/channels/chan_skinny.c
    team/rmudgett/cid/channels/chan_usbradio.c
    team/rmudgett/cid/channels/chan_vpb.cc
    team/rmudgett/cid/channels/sig_analog.c
    team/rmudgett/cid/include/asterisk/channel.h
    team/rmudgett/cid/main/cdr.c
    team/rmudgett/cid/main/pbx.c
    team/rmudgett/cid/tests/test_substitution.c

Modified: team/rmudgett/cid/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_dahdi.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_dahdi.c (original)
+++ team/rmudgett/cid/channels/chan_dahdi.c Thu May 20 12:22:10 2010
@@ -7989,8 +7989,11 @@
 		case SIG_FEATDMF_TA:
 			switch (p->whichwink) {
 			case 0:
-				ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->cid.cid_ani2, p->owner->cid.cid_ani);
-				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#", p->owner->cid.cid_ani2, p->owner->cid.cid_ani);
+				ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->caller.ani2,
+					S_OR(p->owner->caller.ani, ""));
+				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#",
+					p->owner->caller.ani2,
+					S_OR(p->owner->caller.ani, ""));
 				break;
 			case 1:
 				ast_copy_string(p->dop.dialstr, p->finaldial, sizeof(p->dop.dialstr));

Modified: team/rmudgett/cid/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_iax2.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_iax2.c (original)
+++ team/rmudgett/cid/channels/chan_iax2.c Thu May 20 12:22:10 2010
@@ -5548,10 +5548,11 @@
 		ast_string_field_set(tmp, parkinglot, i->parkinglot);
 	/* Don't use ast_set_callerid() here because it will
 	 * generate a NewCallerID event before the NewChannel event */
-	if (!ast_strlen_zero(i->ani))
-		tmp->cid.cid_ani = ast_strdup(i->ani);
-	else
-		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	if (!ast_strlen_zero(i->ani)) {
+		tmp->caller.ani = ast_strdup(i->ani);
+	} else {
+		tmp->caller.ani = ast_strdup(i->cid_num);
+	}
 	tmp->dialed.number.str = ast_strdup(i->dnid);
 	tmp->redirecting.from.XXX_number.valid = 1;
 	tmp->redirecting.from.XXX_number.str = ast_strdup(i->rdnis);

Modified: team/rmudgett/cid/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_jingle.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_jingle.c (original)
+++ team/rmudgett/cid/channels/chan_jingle.c Thu May 20 12:22:10 2010
@@ -859,7 +859,7 @@
 	ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
 	/* Don't use ast_set_callerid() here because it will
 	 * generate an unnecessary NewCallerID event  */
-	tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	tmp->caller.ani = ast_strdup(i->cid_num);
 	if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) {
 		tmp->dialed.number.str = ast_strdup(i->exten);
 	}

Modified: team/rmudgett/cid/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_mgcp.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_mgcp.c (original)
+++ team/rmudgett/cid/channels/chan_mgcp.c Thu May 20 12:22:10 2010
@@ -1533,7 +1533,7 @@
 
 		/* Don't use ast_set_callerid() here because it will
 		 * generate a needless NewCallerID event */
-		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+		tmp->caller.ani = ast_strdup(i->cid_num);
 
 		if (!i->adsi) {
 			tmp->adsicpe = AST_ADSI_UNAVAILABLE;
@@ -2973,7 +2973,7 @@
 					ast_set_callerid(chan,
 						p->hidecallerid ? "" : p->cid_num,
 						p->hidecallerid ? "" : p->cid_name,
-						chan->cid.cid_ani ? NULL : p->cid_num);
+						chan->caller.ani ? NULL : p->cid_num);
 					ast_setstate(chan, AST_STATE_RING);
 					/*dahdi_enable_ec(p);*/
 					if (p->dtmfmode & MGCP_DTMF_HYBRID) {

Modified: team/rmudgett/cid/channels/chan_misdn.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_misdn.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_misdn.c (original)
+++ team/rmudgett/cid/channels/chan_misdn.c Thu May 20 12:22:10 2010
@@ -7925,7 +7925,7 @@
 		if (callerid) {
 			/* Don't use ast_set_callerid() here because it will
 			 * generate a needless NewCallerID event */
-			tmp->cid.cid_ani = ast_strdup(cid_num);
+			tmp->caller.ani = ast_strdup(cid_num);
 		}
 
 		if (pipe(chlist->pipe) < 0) {

Modified: team/rmudgett/cid/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_oss.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_oss.c (original)
+++ team/rmudgett/cid/channels/chan_oss.c Thu May 20 12:22:10 2010
@@ -807,7 +807,7 @@
 		ast_string_field_set(c, language, o->language);
 	/* Don't use ast_set_callerid() here because it will
 	 * generate a needless NewCallerID event */
-	c->cid.cid_ani = ast_strdup(o->cid_num);
+	c->caller.ani = ast_strdup(o->cid_num);
 	if (!ast_strlen_zero(ext)) {
 		c->dialed.number.str = ast_strdup(ext);
 	}

Modified: team/rmudgett/cid/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_phone.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_phone.c (original)
+++ team/rmudgett/cid/channels/chan_phone.c Thu May 20 12:22:10 2010
@@ -888,7 +888,7 @@
 
 		/* Don't use ast_set_callerid() here because it will
 		 * generate a NewCallerID event before the NewChannel event */
-		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+		tmp->caller.ani = ast_strdup(i->cid_num);
 
 		i->owner = tmp;
 		ast_module_ref(ast_module_info->self);

Modified: team/rmudgett/cid/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_skinny.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_skinny.c (original)
+++ team/rmudgett/cid/channels/chan_skinny.c Thu May 20 12:22:10 2010
@@ -3768,7 +3768,7 @@
 	ast_set_callerid(c,
 		l->hidecallerid ? "" : l->cid_num,
 		l->hidecallerid ? "" : l->cid_name,
-		c->cid.cid_ani ? NULL : l->cid_num);
+		c->caller.ani ? NULL : l->cid_num);
 #if 1	/* XXX This code is probably not necessary */
 	ast_party_number_free(&c->connected.id.XXX_number);
 	ast_party_number_init(&c->connected.id.XXX_number);
@@ -4564,7 +4564,7 @@
 
 		/* Don't use ast_set_callerid() here because it will
 		 * generate a needless NewCallerID event */
-		tmp->cid.cid_ani = ast_strdup(l->cid_num);
+		tmp->caller.ani = ast_strdup(l->cid_num);
 
 		tmp->priority = 1;
 		tmp->adsicpe = AST_ADSI_UNAVAILABLE;

Modified: team/rmudgett/cid/channels/chan_usbradio.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_usbradio.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_usbradio.c (original)
+++ team/rmudgett/cid/channels/chan_usbradio.c Thu May 20 12:22:10 2010
@@ -2203,7 +2203,7 @@
 	/* Don't use ast_set_callerid() here because it will
 	 * generate a needless NewCallerID event */
 	c->cid.cid_num = ast_strdup(o->cid_num);
-	c->cid.cid_ani = ast_strdup(o->cid_num);
+	c->caller.ani = ast_strdup(o->cid_num);
 	c->cid.cid_name = ast_strdup(o->cid_name);
 	if (!ast_strlen_zero(ext)) {
 		c->dialed.number.str = ast_strdup(ext);

Modified: team/rmudgett/cid/channels/chan_vpb.cc
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/chan_vpb.cc?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/chan_vpb.cc (original)
+++ team/rmudgett/cid/channels/chan_vpb.cc Thu May 20 12:22:10 2010
@@ -790,7 +790,7 @@
 		ast_shrink_phone_number(number);
 	ast_set_callerid(owner,
 		number, name,
-		owner->cid.cid_ani ? NULL : number);
+		owner->caller.ani ? NULL : number);
 	if (!ast_strlen_zero(name)){
 		snprintf(p->callerid, sizeof(p->callerid), "%s %s", number, name);
 	} else {

Modified: team/rmudgett/cid/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/channels/sig_analog.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/channels/sig_analog.c (original)
+++ team/rmudgett/cid/channels/sig_analog.c Thu May 20 12:22:10 2010
@@ -3038,8 +3038,11 @@
 		case ANALOG_SIG_FEATDMF_TA:
 			switch (p->whichwink) {
 			case 0:
-				ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->cid.cid_ani2, p->owner->cid.cid_ani);
-				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#", p->owner->cid.cid_ani2, p->owner->cid.cid_ani);
+				ast_debug(1, "ANI2 set to '%d' and ANI is '%s'\n", p->owner->caller.ani2,
+					S_OR(p->owner->caller.ani, ""));
+				snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "M*%d%s#",
+					p->owner->caller.ani2,
+					S_OR(p->owner->caller.ani, ""));
 				break;
 			case 1:
 				ast_copy_string(p->dop.dialstr, p->finaldial, sizeof(p->dop.dialstr));

Modified: team/rmudgett/cid/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/include/asterisk/channel.h?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/include/asterisk/channel.h (original)
+++ team/rmudgett/cid/include/asterisk/channel.h Thu May 20 12:22:10 2010
@@ -310,22 +310,10 @@
 	char *cid_name;
 
 	/*!
-	 * \brief Malloc'd Automatic Number Identification (ANI)
-	 * (Field will eventually move to struct ast_channel.caller.ani)
-	 */
-	char *cid_ani;
-
-	/*!
 	 * \brief Callerid Q.931 encoded number presentation/screening fields
 	 * (Field will eventually move to struct ast_channel.caller.id.number_presentation)
 	 */
 	int cid_pres;
-
-	/*!
-	 * \brief Callerid ANI 2 (Info digits)
-	 * (Field will eventually move to struct ast_channel.caller.ani2)
-	 */
-	int cid_ani2;
 };
 
 /*!

Modified: team/rmudgett/cid/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/cdr.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/main/cdr.c (original)
+++ team/rmudgett/cid/main/cdr.c Thu May 20 12:22:10 2010
@@ -846,7 +846,7 @@
 static void set_one_cid(struct ast_cdr *cdr, struct ast_channel *c)
 {
 	/* Grab source from ANI or normal Caller*ID */
-	const char *num = S_OR(c->cid.cid_ani, c->cid.cid_num);
+	const char *num = S_OR(c->caller.ani, c->cid.cid_num);
 	if (!cdr)
 		return;
 	if (!ast_strlen_zero(c->cid.cid_name)) {

Modified: team/rmudgett/cid/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/main/pbx.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/main/pbx.c (original)
+++ team/rmudgett/cid/main/pbx.c Thu May 20 12:22:10 2010
@@ -3014,7 +3014,7 @@
 					ast_str_set(str, maxlen, "%d", c->cid.cid_pres);
 					s = ast_str_buffer(*str);
 				} else if (!strcmp(var + 7, "ANI2")) {		/* CALLINGANI2 */
-					ast_str_set(str, maxlen, "%d", c->cid.cid_ani2);
+					ast_str_set(str, maxlen, "%d", c->caller.ani2);
 					s = ast_str_buffer(*str);
 				} else if (!strcmp(var + 7, "TON")) {		/* CALLINGTON */
 					ast_str_set(str, maxlen, "%d", c->caller.id.XXX_number.plan);

Modified: team/rmudgett/cid/tests/test_substitution.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/cid/tests/test_substitution.c?view=diff&rev=264625&r1=264624&r2=264625
==============================================================================
--- team/rmudgett/cid/tests/test_substitution.c (original)
+++ team/rmudgett/cid/tests/test_substitution.c Thu May 20 12:22:10 2010
@@ -221,7 +221,7 @@
 
 #define TEST(t) if (t == AST_TEST_FAIL) { res = AST_TEST_FAIL; }
 	TEST(test_chan_integer(test, c, &c->cid.cid_pres, "${CALLINGPRES}"));
-	TEST(test_chan_integer(test, c, &c->cid.cid_ani2, "${CALLINGANI2}"));
+	TEST(test_chan_integer(test, c, &c->caller.ani2, "${CALLINGANI2}"));
 	TEST(test_chan_integer(test, c, &c->caller.id.XXX_number.plan, "${CALLINGTON}"));
 	TEST(test_chan_integer(test, c, &c->dialed.transit_network_select, "${CALLINGTNS}"));
 	TEST(test_chan_integer(test, c, &c->hangupcause, "${HANGUPCAUSE}"));




More information about the asterisk-commits mailing list