--- apps/app_senddtmf.c.orig 2010-04-15 08:53:56.000000000 +0200
+++ apps/app_senddtmf.c 2010-04-15 09:07:48.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
@@ -84,10 +87,12 @@
int res = 0;
char *data;
int dinterval = 0, duration = 0;
+ struct ast_channel *dchan;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(digits);
AST_APP_ARG(dinterval);
AST_APP_ARG(duration);
+ AST_APP_ARG(channel);
);
if (ast_strlen_zero(vdata)) {
@@ -95,6 +100,8 @@
return 0;
}
+ dchan = chan;
+
data = ast_strdupa(vdata);
AST_STANDARD_APP_ARGS(args, data);
@@ -104,8 +111,10 @@
if (!ast_strlen_zero(args.duration)) {
ast_app_parse_timelen(args.duration, &duration, TIMELEN_MILLISECONDS);
}
-
- res = ast_dtmf_stream(chan, NULL, args.digits, dinterval <= 0 ? 250 : dinterval, duration);
+ if (!ast_strlen_zero(args.channel)) {
+ dchan = ast_get_channel_by_name_locked(args.channel);
+ }
+ res = ast_dtmf_stream(dchan, NULL, args.digits, dinterval <= 0 ? 250 : dinterval, duration);
return res;
}