[asterisk-commits] trunk - r7239 /trunk/apps/app_chanisavail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 30 14:15:39 CST 2005


Author: russell
Date: Wed Nov 30 14:15:36 2005
New Revision: 7239

URL: http://svn.digium.com/view/asterisk?rev=7239&view=rev
Log:
use app arg parsing macros (issue #5678)

Modified:
    trunk/apps/app_chanisavail.c

Modified: trunk/apps/app_chanisavail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanisavail.c?rev=7239&r1=7238&r2=7239&view=diff
==============================================================================
--- trunk/apps/app_chanisavail.c (original)
+++ trunk/apps/app_chanisavail.c Wed Nov 30 14:15:36 2005
@@ -70,8 +70,12 @@
 	int res=-1, inuse=-1, option_state=0, priority_jump=0;
 	int status;
 	struct localuser *u;
-	char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur, *options, *stringp;
+	char *info, tmp[512], trychan[512], *peers, *tech, *number, *rest, *cur;
 	struct ast_channel *tempchan;
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(reqchans);
+		AST_APP_ARG(options);
+	);
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "ChanIsAvail requires an argument (Zap/1&Zap/2)\n");
@@ -81,16 +85,16 @@
 	LOCAL_USER_ADD(u);
 
 	info = ast_strdupa(data); 
-	stringp = info;
-	strsep(&stringp, "|");
-	options = strsep(&stringp, "|");
-	if (options) {
-		if (strchr(options, 's'))
+
+	AST_STANDARD_APP_ARGS(args, info);
+
+	if (args.options) {
+		if (strchr(args.options, 's'))
 			option_state = 1;
-		if (strchr(options, 'j'))
+		if (strchr(args.options, 'j'))
 			priority_jump = 1;
 	}
-	peers = info;
+	peers = args.reqchans;
 	if (peers) {
 		cur = peers;
 		do {



More information about the asterisk-commits mailing list