154 static char *
synopsis =
"Syntax: ENUMLOOKUP(number[,Method-type[,options[,record#[,zone-suffix]]]])\n";
169 unsigned int record = 1;
192 args.zone =
"e164.arpa";
198 record = atoi(
args.record) ? atoi(
args.record) : record;
202 for (s = p =
args.number; *s; s++) {
204 snprintf(
tmp,
sizeof(
tmp),
"%c", *s);
205 strncat(num,
tmp,
sizeof(num) - strlen(num) - 1);
211 p = strchr(dest,
':');
212 if (p && strcasecmp(tech,
"ALL") && !strchr(
args.options,
'u')) {
256 char *
parse, tech[128], dest[128];
280 args.zone =
"e164.zone";
294 snprintf(buf, len,
"%u", erds->
id);
304 datastore->
data = erds;
361 erds = datastore->
data;
363 if (!strcasecmp(
args.resultnum,
"getnum")) {
369 if (sscanf(
args.resultnum,
"%30u", &num) != 1) {
406 .
name =
"ENUMRESULT",
411 .
name =
"ENUMLOOKUP",
416 char *data,
char *
buf,
size_t len)
438 args.zone =
"e164.arpa";
447 .
name =
"TXTCIDNAME",
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
Asterisk locking-related definitions:
Asterisk main include file. File version handling, generic pbx functions.
static void erds_destroy_cb(void *data)
struct enum_naptr_rr * naptr_rrs
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Structure for a data store type.
static int unload_module(void)
static const struct ast_datastore_info enum_result_datastore_info
static struct ast_custom_function enum_query_function
static int function_enum(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
Structure for a data store object.
struct ast_datastore * ast_channel_datastore_find(struct ast_channel *chan, const struct ast_datastore_info *info, const char *uid)
Find a datastore on a channel.
Generic File Format Support. Should be included by clients of the file handling routines. File service providers should instead include mod_format.h.
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
static int function_txtcidname(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define ast_strlen_zero(foo)
static struct ast_custom_function enum_function
General Asterisk PBX channel definitions.
Data structure associated with a custom dialplan function.
#define AST_MAX_EXTENSION
#define ast_strdupa(s)
duplicate a string in memory from the stack
struct enum_context * context
Core PBX routines and definitions.
static unsigned int enum_datastore_id
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
#define ast_calloc(num, len)
A wrapper for calloc()
static int load_module(void)
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)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
static struct ast_custom_function txtcidname_function
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.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static int enum_result_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
static int enum_query_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
#define ast_datastore_alloc(info, uid)
static void erds_destroy(struct enum_result_datastore *data)
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define ast_custom_function_register(acf)
Register a custom function.
static struct ast_custom_function enum_result_function
#define AST_APP_ARG(name)
Define an application argument.