106{
107 int inuse = -1;
108 int option_state = 0;
109 int string_compare = 0;
110 int option_all_avail = 0;
113 char trychan[512];
114 char *rest;
115 char *tech;
127 );
128
130
132
136
138 if (strchr(
args.options,
'a')) {
139 option_all_avail = 1;
140 }
141 if (strchr(
args.options,
's')) {
142 option_state = 1;
143 }
144 if (strchr(
args.options,
't')) {
145 string_compare = 1;
146 }
147 }
148
149 rest =
args.reqchans;
150 if (!rest) {
151 rest = "";
152 }
153 while ((tech =
strsep(&rest,
"&"))) {
155
156 number = strchr(tech,
'/');
160 tech);
161 }
162
165 continue;
166 }
168
170
171 if (string_compare) {
172
173
174
175 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech,
number);
177 } else if (option_state) {
178
179
180
181
182 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech,
number);
184 }
186
189
192
195
198
199
200 if (cdr_prop_func) {
202 }
203
206
207 if (!option_all_avail) {
208 break;
209 }
210 }
211
212 }
213
215
217
221
222 return 0;
223}
char * strsep(char **str, const char *delims)
#define ast_strdupa(s)
duplicate a string in memory from the stack
#define ao2_bump(obj)
Bump refcount on an AO2 object by one, returning the object.
const char * ast_channel_name(const struct ast_channel *chan)
void ast_hangup(struct ast_channel *chan)
Hang up a channel.
struct ast_format_cap * ast_channel_nativeformats(const struct ast_channel *chan)
struct ast_channel * ast_request(const char *type, struct ast_format_cap *request_cap, const struct ast_assigned_ids *assignedids, const struct ast_channel *requestor, const char *addr, int *cause)
Requests a channel.
enum ast_device_state ast_parse_device_state(const char *device)
Search the Channels by Name.
ast_device_state
Device States.
#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.
struct ast_custom_function * ast_custom_function_find(const char *name)
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
int ast_func_write(struct ast_channel *chan, const char *function, const char *value)
executes a write operation on a function
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_alloca(init_len)
size_t ast_str_strlen(const struct ast_str *buf)
Returns the current length of the string stored within buf.
char * ast_strip(char *s)
Strip leading/trailing whitespace from a string.
Main Channel structure associated with a channel.
Data structure associated with a custom dialplan function.
Support for dynamic strings.