103{
104 int inuse = -1;
105 int option_state = 0;
106 int string_compare = 0;
107 int option_all_avail = 0;
110 char trychan[512];
111 char *rest;
112 char *tech;
124 );
125
127
129
133
135 if (strchr(
args.options,
'a')) {
136 option_all_avail = 1;
137 }
138 if (strchr(
args.options,
's')) {
139 option_state = 1;
140 }
141 if (strchr(
args.options,
't')) {
142 string_compare = 1;
143 }
144 }
145
146 rest =
args.reqchans;
147 if (!rest) {
148 rest = "";
149 }
150 while ((tech =
strsep(&rest,
"&"))) {
152
153 number = strchr(tech,
'/');
157 tech);
158 }
159
162 continue;
163 }
165
167
168 if (string_compare) {
169
170
171
172 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech,
number);
174 } else if (option_state) {
175
176
177
178
179 snprintf(trychan,
sizeof(trychan),
"%s/%s", tech,
number);
181 }
183
186
189
192
195
196
197 if (cdr_prop_func) {
199 }
200
203
204 if (!option_all_avail) {
205 break;
206 }
207 }
208
209 }
210
212
214
218
219 return 0;
220}
#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.
char * strsep(char **str, const char *delims)
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.