diff options
author | Kinsey Moore <kmoore@digium.com> | 2011-08-09 17:08:33 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2011-08-09 17:08:33 +0000 |
commit | c3bd5892a66db3391c55465d16bf121c736beb80 (patch) | |
tree | f05ed6896dbcecd448745d2a7011895d40e9a245 /main | |
parent | 5fe104ddb9cf4b19513c7fb78f3b4e282e8e519e (diff) |
Allow ENUM query functions to report lookup errors
The ENUM dialplan functions do not report DNS query errors properly. It is
useful to differentiate between failed query (e.g. non-existent domain) vs. no
data records of the appropriate type. This is required to make overlapped
dialing work.
(closes issue ASTERISK-13769)
Review: https://reviewboard.asterisk.org/r/1355/
Patch-by: Timo Teras
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/enum.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/enum.c b/main/enum.c index 92f185c60..aace1fce0 100644 --- a/main/enum.c +++ b/main/enum.c @@ -856,6 +856,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds if (ret < 0) { ast_debug(1, "No such number found: %s (%s)\n", tmp, strerror(errno)); + context->naptr_rrs_count = -1; strcpy(dst, "0"); ret = 0; } @@ -896,7 +897,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds } else if (!(context->options & ENUMLOOKUP_OPTIONS_COUNT)) { context->dst[0] = 0; } else if ((context->options & ENUMLOOKUP_OPTIONS_COUNT)) { - snprintf(context->dst, context->dstlen, "%d", context->count); + snprintf(context->dst, context->dstlen, "%d", context->naptr_rrs_count + context->count); } if (chan) { |