[asterisk-dev] [Code Review] High Resolution Call Time for Billsec and Duration

Tilghman Lesher tlesher at digium.com
Thu Jan 28 12:42:55 CST 2010



> On 2010-01-28 11:28:19, Russell Bryant wrote:
> > /trunk/addons/cdr_mysql.c, lines 292-296
> > <https://reviewboard.asterisk.org/r/461/diff/6/?file=7855#file7855line292>
> >
> >     Is strstr() really what is appropriate here?  I see that it's used in existing code, too, but I'm curious why it's needed instead of strcmp().

Technically, you could use strncmp, but it needs to be limited, because there are optional suffixes, both of precision as well as other keywords, such as "unsigned" and "zerofill" which may be appended to the type field.  The real reason for strstr() was one of consistency, because for integer types, we have tinyint, smallint, mediumint, int, and bigint.  That's not a concern here, but as it's consistent with the other sections, it enhances readability without a significant performance hit.


- Tilghman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/461/#review1422
-----------------------------------------------------------


On 2010-01-23 15:57:21, Brad Latus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/461/
> -----------------------------------------------------------
> 
> (Updated 2010-01-23 15:57:21)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This allows for the showing of the accurate times for billable time and call duration.
> Adds new flag to CDR function 'f' for the above fields.
> 
> This came about by bug #16559 and I thought i'd take a go at making it happen.
> 
> We can drop a few of the modules for ones we want to depreciate like sql-lite / odbc (in favour of sql-lite3 / adaptive_odbc)
> 
> 
> This addresses bug 16559.
>     https://issues.asterisk.org/view.php?id=16559
> 
> 
> Diffs
> -----
> 
>   /trunk/CHANGES 240716 
>   /trunk/UPGRADE.txt 240716 
>   /trunk/addons/cdr_mysql.c 240716 
>   /trunk/cdr/cdr_adaptive_odbc.c 240716 
>   /trunk/cdr/cdr_odbc.c 240716 
>   /trunk/cdr/cdr_pgsql.c 240716 
>   /trunk/cdr/cdr_sqlite.c 240716 
>   /trunk/cdr/cdr_tds.c 240716 
>   /trunk/configs/cdr_custom.conf.sample 240716 
>   /trunk/configs/cdr_odbc.conf.sample 240716 
>   /trunk/configs/cdr_sqlite3_custom.conf.sample 240716 
>   /trunk/configs/cdr_syslog.conf.sample 240716 
>   /trunk/configs/cdr_tds.conf.sample 240716 
>   /trunk/funcs/func_cdr.c 240716 
> 
> Diff: https://reviewboard.asterisk.org/r/461/diff
> 
> 
> Testing
> -------
> 
> Compile test only.
> 
> 
> Thanks,
> 
> Brad
> 
>




More information about the asterisk-dev mailing list