[asterisk-ss7] MySQL HiRes timer.

Kaloyan Kovachev kkovachev at varna.net
Fri Apr 23 11:23:21 CDT 2010


I am not sure how different is the trunk version of cdr_mysql from 1.4.10, but
it may be enough to apply the relevant part of the whole patch:

Index: addons/cdr_mysql.c
===================================================================
--- addons/cdr_mysql.c	(revision 253708)
+++ addons/cdr_mysql.c	(working copy)
@@ -288,6 +288,39 @@
 					ast_str_append(&sql2, 0, ",");
 				}
 
+				if (!strcasecmp(cdrname, "billsec") &&
+					(strstr(entry->type, "float") ||
+					strstr(entry->type, "double") ||
+					strstr(entry->type, "decimal") ||
+					strstr(entry->type, "numeric") ||
+					strstr(entry->type, "real"))) {
+
+					if (!ast_tvzero(cdr->answer)) {
+						snprintf(workspace, sizeof(workspace), "%lf",
+							(double) (ast_tvdiff_us(cdr->end, cdr->answer) / 1000000.0));
+					} else {
+						ast_copy_string(workspace, "0",sizeof(workspace));
+					}
+
+					if (!ast_strlen_zero(workspace)) {
+						value = workspace;
+					}
+				}
+
+				if (!strcasecmp(cdrname, "duration") &&
+					(strstr(entry->type, "float") ||
+					strstr(entry->type, "double") ||
+					strstr(entry->type, "decimal") ||
+					strstr(entry->type, "numeric") ||
+					strstr(entry->type, "real"))) {
+					snprintf(workspace, sizeof(workspace), "%lf",
+						(double) (ast_tvdiff_us(cdr->end, cdr->start) / 1000000.0));
+
+					if (!ast_strlen_zero(workspace)) {
+						value = workspace;
+					}
+				}
+

On Fri, 23 Apr 2010 10:08:28 -0600, Jorge Antillon wrote 
> Hi, thanks for your time, this is where I went to, and how I got to
subscribing to asterisk-addons forum, I made no sense as to how to integrate
that into my asterisk-addons-1.4.10. 
> 
> regards, 
> 
> - jorge. 
> 
> On Fri, 2010-04-23 at 17:43 +0300, Kaloyan Kovachev wrote: 
>  take a look at https://reviewboard.asterisk.org/r/461/ 
> 
> On Fri, 23 Apr 2010 08:32:43 -0600, Jorge Antillon wrote 
> > Hi,  
> >  
> > First off, I know this is not cdr_mysql forum, BUT, the asterisk-addons
message board bounced my posting.  
> > I've bumped onto a different pothole this time, what seems to be is a CDR
recording issue:  
> >  
> > I need to set CDR recording to tenths of a second or better, instead of
integer values,  
> >  
> > I have asterisk 1.4.29.1 and addons 1.4.10.  
> > cdr.billsec and cdr.duration is already set as float, so no problem there.  
> >  
> > I figure you must have bumped into issues like this connecting SS7 trunks
to other operators.  
> >  
> > Or if you know where to look for, please let me know.  
> >  
> > Regards,  
> >  
> >  
>

> > 
>

>   Jorge Antillon 
> > CEO - CTO 
> > ticom - Costa Rica Telecom

> > 
> >

> 
>--

_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com 
--

asterisk-ss7 mailing 
list
To UNSUBSCRIBE or update options 
visit:
http://lists.digium.com/mailman/listinfo/asterisk-ss7




More information about the asterisk-ss7 mailing list