44 #include "asterisk/module.h"
156 static char *
synopsis =
"Syntax: ENUMLOOKUP(number[,Method-type[,options[,record#[,zone-suffix]]]])\n";
159 char *buf,
size_t len)
171 unsigned int record = 1;
194 args.zone =
"e164.arpa";
200 record = atoi(
args.record) ? atoi(
args.record) : record;
204 for (s = p =
args.number; *s; s++) {
206 snprintf(tmp,
sizeof(tmp),
"%c", *s);
207 strncat(num, tmp,
sizeof(num) - strlen(num) - 1);
211 ast_get_enum(chan, num, dest,
sizeof(dest), tech,
sizeof(tech),
args.zone,
args.options, record, NULL);
213 p = strchr(dest,
':');
214 if (p && strcasecmp(tech,
"ALL") && !strchr(
args.options,
'u')) {
258 char *
parse, tech[128], dest[128];
282 args.zone =
"e164.zone";
296 snprintf(buf, len,
"%u", erds->
id);
306 datastore->
data = erds;
363 erds = datastore->
data;
365 if (!strcasecmp(
args.resultnum,
"getnum")) {
371 if (sscanf(
args.resultnum,
"%30u", &num) != 1) {
408 .
name =
"ENUMRESULT",
413 .
name =
"ENUMLOOKUP",
418 char *data,
char *buf,
size_t len)
440 args.zone =
"e164.arpa";
449 .
name =
"TXTCIDNAME",
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
static struct ast_datastore_info enum_result_datastore_info
#define AST_MODULE_INFO_STANDARD(keystr, desc)
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_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
Structure for a data store type.
static int unload_module(void)
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. This can be used to handle reference co...
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)
static struct ast_custom_function enum_function
General Asterisk PBX channel definitions.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
Data structure associated with a custom dialplan function.
#define AST_MAX_EXTENSION
struct enum_context * context
Core PBX routines and definitions.
static unsigned int enum_datastore_id
#define ast_strdupa(s)
duplicate a string in memory from the stack
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void ast_log(int level, const char *file, int line, const char *function, const char *fmt,...)
Used for sending a log message This is the standard logger function. Probably the only way you will i...
struct ast_datastore * ast_datastore_alloc(const struct ast_datastore_info *info, const char *uid)
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
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)
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)
Application convenience functions, designed to give consistent look and feel to Asterisk apps...
#define AST_APP_ARG(name)
Define an application argument.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
static void erds_destroy(struct enum_result_datastore *data)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_channel_datastore_add(struct ast_channel *chan, struct ast_datastore *datastore)
Add a datastore to a channel.
#define ast_custom_function_register(acf)
Register a custom function.
static struct ast_custom_function enum_result_function
#define ASTERISK_FILE_VERSION(file, version)
Register/unregister a source code file with the core.