[asterisk-commits] russell: branch russell/chan_refcount r82521 - /team/russell/chan_refcount/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Sep 16 21:07:22 CDT 2007
Author: russell
Date: Sun Sep 16 21:07:21 2007
New Revision: 82521
URL: http://svn.digium.com/view/asterisk?view=rev&rev=82521
Log:
convert senddtmf manager action
Modified:
team/russell/chan_refcount/apps/app_senddtmf.c
Modified: team/russell/chan_refcount/apps/app_senddtmf.c
URL: http://svn.digium.com/view/asterisk/team/russell/chan_refcount/apps/app_senddtmf.c?view=diff&rev=82521&r1=82520&r2=82521
==============================================================================
--- team/russell/chan_refcount/apps/app_senddtmf.c (original)
+++ team/russell/chan_refcount/apps/app_senddtmf.c Sun Sep 16 21:07:21 2007
@@ -94,23 +94,27 @@
{
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);
+ struct ast_channel *chan = ast_channel_get_by_name(channel);
if (!chan) {
astman_send_error(s, m, "Channel not specified");
return 0;
}
+
if (!digit) {
astman_send_error(s, m, "No digit specified");
- ast_mutex_unlock(&chan->lock);
- return 0;
+ goto return_unref;
}
+ ast_channel_lock(chan);
ast_senddigit(chan, *digit, 0);
+ ast_channel_unlock(chan);
- ast_mutex_unlock(&chan->lock);
astman_send_ack(s, m, "DTMF successfully queued");
-
+
+return_unref:
+ ast_channel_unref(chan);
+
return 0;
}
More information about the asterisk-commits
mailing list