struct ast_ari_response *response)
{
char *dialtech;
- char dialdevice[AST_CHANNEL_NAME];
+ char *dialdevice = NULL;
struct ast_dial *dial;
char *caller_id = NULL;
char *cid_num = NULL;
dialtech = ast_strdupa(args_endpoint);
if ((stuff = strchr(dialtech, '/'))) {
*stuff++ = '\0';
- ast_copy_string(dialdevice, stuff, sizeof(dialdevice));
+ dialdevice = stuff;
}
if (ast_strlen_zero(dialtech) || ast_strlen_zero(dialdevice)) {
struct ast_channel_snapshot *snapshot;
pthread_t thread;
char *dialtech;
- char dialdevice[AST_CHANNEL_NAME];
+ char *dialdevice = NULL;
char *stuff;
int cause;
struct ast_format_cap *request_cap;
dialtech = ast_strdupa(args->endpoint);
if ((stuff = strchr(dialtech, '/'))) {
*stuff++ = '\0';
- ast_copy_string(dialdevice, stuff, sizeof(dialdevice));
+ dialdevice = stuff;
+ }
+
+ if (ast_strlen_zero(dialtech) || ast_strlen_zero(dialdevice)) {
+ ast_ari_response_error(response, 400, "Bad Request",
+ "Invalid endpoint specified");
+ chan_data_destroy(chan_data);
+ return;
}
originator = ast_channel_get_by_name(args->originator);