[asterisk-commits] file: trunk r67063 - /trunk/apps/app_directed_pickup.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jun 4 10:32:42 MST 2007


Author: file
Date: Mon Jun  4 12:32:41 2007
New Revision: 67063

URL: http://svn.digium.com/view/asterisk?view=rev&rev=67063
Log:
Minor clean up. Constify a few variables and use ast_strlen_zero in a few places.

Modified:
    trunk/apps/app_directed_pickup.c

Modified: trunk/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_directed_pickup.c?view=diff&rev=67063&r1=67062&r2=67063
==============================================================================
--- trunk/apps/app_directed_pickup.c (original)
+++ trunk/apps/app_directed_pickup.c Mon Jun  4 12:32:41 2007
@@ -90,7 +90,7 @@
 }
 
 /* Attempt to pick up specified extension with context */
-static int pickup_by_exten(struct ast_channel *chan, char *exten, char *context)
+static int pickup_by_exten(struct ast_channel *chan, const char *exten, const char *context)
 {
 	int res = -1;
 	struct ast_channel *target = NULL;
@@ -110,7 +110,7 @@
 }
 
 /* Attempt to pick up specified mark */
-static int pickup_by_mark(struct ast_channel *chan, char *mark)
+static int pickup_by_mark(struct ast_channel *chan, const char *mark)
 {
 	int res = -1;
 	const char *tmp = NULL;
@@ -149,11 +149,11 @@
 	while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
 		if ((context = strchr(exten, '@')))
 			*context++ = '\0';
-		if (context && !strcasecmp(context, PICKUPMARK)) {
+		if (!ast_strlen_zero(context) && !strcasecmp(context, PICKUPMARK)) {
 			if (!pickup_by_mark(chan, exten))
 				break;
 		} else {
-			if (!pickup_by_exten(chan, exten, context ? context : chan->context))
+			if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : chan->context))
 				break;
 		}
 		ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);



More information about the asterisk-commits mailing list