mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 14:44:28 +00:00
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
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user