177 unsigned short port, priority, weight;
212 srds = datastore->
data;
216 if (!strcasecmp(
args.resultnum,
"getnum")) {
226 if (sscanf(
args.resultnum,
"%30u", &num) != 1) {
236 if (!strcasecmp(
args.field,
"host")) {
238 }
else if (!strcasecmp(
args.field,
"port")) {
239 snprintf(buf,
len,
"%d", port);
240 }
else if (!strcasecmp(
args.field,
"priority")) {
241 snprintf(buf,
len,
"%d", priority);
242 }
else if (!strcasecmp(
args.field,
"weight")) {
243 snprintf(buf,
len,
"%d", weight);
struct srv_context * context
#define ast_channel_lock(chan)
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
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)
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.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#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...
#define ast_channel_unlock(chan)
static void parse(struct mgcp_request *req)
unsigned int ast_srv_get_record_count(struct srv_context *context)
Get the number of records for a given SRV context.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
#define AST_APP_ARG(name)
Define an application argument.
static struct ast_datastore_info srv_result_datastore_info
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.