[asterisk-commits] rmudgett: branch 1.6.1 r160858 - in /branches/1.6.1: ./ funcs/func_callerid.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Dec 3 19:40:52 CST 2008


Author: rmudgett
Date: Wed Dec  3 19:40:51 2008
New Revision: 160858

URL: http://svn.digium.com/view/asterisk?view=rev&rev=160858
Log:
Merged revisions 160854 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r160854 | rmudgett | 2008-12-03 19:14:22 -0600 (Wed, 03 Dec 2008) | 4 lines
  
  *  Found a couple more places where num/number needed to be done
  so 1.4 upgraders will not have problems.
  *  Added curly braces and minor tweaks.
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/funcs/func_callerid.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/funcs/func_callerid.c?view=diff&rev=160858&r1=160857&r2=160858
==============================================================================
--- branches/1.6.1/funcs/func_callerid.c (original)
+++ branches/1.6.1/funcs/func_callerid.c Wed Dec  3 19:40:51 2008
@@ -69,7 +69,8 @@
 			snprintf(buf, len, "\"%s\" <%s>", name, num);
 		} else if (!strncasecmp("name", data, 4)) {
 			ast_copy_string(buf, name, len);
-		} else if (!strncasecmp("num", data, 3)) {
+		} else if (!strncasecmp("num", data, 3)
+			|| !strncasecmp("number", data, 6)) {
 			ast_copy_string(buf, num, len);
 		} else {
 			ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
@@ -85,7 +86,8 @@
 			if (chan->cid.cid_name) {
 				ast_copy_string(buf, chan->cid.cid_name, len);
 			}
-		} else if (!strncasecmp("num", data, 3)) {
+		} else if (!strncasecmp("num", data, 3)
+			|| !strncasecmp("number", data, 6)) {
 			if (chan->cid.cid_num) {
 				ast_copy_string(buf, chan->cid.cid_num, len);
 			}
@@ -129,36 +131,40 @@
 		char name[256];
 		char num[256];
 
-		if (!ast_callerid_split(value, name, sizeof(name), num, sizeof(num))) {
-			ast_set_callerid(chan, num, name, num);
-			if (chan->cdr)
-				ast_cdr_setcid(chan->cdr, chan);
+		ast_callerid_split(value, name, sizeof(name), num, sizeof(num));
+		ast_set_callerid(chan, num, name, num);
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
 		}
 	} else if (!strncasecmp("name", data, 4)) {
 		ast_set_callerid(chan, NULL, value, NULL);
-		if (chan->cdr)
-			ast_cdr_setcid(chan->cdr, chan);
-	} else if (!strncasecmp("num", data, 3) ||
-		   !strncasecmp("number", data, 6)) {
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
+		}
+	} else if (!strncasecmp("num", data, 3)
+		|| !strncasecmp("number", data, 6)) {
 		ast_set_callerid(chan, value, NULL, NULL);
-		if (chan->cdr)
-			ast_cdr_setcid(chan->cdr, chan);
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
+		}
 	} else if (!strncasecmp("ani", data, 3)) {
 		if (!strncasecmp(data + 3, "2", 1)) {
 			chan->cid.cid_ani2 = atoi(value);
 		} else {
 			ast_set_callerid(chan, NULL, NULL, value);
 		}
-		if (chan->cdr)
-			ast_cdr_setcid(chan->cdr, chan);
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
+		}
 	} else if (!strncasecmp("dnid", data, 4)) {
 		ast_channel_lock(chan);
 		if (chan->cid.cid_dnid) {
 			ast_free(chan->cid.cid_dnid);
 		}
 		chan->cid.cid_dnid = ast_strdup(value);
-		if (chan->cdr)
-			ast_cdr_setcid(chan->cdr, chan);
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
+		}
 		ast_channel_unlock(chan);
 	} else if (!strncasecmp("rdnis", data, 5)) {
 		ast_channel_lock(chan);
@@ -166,8 +172,9 @@
 			ast_free(chan->cid.cid_rdnis);
 		}
 		chan->cid.cid_rdnis = ast_strdup(value);
-		if (chan->cdr)
-			ast_cdr_setcid(chan->cdr, chan);
+		if (chan->cdr) {
+			ast_cdr_setcid(chan->cdr, chan);
+		}
 		ast_channel_unlock(chan);
 	} else if (!strncasecmp("pres", data, 4)) {
 		int i;




More information about the asterisk-commits mailing list