diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-12 04:28:58 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-12 04:28:58 +0000 |
commit | 5d9ed5739aab2b302efc178d21e6c75672369db3 (patch) | |
tree | 5c4270c1ac3d265b96361d98722a75b947f2f8c6 /pbx/pbx_dundi.c | |
parent | 9f87dd693e9e74816b913a157fdcdefa3d7a2e56 (diff) |
major dialplan functions update
deprecate LANGUAGE() and MUSICCLASS(), in favor of CHANNEL()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9674 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r-- | pbx/pbx_dundi.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index e80278447..e7667df52 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 1999 - 2005, Digium, Inc. + * Copyright (C) 1999 - 2006, Digium, Inc. * * Mark Spencer <markster@digium.com> * @@ -3837,9 +3837,8 @@ int dundi_query_eid(struct dundi_entity_info *dei, const char *dcontext, dundi_e return dundi_query_eid_internal(dei, dcontext, &eid, &hmd, dundi_ttl, 0, avoid); } -static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) +static int dundifunc_read(struct ast_channel *chan, char *cmd, char *num, char *buf, size_t len) { - char *num; char *context; char *opts; int results; @@ -3852,27 +3851,18 @@ static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, cha buf[0] = '\0'; - if (ast_strlen_zero(data)) { + if (ast_strlen_zero(num)) { ast_log(LOG_WARNING, "DUNDILOOKUP requires an argument (number)\n"); LOCAL_USER_REMOVE(u); - return buf; - } - - num = ast_strdupa(data); - if (!num) { - ast_log(LOG_ERROR, "Out of memory!\n"); - LOCAL_USER_REMOVE(u); - return buf; + return -1; } context = strchr(num, '|'); if (context) { - *context = '\0'; - context++; + *context++ = '\0'; opts = strchr(context, '|'); if (opts) { - *opts = '\0'; - opts++; + *opts++ = '\0'; if (strchr(opts, 'b')) bypass = 1; } @@ -3894,7 +3884,7 @@ static char *dundifunc_read(struct ast_channel *chan, char *cmd, char *data, cha LOCAL_USER_REMOVE(u); - return buf; + return 0; } /*! DUNDILOOKUP |