diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-14 01:36:15 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-09-14 01:36:15 +0000 |
commit | fa8ea94c177025426ad5429a3737e0b8aae6363f (patch) | |
tree | d4b59476a3096555262c97b7b28dc1fb6737c2eb /apps/app_enumlookup.c | |
parent | 06e6b25ca44f1612b599b7f89d33367be9bd72b5 (diff) |
extensive ENUM support update, including ENUMLOOKUP() dialplan function (issue #5201 with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6579 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_enumlookup.c')
-rwxr-xr-x | apps/app_enumlookup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_enumlookup.c b/apps/app_enumlookup.c index aea6b9c03..6a9142005 100755 --- a/apps/app_enumlookup.c +++ b/apps/app_enumlookup.c @@ -38,7 +38,7 @@ static char *app = "EnumLookup"; static char *synopsis = "Lookup number in ENUM"; -static char *descrip = +static char *descrip = " EnumLookup(exten): Looks up an extension via ENUM and sets\n" "the variable 'ENUM'. For VoIP URIs this variable will \n" "look like 'TECHNOLOGY/URI' with the appropriate technology.\n" @@ -71,6 +71,9 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) char dest[80]; char tmp[256]; char *c,*t; + + tech[0] = '\0'; + struct localuser *u; if (!data || ast_strlen_zero(data)) { @@ -79,7 +82,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) } LOCAL_USER_ADD(u); if (!res) { - res = ast_get_enum(chan, data, dest, sizeof(dest), tech, sizeof(tech)); + res = ast_get_enum(chan, data, dest, sizeof(dest), tech, sizeof(tech), NULL, NULL); printf("ENUM got '%d'\n", res); } LOCAL_USER_REMOVE(u); @@ -105,7 +108,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) snprintf(tmp, sizeof(tmp), "%s/%s", h323driver, c); /* do a s!;.*!! on the H323 URI */ t = strchr(c,';'); - if (t) + if (t) *t = 0; pbx_builtin_setvar_helper(chan, "ENUM", tmp); } else if (!strcasecmp(tech, "iax")) { @@ -130,7 +133,7 @@ static int enumlookup_exec(struct ast_channel *chan, void *data) res = 0; } else { /* now copy over the number, skipping all non-digits and stop at ; or NULL */ - t = tmp; + t = tmp; while( *c && (*c != ';') && (t - tmp < (sizeof(tmp) - 1))) { if (isdigit(*c)) *t++ = *c; |