--- apps/app_senddtmf.c.orig 2010-04-14 10:35:04.000000000 +0200
+++ apps/app_senddtmf.c 2010-04-14 12:10:41.000000000 +0200
@@ -50,6 +50,9 @@
Duration of each digit
+
+ Channel where digits will be played
+
DTMF digits sent to a channel with half second pause
@@ -67,10 +70,13 @@
int res = 0;
char *data;
int timeout = 0, duration = 0;
+ struct ast_channel *destchan;
+
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(digits);
AST_APP_ARG(timeout);
AST_APP_ARG(duration);
+ AST_APP_ARG(channel);
);
if (ast_strlen_zero(vdata)) {
@@ -78,6 +84,8 @@
return 0;
}
+ destchan = chan;
+
data = ast_strdupa(vdata);
AST_STANDARD_APP_ARGS(args, data);
@@ -85,7 +93,9 @@
timeout = atoi(args.timeout);
if (!ast_strlen_zero(args.duration))
duration = atoi(args.duration);
- res = ast_dtmf_stream(chan, NULL, args.digits, timeout <= 0 ? 250 : timeout, duration);
+ if (!ast_strlen_zero(args.channel))
+ destchan = ast_get_channel_by_name_locked(args.channel);
+ res = ast_dtmf_stream(destchan, NULL, args.digits, timeout <= 0 ? 250 : timeout, duration);
return res;
}