[asterisk-dev] lmadsen: branch 1.6.2 r302917 - in /branches/1.6.2: ./ apps/app_dial.c

Tony Mountifield tony at softins.co.uk
Fri Jan 21 06:08:20 CST 2011


This change looks wrong. Please see below...

In article <E1PfweH-0001qt-OZ at wibble.digium.internal>,
SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:
> Author: lmadsen
> Date: Thu Jan 20 09:42:05 2011
> New Revision: 302917
> 
> URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=302917
> Log:
> Option L() is milliseconds, not seconds.
> > Change the verbose output of option L() to say milliseconds and not seconds
> > as the value is in milliseconds.
> > 
> > (closes issue #18264)
> > Reported by: jacco
> > Patches: 
> >       app_dial_patch.txt uploaded by lmadsen (license 10)
> 
> Modified:
>     branches/1.6.2/   (props changed)
>     branches/1.6.2/apps/app_dial.c
> 
> Propchange: branches/1.6.2/
> ------------------------------------------------------------------------------
> --- branch-1.4-blocked (original)
> +++ branch-1.4-blocked Thu Jan 20 09:42:05 2011
> @@ -1,1 +1,1 @@
> -/branches/1.4:279344,281185,286070,286381,288116,288412,293922,294163,301869
> +/branches/1.4:279344,281185,286070,286381,288116,288412,293922,294163,301869,302916
> 
> Modified: branches/1.6.2/apps/app_dial.c
> URL:
> http://svnview.digium.com/svn/asterisk/branches/1.6.2/apps/app_dial.c?view=diff&rev=302917&r1=302916&r2=302917
> ==============================================================================
> --- branches/1.6.2/apps/app_dial.c (original)
> +++ branches/1.6.2/apps/app_dial.c Thu Jan 20 09:42:05 2011
> @@ -1239,7 +1239,7 @@
>  	if (!config->play_warning && !config->start_sound && !config->end_sound && config->timelimit) {
>  		calldurationlimit->tv_sec = config->timelimit / 1000;
>  		calldurationlimit->tv_usec = (config->timelimit % 1000) * 1000;
> -		ast_verb(3, "Setting call duration limit to %.3lf seconds.\n",
> +		ast_verb(3, "Setting call duration limit to %.3lf milliseconds.\n",
>  			calldurationlimit->tv_sec + calldurationlimit->tv_usec / 1000000.0);

It is config->timelimit that is in milliseconds. That is being converted
to seconds and microseconds in struct timeval calldurationlimit, which is
then being converted to a floating-point value of seconds for display to
three decimal places.

So the original text of "seconds" was correct, and a value of 15000ms
would be displayed as 15.000 seconds.

>  		config->timelimit = play_to_caller = play_to_callee =
>  		config->play_warning = config->warning_freq = 0;
> @@ -1614,7 +1614,7 @@
>  			pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
>  			goto done;
>  		}
> -		ast_verb(3, "Setting call duration limit to %.3lf seconds.\n", calldurationlimit.tv_sec +
> calldurationlimit.tv_usec / 1000000.0);
> +		ast_verb(3, "Setting call duration limit to %.3lf milliseconds.\n",
> calldurationlimit.tv_sec + calldurationlimit.tv_usec / 1000000.0);
>  	}

Likewise here. Note that in this case the S() option is already in seconds.

Hope this helps!

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list