Index: asterisk-trunk/main/enum.c =================================================================== --- asterisk-trunk/main/enum.c (revision 357655) +++ asterisk-trunk/main/enum.c (working copy) @@ -922,8 +922,6 @@ { struct txt_context context; char tmp[259 + 512]; - int pos = strlen(number) - 1; - int newpos = 0; int ret = -1; ast_debug(4, "ast_get_txt: Number = '%s', suffix = '%s'\n", number, suffix); @@ -932,20 +930,12 @@ return -1; } - if (pos > 128) { - pos = 128; - } + snprintf(tmp, sizeof(tmp), "%s.%s.", number, suffix); - while (pos >= 0) { - if (isdigit(number[pos])) { - tmp[newpos++] = number[pos]; - tmp[newpos++] = '.'; - } - pos--; - } - - ast_copy_string(&tmp[newpos], suffix, sizeof(tmp) - newpos); - + context.txt[0] = 0; + txt[0] = 0; + + ret = ast_search_dns(&context, tmp, C_IN, T_TXT, txt_callback); if (ret < 0) { ast_debug(2, "No such number found in ENUM: %s (%s)\n", tmp, strerror(errno)); ret = 0;