81{
87 int found, field_number = 1, ix,
method;
88 char *separator = ",";
89
91 CONCAT,
92 SINGLE,
93 };
94
102 );
103
104
107 return -1;
108 }
109
111
114 return -1;
115 }
116
119 return -1;
120 }
121
124 return -1;
125 }
126
129 return -1;
130 }
131
134 } else {
135 if (strcmp(
args.method,
"concat") == 0) {
138 separator = ",";
139 } else {
140 separator =
args.method_arg;
141 }
142
143 }
else if (strcmp(
args.method,
"single") == 0) {
146 if (sscanf(
args.method_arg,
"%30d", &field_number) <= 0 || field_number <= 0 ) {
148 return -1;
149 }
150 }
151 } else {
153 return -1;
154 }
155 }
156
160 return -1;
161 }
162
164 if (!sorcery_obj) {
165 return -1;
166 }
167
169 if (!change_set) {
170 return -1;
171 }
172
173 ix=1;
174 found = 0;
175 for (it_change_set = change_set; it_change_set; it_change_set = it_change_set->
next) {
176
177 if (
method == CONCAT && strcmp(it_change_set->
name,
args.field_name) == 0) {
179 found = 1;
180 continue;
181 }
182
183 if (
method == SINGLE && strcmp(it_change_set->
name,
args.field_name) == 0 && ix++ == field_number) {
185 found = 1;
186 break;
187 }
188 }
189
191
192 if (!found) {
193 return -1;
194 }
195
198 }
199
200 return 0;
201}
#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)
#define AST_APP_ARG(name)
Define an application argument.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
static struct @450 methods[]
static struct ast_sorcery * sorcery
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
#define ast_sorcery_objectset_create(sorcery, object)
Create an object set (KVP list) for an object.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
struct ast_sorcery * ast_sorcery_retrieve_by_module_name(const char *module_name)
Retrieves an existing sorcery instance by module name.
char * ast_str_truncate(struct ast_str *buf, ssize_t len)
Truncates the enclosed string to the given length.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
int ast_str_set(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Set a dynamic string using variable arguments.
Full structure for sorcery.
Structure for variables, used for configurations and for channel variables.
struct ast_variable * next
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.