diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-30 20:15:36 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-11-30 20:15:36 +0000 |
commit | 5dcfa0427f6ab7145a590cd2d0db29a84a04ae06 (patch) | |
tree | b3eb56f7f2f0d55852432e62c9e4bd8810022033 /apps/app_chanisavail.c | |
parent | d3eab04fc9c9ba366166bbbdfc19775d862eedda (diff) |
use app arg parsing macros (issue #5678)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7239 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanisavail.c')
-rw-r--r-- | apps/app_chanisavail.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/apps/app_chanisavail.c b/apps/app_chanisavail.c index c55bb8ecb..3ac603f71 100644 --- a/apps/app_chanisavail.c +++ b/apps/app_chanisavail.c @@ -70,8 +70,12 @@ static int chanavail_exec(struct ast_channel *chan, void *data) 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 @@ static int chanavail_exec(struct ast_channel *chan, void *data) 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 { |