summaryrefslogtreecommitdiff
path: root/include/asterisk/enum.h
diff options
context:
space:
mode:
authorBrett Bryant <bbryant@digium.com>2008-05-09 19:54:45 +0000
committerBrett Bryant <bbryant@digium.com>2008-05-09 19:54:45 +0000
commit65b8381550a9f46fdce84de79960073e9d51b05d (patch)
tree75981db2012acddf5f0872dd94a115efa2f36540 /include/asterisk/enum.h
parent8b1d52c9a547021c0e3a1c6199507f71d8350c47 (diff)
The following patch adds new options and alters the default behavior of the ENUM* functions. The TXCIDNAME lookup function has also gotten a
new paramater. The new options for ENUM* functions include 'u', 's', 'i', and 'd' which return the full uri, trigger isn specific rewriting, look for branches into an infrastructure enum tree, or do a direct dns lookup of a number respectively. The new paramater for TXCIDNAME adds a zone-suffix argument for looking up caller id's in DNS that aren't e164.arpa. This patch is based on the original code from otmar, modified by snuffy, and tested by jtodd, me, and others. (closes issue #8089) Reported by: otmar Patches: 20080508_bug8089-1.diff - original code by otmar (license 480), - revised by snuffy (license 35) Tested by: oej, otmar, jtodd, Corydon76, snuffy, alexnikolov, bbryant git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/enum.h')
-rw-r--r--include/asterisk/enum.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/asterisk/enum.h b/include/asterisk/enum.h
index d6bbea294..499e34673 100644
--- a/include/asterisk/enum.h
+++ b/include/asterisk/enum.h
@@ -45,7 +45,8 @@ struct enum_context {
char *txt; /*!< TXT record in TXT lookup */
int txtlen; /*!< Length */
char *naptrinput; /*!< The number to lookup */
- int position; /*!< used as counter for RRs or specifies position of required RR */
+ int position; /*!< specifies position of required RR */
+ int count; /*!< used as counter for RRs */
int options; /*!< options , see ENUMLOOKUP_OPTIONS_* defined above */
struct enum_naptr_rr *naptr_rrs; /*!< array of parsed NAPTR RRs */
int naptr_rrs_count; /*!< Size of array naptr_rrs */
@@ -57,12 +58,18 @@ struct enum_context {
\param number E164 number with or without the leading +
\param location Number returned (or SIP uri)
\param maxloc Max length
- \param technology Technology (from url scheme in response)
+ \param technology Technology (from url scheme in response)
You can set it to get particular answer RR, if there are many techs in DNS response, example: "sip"
- If you need any record, then set it to empty string
+ If you need any record, then set it to "ALL" string
\param maxtech Max length
- \param suffix Zone suffix (if is NULL then use enum.conf 'search' variable)
- \param options Options ('c' to count number of NAPTR RR)
+ \param suffix Zone suffix (WARNING: No defaults here any more)
+ \param options Options
+ 'c' - Count number of NAPTR RR
+ number - Position of the requested RR in the answer list
+ 'u' - Full URI return (does not strip URI scheme)
+ 'i' - Infrastructure ENUM lookup
+ 's' - ISN based lookup
+ 'd' - Direct DNS query
\param record The position of required RR in the answer list
\param argcontext Argument for caching results into an enum_context pointer (NULL is used for not caching)
\retval 1 if found
@@ -75,14 +82,11 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *location, i
/*! \brief Lookup DNS TXT record (used by app TXTCIDnum
\param chan Channel
\param number E164 number with or without the leading +
- \param location Number returned (or SIP uri)
- \param maxloc Max length of number
- \param technology Technology (not used in TXT records)
- \param maxtech Max length
\param txt Text string (return value)
\param maxtxt Max length of "txt"
+ \param suffix Zone suffix
*/
-int ast_get_txt(struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char *txt, int maxtxt);
+int ast_get_txt(struct ast_channel *chan, const char *number, char *txt, int maxtxt, char *suffix);
int ast_enum_init(void);
int ast_enum_reload(void);