[asterisk-users] BADTIME FOR ANSWEREDTIME

Steve Edwards asterisk.org at sedwards.com
Mon May 3 17:49:22 CDT 2010


Un-top-posting...

> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of François 
> BERGANZ
>
> I saw that Asterisk don't calcultate fine the ANSWEREDTIME. I want that 
> when ANSWEREDTIME =~ 5.6 become 6 and if =~10.3 become 10 because, now, 
> if ANSEREDTIME =~ 15.9, it become 15! it isn't correct
>
> How can I have a rounded ANSWEREDTIME ? Where have I to manipulate the 
> sources?
>
> thank you

On Mon, 3 May 2010, Danny Nicholas wrote:

> The values for ANSWEREDTIME are set in apps/app_followme.c and 
> apps/app_dial.c . The values are set in seconds, so if you're looking to 
> set nearest minute you'll just need to change the sprintf from %1d (1 
> decimal point x.x) to %0d (x).

As Danny pointed out, ANSWEREDTIME is in seconds. Where are you seeing a 
decimal number?

In any case, the characters following the "start specification" ("%") are 
the flag characters ("-#0") and are unrelated to the "precision 
specification" which follows the optional decimal point in a output format 
conversion specification.

Which is all irrelevant because ANSWEREDTIME is computed by subtracting 2 
time_t's (a long int on a 32 bit processor) yielding a long int which, um, 
has no decimal portion :)

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000


More information about the asterisk-users mailing list