summaryrefslogtreecommitdiff
path: root/funcs/func_enum.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2011-08-09 17:08:33 +0000
committerKinsey Moore <kmoore@digium.com>2011-08-09 17:08:33 +0000
commitc3bd5892a66db3391c55465d16bf121c736beb80 (patch)
treef05ed6896dbcecd448745d2a7011895d40e9a245 /funcs/func_enum.c
parent5fe104ddb9cf4b19513c7fb78f3b4e282e8e519e (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 'funcs/func_enum.c')
-rw-r--r--funcs/func_enum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/funcs/func_enum.c b/funcs/func_enum.c
index cc4d47a78..4b5fb9f7b 100644
--- a/funcs/func_enum.c
+++ b/funcs/func_enum.c
@@ -82,7 +82,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<para>The number of the result that you want to retrieve.</para>
<para>Results start at <literal>1</literal>. If this argument is specified
as <literal>getnum</literal>, then it will return the total number of results
- that are available.</para>
+ that are available or -1 on error.</para>
</parameter>
</syntax>
<description>
@@ -105,7 +105,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
<option name="c">
<para>Returns an integer count of the number of NAPTRs of a certain RR type.</para>
<para>Combination of <literal>c</literal> and Method-type of <literal>ALL</literal> will
- return a count of all NAPTRs for the record.</para>
+ return a count of all NAPTRs for the record or -1 on error.</para>
</option>
<option name="u">
<para>Returns the full URI and does not strip off the URI-scheme.</para>
@@ -363,7 +363,7 @@ static int enum_result_read(struct ast_channel *chan, const char *cmd, char *dat
erds = datastore->data;
if (!strcasecmp(args.resultnum, "getnum")) {
- snprintf(buf, len, "%u", erds->context->naptr_rrs_count);
+ snprintf(buf, len, "%d", erds->context->naptr_rrs_count);
res = 0;
goto finish;
}