[asterisk-commits] trunk r21479 - /trunk/apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 19 07:14:42 MST 2006


Author: rizzo
Date: Wed Apr 19 09:14:40 2006
New Revision: 21479

URL: http://svn.digium.com/view/asterisk?rev=21479&view=rev
Log:
more simplifications


Modified:
    trunk/apps/app_dial.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?rev=21479&r1=21478&r2=21479&view=diff
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Wed Apr 19 09:14:40 2006
@@ -334,24 +334,12 @@
 }
 
 
-static char *get_cid_name(char *name, int namelen, struct ast_channel *chan)
+static const char *get_cid_name(char *name, int namelen, struct ast_channel *chan)
 {
-	char *context;
-	char *exten;
-	if (!ast_strlen_zero(chan->macrocontext))
-		context = chan->macrocontext;
-	else
-		context = chan->context;
-
-	if (!ast_strlen_zero(chan->macroexten))
-		exten = chan->macroexten;
-	else
-		exten = chan->exten;
-
-	if (ast_get_hint(NULL, 0, name, namelen, chan, context, exten))
-		return name;
-	else
-		return "";
+	const char *context = S_OR(chan->macrocontext, chan->context);
+	const char *exten = S_OR(chan->macroexten, chan->exten);
+
+	return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : "";
 }
 
 static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
@@ -424,7 +412,6 @@
 			return NULL;
 		}
 		winner = ast_waitfor_n(watchers, pos, to);
-		o = outgoing;
 		for (o = outgoing; o; o = o->next) {
 			struct ast_frame *f;
 			struct ast_channel *c = o->chan;



More information about the asterisk-commits mailing list