summaryrefslogtreecommitdiff
path: root/apps/app_senddtmf.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_senddtmf.c')
-rw-r--r--apps/app_senddtmf.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/app_senddtmf.c b/apps/app_senddtmf.c
index 9842c412e..a1c28a8f9 100644
--- a/apps/app_senddtmf.c
+++ b/apps/app_senddtmf.c
@@ -100,23 +100,25 @@ static int manager_play_dtmf(struct mansession *s, const struct message *m)
{
const char *channel = astman_get_header(m, "Channel");
const char *digit = astman_get_header(m, "Digit");
- struct ast_channel *chan = ast_get_channel_by_name_locked(channel);
-
- if (!chan) {
- astman_send_error(s, m, "Channel not specified");
+ struct ast_channel *chan;
+
+ if (!(chan = ast_channel_get_by_name(channel))) {
+ astman_send_error(s, m, "Channel not found");
return 0;
}
+
if (ast_strlen_zero(digit)) {
astman_send_error(s, m, "No digit specified");
- ast_channel_unlock(chan);
+ chan = ast_channel_unref(chan);
return 0;
}
ast_senddigit(chan, *digit, 0);
- ast_channel_unlock(chan);
+ chan = ast_channel_unref(chan);
+
astman_send_ack(s, m, "DTMF successfully queued");
-
+
return 0;
}