From c4a61b70d3194fe0cf90e5945bb83842fec96c28 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Wed, 11 Mar 2009 17:57:15 +0200 Subject: testing/asterisk: initial commit it puts everything to a big monster .apk. a lot of work is still needed to split it into approriate sub packages and test them. but this is a good starting point. --- testing/asterisk/asterisk-06-overlapped-enum.patch | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 testing/asterisk/asterisk-06-overlapped-enum.patch (limited to 'testing/asterisk/asterisk-06-overlapped-enum.patch') diff --git a/testing/asterisk/asterisk-06-overlapped-enum.patch b/testing/asterisk/asterisk-06-overlapped-enum.patch new file mode 100644 index 000000000..a040b6c76 --- /dev/null +++ b/testing/asterisk/asterisk-06-overlapped-enum.patch @@ -0,0 +1,78 @@ +Index: funcs/func_enum.c +=================================================================== +--- a/funcs/func_enum.c (revision 180682) ++++ b/funcs/func_enum.c (working copy) +@@ -78,7 +78,7 @@ + The number of the result that you want to retrieve. + Results start at 1. If this argument is specified + as getnum, then it will return the total number of results +- that are available. ++ that are available or -1 on error. + + + +@@ -360,7 +360,7 @@ + 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; + } +Index: main/dns.c +=================================================================== +--- a/main/dns.c (revision 180682) ++++ b/main/dns.c (working copy) +@@ -36,6 +36,7 @@ + #include "asterisk/network.h" + #include /* res_* functions */ + #include ++#include + + #include "asterisk/channel.h" + #include "asterisk/dns.h" +@@ -280,6 +281,20 @@ + ret = 0; + } else + ret = 1; ++ } else { ++#ifdef HAVE_RES_NINIT ++ res = dnsstate.res_h_errno; ++ ast_debug(1, "dnsstate.res_h_errno: %d\n", res); ++ ast_log(LOG_WARNING, "dnsstate.res_h_errno: %d\n", res); ++#else ++ res = h_errno; ++ ast_debug(1, "h_errno: %d\n", res); ++ ast_log(LOG_WARNING, "h_errno: %d\n", res); ++#endif ++ if (res == NO_DATA) { ++ ast_debug(1, "No matching DNS records for %s\n", dname); ++ ret = 0; ++ } + } + #ifdef HAVE_RES_NINIT + #ifdef HAVE_RES_NDESTROY +Index: main/enum.c +=================================================================== +--- a/main/enum.c (revision 180682) ++++ b/main/enum.c (working copy) +@@ -851,11 +851,15 @@ + ret = ast_search_dns(context, tmp, C_IN, T_NAPTR, enum_callback); + time_end = ast_tvnow(); + +- ast_verb(2, "ast_get_enum() profiling: %s, %s, %d ms\n", +- (ret == 0) ? "OK" : "FAIL", tmp, ast_tvdiff_ms(time_end, time_start)); ++ ast_verb(2, "ast_get_enum() profiling: %d, %s, %d ms\n", ++ ret, tmp, ast_tvdiff_ms(time_end, time_start)); + +- if (ret < 0) { ++ if (ret == 0) { ++ ast_debug(1, "Need more digits for: %s\n", tmp); ++ strcpy(dst, "0"); ++ } else 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; + } -- cgit v1.2.3