100 if (!(srds =
ast_calloc(1,
sizeof(*srds) + strlen(service)))) {
113 strcpy(srds->
id, service);
121 datastore->
data = srds;
210 srds = datastore->
data;
214 if (!strcasecmp(
args.resultnum,
"getnum")) {
224 if (sscanf(
args.resultnum,
"%30u", &num) != 1) {
234 if (!strcasecmp(
args.field,
"host")) {
236 }
else if (!strcasecmp(
args.field,
"port")) {
237 snprintf(buf, len,
"%d", port);
238 }
else if (!strcasecmp(
args.field,
"priority")) {
239 snprintf(buf, len,
"%d", priority);
240 }
else if (!strcasecmp(
args.field,
"weight")) {
241 snprintf(buf, len,
"%d", weight);
struct srv_context * context
#define ast_channel_lock(chan)
Main Channel structure associated with a channel.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
Asterisk main include file. File version handling, generic pbx functions.
static int srv_result_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
int ast_autoservice_start(struct ast_channel *chan)
Automatically service a channel for us...
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Support for DNS SRV records, used in to locate SIP services.
void ast_srv_cleanup(struct srv_context **context)
Cleanup resources associated with ast_srv_lookup.
enum ast_cc_service_type service
Structure for a data store type.
static int srv_query_read(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.
static struct srv_context * srv_datastore_setup(const char *service, struct ast_channel *chan)
static int unload_module(void)
int ast_custom_function_unregister(struct ast_custom_function *acf)
Unregister a custom function.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
#define ast_strlen_zero(foo)
Asterisk datastore objects.
int ast_srv_get_nth_record(struct srv_context *context, int record_num, const char **host, unsigned short *port, unsigned short *priority, unsigned short *weight)
Retrieve details from a specific SRV record.
General Asterisk PBX channel definitions.
Data structure associated with a custom dialplan function.
#define ast_strdupa(s)
duplicate a string in memory from the stack
Core PBX routines and definitions.
int ast_autoservice_stop(struct ast_channel *chan)
Stop servicing a channel for us...
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 void srds_destroy_cb(void *data)
unsigned int ast_srv_get_record_count(struct srv_context *context)
Get the number of records for a given SRV context.
Module has failed to load, may be in an inconsistent state.
static struct ast_custom_function srv_result_function
int ast_srv_lookup(struct srv_context **context, const char *service, const char **host, unsigned short *port)
Retrieve set of SRV lookups, in order.
static struct ast_custom_function srv_query_function
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
static const struct ast_datastore_info srv_result_datastore_info
#define ast_datastore_alloc(info, uid)
#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...
int ast_channel_datastore_remove(struct ast_channel *chan, struct ast_datastore *datastore)
Remove a datastore from a channel.
#define ast_custom_function_register(acf)
Register a custom function.
#define AST_APP_ARG(name)
Define an application argument.
static int load_module(void)