[asterisk-commits] mattf: trunk r85498 - /trunk/funcs/func_callerid.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 11 17:33:57 CDT 2007


Author: mattf
Date: Thu Oct 11 17:33:57 2007
New Revision: 85498

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85498
Log:
See if I can fix this borked ANI2 code I added

Modified:
    trunk/funcs/func_callerid.c

Modified: trunk/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_callerid.c?view=diff&rev=85498&r1=85497&r2=85498
==============================================================================
--- trunk/funcs/func_callerid.c (original)
+++ trunk/funcs/func_callerid.c Thu Oct 11 17:33:57 2007
@@ -92,7 +92,9 @@
 				ast_copy_string(buf, chan->cid.cid_num, len);
 			}
 		} else if (!strncasecmp("ani", data, 3)) {
-			if (chan->cid.cid_ani) {
+			if (!strncasecmp(data + 3, "2", 1)) {
+				snprintf(buf, len, "%d", chan->cid.cid_ani2);
+			} else if (chan->cid.cid_ani) {
 				ast_copy_string(buf, chan->cid.cid_ani, len);
 			}
 		} else if (!strncasecmp("dnid", data, 4)) {
@@ -107,8 +109,6 @@
 			ast_copy_string(buf, ast_named_caller_presentation(chan->cid.cid_pres), len);
 		} else if (!strncasecmp("ton", data, 3)) {
 			snprintf(buf, len, "%d", chan->cid.cid_ton);
-		} else if (!strncasecmp("ani2", data, 4)) {
-			snprintf(buf, len, "%d", chan->cid.cid_ani2);
 		} else {
 			ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
 		}
@@ -134,7 +134,11 @@
 	} else if (!strncasecmp("num", data, 3)) { 
 		ast_set_callerid(chan, value, NULL, NULL);
 	} else if (!strncasecmp("ani", data, 3)) {
-		ast_set_callerid(chan, NULL, NULL, value);
+		if (!strncasecmp(data + 3, "2", 1)) {
+			int i = atoi(value);
+			chan->cid.cid_ani2 = i;
+		} else
+			ast_set_callerid(chan, NULL, NULL, value);
 	} else if (!strncasecmp("dnid", data, 4)) {
 		/* do we need to lock chan here? */
 		if (chan->cid.cid_dnid)
@@ -173,9 +177,6 @@
 	} else if (!strncasecmp("ton", data, 3)) {
 		int i = atoi(value);
 		chan->cid.cid_ton = i;
-	} else if (!strncasecmp("ani2", data, 4)) {
-		int i = atoi(value);
-		chan->cid.cid_ani2 = i;
 	} else {
 		ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
 	}




More information about the asterisk-commits mailing list