Asterisk - The Open Source Telephony Project GIT-master-0bf3178
|
DNS and ENUM functions. More...
#include "asterisk/channel.h"
Go to the source code of this file.
Data Structures | |
struct | enum_context |
struct | enum_naptr_rr |
struct | naptr |
Functions | |
int | ast_get_enum (struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char *suffix, char *options, unsigned int record, struct enum_context **argcontext) |
Lookup entry in ENUM. More... | |
int | ast_get_txt (struct ast_channel *chan, const char *number, char *txt, int maxtxt, char *suffix) |
Lookup DNS TXT record (used by app TXTCIDnum) More... | |
DNS and ENUM functions.
Definition in file enum.h.
int ast_get_enum | ( | struct ast_channel * | chan, |
const char * | number, | ||
char * | location, | ||
int | maxloc, | ||
char * | technology, | ||
int | maxtech, | ||
char * | suffix, | ||
char * | options, | ||
unsigned int | record, | ||
struct enum_context ** | argcontext | ||
) |
Lookup entry in ENUM.
chan | Channel |
number | E164 number with or without the leading + |
location | Number returned (or SIP uri) |
maxloc | Max length |
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 "ALL" string |
maxtech | Max length |
suffix | Zone suffix (WARNING: No defaults here any more) |
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 |
record | The position of required RR in the answer list |
argcontext | Argument for caching results into an enum_context pointer (NULL is used for not caching) |
1 | if found |
0 | if not found |
-1 | on hangup |
Definition at line 649 of file enum.c.
References ast_autoservice_start(), ast_autoservice_stop(), ast_calloc, ast_copy_string(), ast_debug, ast_free, ast_log, ast_mutex_lock, ast_mutex_unlock, ast_search_dns(), ast_strlen_zero(), ast_tvdiff_ms(), ast_tvnow(), blr_ebl(), blr_txt(), cclen(), voicemailpwcheck::context, ebl_alg, enum_callback(), enumlock, ENUMLOOKUP_BLR_CC, ENUMLOOKUP_BLR_EBL, ENUMLOOKUP_BLR_TXT, ENUMLOOKUP_OPTIONS_COUNT, ENUMLOOKUP_OPTIONS_DIRECT, ENUMLOOKUP_OPTIONS_IENUM, ENUMLOOKUP_OPTIONS_ISN, errno, ienum_branchlabel, LOG_WARNING, enum_context::naptrinput, NULL, options, and tmp().
Referenced by enum_query_read(), and function_enum().
int ast_get_txt | ( | struct ast_channel * | chan, |
const char * | number, | ||
char * | txt, | ||
int | maxtxt, | ||
char * | suffix | ||
) |
Lookup DNS TXT record (used by app TXTCIDnum)
Really has nothing to do with enum, but anyway... Actually, there is now an internet-draft which describes how callerID should be stored in ENUM domains: draft-ietf-enum-cnam-04.txt The algorithm implemented here will thus be obsolete soon.
chan | Channel |
number | E164 number with or without the leading + |
txt | Text string (return value) |
maxtxt | Max length of "txt" |
suffix | Zone suffix |
Definition at line 995 of file enum.c.
References ast_autoservice_start(), ast_autoservice_stop(), ast_copy_string(), ast_debug, ast_free, ast_search_dns(), voicemailpwcheck::context, errno, format_numeric_domain(), txt_context::txt, txt_callback(), and txt_context::txtlen.
Referenced by function_txtcidname().