[asterisk-commits] diruggles: trunk r243346 - /trunk/apps/app_senddtmf.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 26 14:50:00 CST 2010
Author: diruggles
Date: Tue Jan 26 14:49:57 2010
New Revision: 243346
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=243346
Log:
Code clean up in app_senddtmf
Pushes code clean up done in app_externalivr back
into app_senddtmf
Review: https://reviewboard.asterisk.org/r/473/
Modified:
trunk/apps/app_senddtmf.c
Modified: trunk/apps/app_senddtmf.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_senddtmf.c?view=diff&rev=243346&r1=243345&r2=243346
==============================================================================
--- trunk/apps/app_senddtmf.c (original)
+++ trunk/apps/app_senddtmf.c Tue Jan 26 14:49:57 2010
@@ -83,10 +83,10 @@
{
int res = 0;
char *data;
- int timeout = 0, duration = 0;
+ int dinterval = 0, duration = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(digits);
- AST_APP_ARG(timeout);
+ AST_APP_ARG(dinterval);
AST_APP_ARG(duration);
);
@@ -98,11 +98,14 @@
data = ast_strdupa(vdata);
AST_STANDARD_APP_ARGS(args, data);
- if (!ast_strlen_zero(args.timeout))
- 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.dinterval)) {
+ ast_app_parse_timelen(args.dinterval, &dinterval, TIMELEN_MILLISECONDS);
+ }
+ 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);
return res;
}
More information about the asterisk-commits
mailing list