if (ast_strlen_zero(name)) {
astman_send_error(s, m, "No channel specified");
- return 0;
+ return AMI_SUCCESS;
}
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
- return 0;
+ return AMI_SUCCESS;
}
if (ast_strlen_zero(fname)) {
if (ast_monitor_change_fname(c, fname, 1)) {
astman_send_error(s, m, "Could not start monitoring channel");
c = ast_channel_unref(c);
- return 0;
+ return AMI_SUCCESS;
}
}
astman_send_ack(s, m, "Started monitoring channel");
- return 0;
+ return AMI_SUCCESS;
}
/*! \brief Stop monitoring a channel by manager connection */
if (ast_strlen_zero(name)) {
astman_send_error(s, m, "No channel specified");
- return 0;
+ return AMI_SUCCESS;
}
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
- return 0;
+ return AMI_SUCCESS;
}
res = ast_monitor_stop(c, 1);
if (res) {
astman_send_error(s, m, "Could not stop monitoring channel");
- return 0;
+ return AMI_SUCCESS;
}
astman_send_ack(s, m, "Stopped monitoring channel");
- return 0;
+ return AMI_SUCCESS;
}
/*! \brief Change filename of a monitored channel by manager connection */
if (ast_strlen_zero(name)) {
astman_send_error(s, m, "No channel specified");
- return 0;
+ return AMI_SUCCESS;
}
if (ast_strlen_zero(fname)) {
astman_send_error(s, m, "No filename specified");
- return 0;
+ return AMI_SUCCESS;
}
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
- return 0;
+ return AMI_SUCCESS;
}
if (ast_monitor_change_fname(c, fname, 1)) {
c = ast_channel_unref(c);
astman_send_error(s, m, "Could not change monitored filename of channel");
- return 0;
+ return AMI_SUCCESS;
}
c = ast_channel_unref(c);
astman_send_ack(s, m, "Changed monitor filename");
- return 0;
+ return AMI_SUCCESS;
}
void AST_OPTIONAL_API_NAME(ast_monitor_setjoinfiles)(struct ast_channel *chan, int turnon)
MONITOR_ACTION_PAUSE,
MONITOR_ACTION_UNPAUSE
};
-
+
static int do_pause_or_unpause(struct mansession *s, const struct message *m, int action)
{
struct ast_channel *c = NULL;
if (ast_strlen_zero(name)) {
astman_send_error(s, m, "No channel specified");
- return -1;
+ return AMI_SUCCESS;
}
if (!(c = ast_channel_get_by_name(name))) {
astman_send_error(s, m, "No such channel");
- return -1;
+ return AMI_SUCCESS;
}
if (action == MONITOR_ACTION_PAUSE) {
astman_send_ack(s, m, (action == MONITOR_ACTION_PAUSE ? "Paused monitoring of the channel" : "Unpaused monitoring of the channel"));
- return 0;
+ return AMI_SUCCESS;
}
static int pause_monitor_action(struct mansession *s, const struct message *m)
{
return do_pause_or_unpause(s, m, MONITOR_ACTION_UNPAUSE);
}
-
static int load_module(void)
{