Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Asterisk Database Handling

Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
dougmig33 at yahoo.com
Guest





PostPosted: Wed May 21, 2008 4:37 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

General Asterisk question.

We are sending CDR's to MySQL via odbc. It seems that Asterisk is sometimes dropping CDR's, and they aren't being sent to the database (they ARE in the Master.csv file though). We suspect that when the MySQL socket is idle, it gets disconnected, either by the MySQL server or by our firewall, and when Asterisk goes to send the next CDR over the socket, does not re-open the database, and drops that CDR. Possibly on the next call, it connects ok and sends the next CDR.

This was a documented problem with voicemail users in the db in some previous version of Asterisk 1.2, and was patched and fixed in a later version of Asterisk 1.2

We are using Asterisk 1.2.19.

So... surely this must be a general problem with ANY Asterisk module that uses the database. Do all modules use the same common database code or do they all use their own? If they all use their own, I guess idle database connection issues may be fixed in some modules and not others. If it's common Asterisk database code, is it all fixed in a newer version? Is it fixed in Asterisk 1.4?

Thanks,
Doug.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080521/9c3cd705/attachment.htm
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed May 21, 2008 5:02 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Douglas Garstang wrote:

Quote:
We are sending CDR's to MySQL via odbc. It seems that Asterisk is
sometimes dropping CDR's, and they aren't being sent to the database
(they ARE in the Master.csv file though). We suspect that when the MySQL
socket is idle, it gets disconnected, either by the MySQL server or by
our firewall, and when Asterisk goes to send the next CDR over the
socket, does not re-open the database, and drops that CDR. Possibly on
the next call, it connects ok and sends the next CDR.

Isn't there a keepalive option somewhere for cdr_mysql.conf, or failing
that, a keepalive mechanism that can be enabled for TCP connections on
the server side?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
sanjay.rajdev at feath...
Guest





PostPosted: Wed May 21, 2008 5:18 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

I had a similar problem, but in my case we had a custom application that was throwing an segmentation exception which was causing Asterisk to Restart. And in that case It use to miss the log in database.
You can determine the same by looking at the UNIQUEID being logged for the call. The UNIQUEID actually comprises of 2 things DateTimeString.CallNumber , everytime Asterisk restarts CallNumber will start from 1. So you can check the 2-3 UNIQUEID before you missed entry in CDR table and 2-3 after the missed entry to determine if Asterisk Restarted.
Other way is you can see the kernel logs to see if Asterisk has thrown any exception. they can be found on Linux at /var/log/messages
Regards,
Sanjay Rajdev

----- Original Message -----
From: "Alex Balashov" <abalashov at evaristesys.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Sent: Thursday, May 22, 2008 3:32:07 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi
Subject: Re: [asterisk-users] Asterisk Database Handling

Douglas Garstang wrote:

Quote:
We are sending CDR's to MySQL via odbc. It seems that Asterisk is
sometimes dropping CDR's, and they aren't being sent to the database
(they ARE in the Master.csv file though). We suspect that when the MySQL
socket is idle, it gets disconnected, either by the MySQL server or by
our firewall, and when Asterisk goes to send the next CDR over the
socket, does not re-open the database, and drops that CDR. Possibly on
the next call, it connects ok and sends the next CDR.

Isn't there a keepalive option somewhere for cdr_mysql.conf, or failing
that, a keepalive mechanism that can be enabled for TCP connections on
the server side?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

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

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080522/c54626bc/attachment.htm
Back to top
dougmig33 at yahoo.com
Guest





PostPosted: Wed May 21, 2008 5:23 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

I couldn't find one for cdr_mysql.conf.
We're using odbc anyway. MySQL directly might be an option if it works.
Don't think we want to modify the server.

----- Original Message ----
From: Alex Balashov <abalashov at evaristesys.com>
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Sent: Wednesday, May 21, 2008 3:02:07 PM
Subject: Re: [asterisk-users] Asterisk Database Handling

Douglas Garstang wrote:

Quote:
We are sending CDR's to MySQL via odbc. It seems that Asterisk is
sometimes dropping CDR's, and they aren't being sent to the database
(they ARE in the Master.csv file though). We suspect that when the MySQL
socket is idle, it gets disconnected, either by the MySQL server or by
our firewall, and when Asterisk goes to send the next CDR over the
socket, does not re-open the database, and drops that CDR. Possibly on
the next call, it connects ok and sends the next CDR.

Isn't there a keepalive option somewhere for cdr_mysql.conf, or failing
that, a keepalive mechanism that can be enabled for TCP connections on
the server side?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

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

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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080521/9b756af9/attachment.htm
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed May 21, 2008 5:23 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Sanjay Rajdev wrote:
Quote:
I had a similar problem, but in my case we had a custom application that
was throwing an segmentation exception which was causing Asterisk to
Restart. And in that case It use to miss the log in database.
You can determine the same by looking at the UNIQUEID being logged for
the call. The UNIQUEID actually comprises of 2 things
DateTimeString.CallNumber, everytime Asterisk restarts CallNumber will
start from 1. So you can check the 2-3 UNIQUEID before you missed entry
in CDR table and 2-3 after the missed entry to determine if Asterisk
Restarted.
Other way is you can see the kernel logs to see if Asterisk has thrown
any exception. they can be found on Linux at /var/log/messages

There is no such thing as a segmentation "exception." C does not have
exception handling, and Asterisk does not throw any exceptions.

There is, however, a "segmentation fault." That is a memory condition
that causes the operating system to terminate the process, in absence of
a signal handler for it.

None of these can or should be characterised as "exceptions," and have
absolutely nothing to do with them.

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed May 21, 2008 5:30 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Douglas Garstang wrote:

Quote:
I couldn't find one for cdr_mysql.conf.
We're using odbc anyway. MySQL directly might be an option if it works.
Don't think we want to modify the server.

Perhaps there's a keepalive option to be set on the UnixODBC DSN, then?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
stotaro at totarotechn...
Guest





PostPosted: Wed May 21, 2008 5:32 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

On Wed, May 21, 2008 at 5:37 PM, Douglas Garstang <dougmig33 at yahoo.com> wrote:
Quote:
General Asterisk question.

We are sending CDR's to MySQL via odbc. It seems that Asterisk is sometimes
dropping CDR's, and they aren't being sent to the database (they ARE in the
Master.csv file though). We suspect that when the MySQL socket is idle, it
gets disconnected, either by the MySQL server or by our firewall, and when
Asterisk goes to send the next CDR over the socket, does not re-open the
database, and drops that CDR. Possibly on the next call, it connects ok and
sends the next CDR.

This was a documented problem with voicemail users in the db in some
previous version of Asterisk 1.2, and was patched and fixed in a later
version of Asterisk 1.2

We are using Asterisk 1.2.19.

So... surely this must be a general problem with ANY Asterisk module that
uses the database. Do all modules use the same common database code or do
they all use their own? If they all use their own, I guess idle database
connection issues may be fixed in some modules and not others. If it's
common Asterisk database code, is it all fixed in a newer version? Is it
fixed in Asterisk 1.4?

Thanks,
Doug.


I have no answer, just a potential work around if you get no good answers.

I guess you could just pipe the master.csv into your database (similar
to how queuemetrics does queue_log)

Thanks,
Steve Totaro
Back to top
dougmig33 at yahoo.com
Guest





PostPosted: Wed May 21, 2008 5:42 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Quote:
Quote:
So... surely this must be a general problem with ANY Asterisk module that
uses the database. Do all modules use the same common database code or do
they all use their own? If they all use their own, I guess idle database
connection issues may be fixed in some modules and not others. If it's
common Asterisk database code, is it all fixed in a newer version? Is it
fixed in Asterisk 1.4?

Thanks,
Doug.


I have no answer, just a potential work around if you get no good answers.

I guess you could just pipe the master.csv into your database (similar
to how queuemetrics does queue_log)

Are you saying this is a known problem?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080521/49a872cd/attachment.htm
Back to top
dougmig33 at yahoo.com
Guest





PostPosted: Wed May 21, 2008 5:43 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Quote:
----- Original Message ----

Quote:
From: Alex Balashov <abalashov at evaristesys.com>
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Sent: Wednesday, May 21, 2008 3:30:06 PM
Subject: Re: [asterisk-users] Asterisk Database Handling

Douglas Garstang wrote:

Quote:
I couldn't find one for cdr_mysql.conf.
We're using odbc anyway. MySQL directly might be an option if it works.
Don't think we want to modify the server.

Perhaps there's a keepalive option to be set on the UnixODBC DSN, then?

I already searched. Could not find one.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080521/0771419e/attachment.htm
Back to top
sherwood.mcgowan at gm...
Guest





PostPosted: Wed May 21, 2008 5:45 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Douglas Garstang wrote:
Quote:
I couldn't find one for cdr_mysql.conf.
We're using odbc anyway. MySQL directly might be an option if it works.
Don't think we want to modify the server.


----- Original Message ----
From: Alex Balashov <abalashov at evaristesys.com>
To: Asterisk Users Mailing List - Non-Commercial Discussion
<asterisk-users at lists.digium.com>
Sent: Wednesday, May 21, 2008 3:02:07 PM
Subject: Re: [asterisk-users] Asterisk Database Handling

Douglas Garstang wrote:

Quote:
We are sending CDR's to MySQL via odbc. It seems that Asterisk is
sometimes dropping CDR's, and they aren't being sent to the database
(they ARE in the Master.csv file though). We suspect that when the
MySQL
Quote:
socket is idle, it gets disconnected, either by the MySQL server or by
our firewall, and when Asterisk goes to send the next CDR over the
socket, does not re-open the database, and drops that CDR. Possibly on
the next call, it connects ok and sends the next CDR.

Isn't there a keepalive option somewhere for cdr_mysql.conf, or failing
that, a keepalive mechanism that can be enabled for TCP connections on
the server side?

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

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

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

------------------------------------------------------------------------

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

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
I personally can tell you I've never had a problem with either the
PostgreSQL or MySQL cdr apps themselves losing records. However, I can't
say personally how well the ODBC method works. I'll just stick to saying
that if you're considering using the cdr_mysql addon, I would highly
suggest it as I've used it with MUCH success on high load servers.

Sherwood McGowan
Back to top
stotaro at totarotechn...
Guest





PostPosted: Wed May 21, 2008 5:47 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

On Wed, May 21, 2008 at 6:42 PM, Douglas Garstang <dougmig33 at yahoo.com> wrote:
Quote:
Quote:
Quote:

So... surely this must be a general problem with ANY Asterisk module that
uses the database. Do all modules use the same common database code or do
they all use their own? If they all use their own, I guess idle database
connection issues may be fixed in some modules and not others. If it's
common Asterisk database code, is it all fixed in a newer version? Is it
fixed in Asterisk 1.4?

Thanks,
Doug.


I have no answer, just a potential work around if you get no good answers.

I guess you could just pipe the master.csv into your database (similar
to how queuemetrics does queue_log)

Are you saying this is a known problem?



Not at all, just offering a workaround. If your master.csv is
complete and correct then it makes sense to use that data unless
someone can identify your problem and offer a fix.

Thanks,
Steve Totaro
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed May 21, 2008 5:52 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Sherwood McGowan wrote:

Quote:
I personally can tell you I've never had a problem with either the
PostgreSQL or MySQL cdr apps themselves losing records. However, I can't
say personally how well the ODBC method works. I'll just stick to saying
that if you're considering using the cdr_mysql addon, I would highly
suggest it as I've used it with MUCH success on high load servers.

I would tend to strongly concur here.

ODBC is nice, but it's not nearly as well-supported or mature as the
native database interfaces. Doesn't mean it works badly, just that I
have lower expectations for it than I do for cdr_{nativeDB}.

--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
dougmig33 at yahoo.com
Guest





PostPosted: Wed May 21, 2008 6:00 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Quote:
I personally can tell you I've never had a problem with either the

Quote:
PostgreSQL or MySQL cdr apps themselves losing records. However, I can't
say personally how well the ODBC method works. I'll just stick to saying
that if you're considering using the cdr_mysql addon, I would highly
suggest it as I've used it with MUCH success on high load servers.

It's interesting you say that Sherwood. Does your MySQL server have some sort of keep alive setting? I suspect this is a general problem that would affect any and all Asterisk database connectivity.

Doug.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080521/2ed2997e/attachment.htm
Back to top
stotaro at totarotechn...
Guest





PostPosted: Wed May 21, 2008 6:02 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

On Wed, May 21, 2008 at 7:00 PM, Douglas Garstang <dougmig33 at yahoo.com> wrote:
Quote:
Quote:
I personally can tell you I've never had a problem with either the
PostgreSQL or MySQL cdr apps themselves losing records. However, I can't
say personally how well the ODBC method works. I'll just stick to saying
that if you're considering using the cdr_mysql addon, I would highly
suggest it as I've used it with MUCH success on high load servers.

It's interesting you say that Sherwood. Does your MySQL server have some
sort of keep alive setting? I suspect this is a general problem that would
affect any and all Asterisk database connectivity.

Doug.


A quote from Tilghman Lesher from a previous post.

"That's fine, but I have had the most horrid results using any distribution-
supplied ODBC drivers. The best results are obtained by source-compiling
the latest ODBC drivers, whether they be the MySQL ODBC Connector 3.51 or
PsqlODBC. UnixODBC is fairly safe to use from distribution channels, however."

Thanks,
Steve Totaro
Back to top
abalashov at evaristes...
Guest





PostPosted: Wed May 21, 2008 6:06 pm    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Douglas Garstang wrote:

Quote:
It's interesting you say that Sherwood. Does your MySQL server have some
sort of keep alive setting? I suspect this is a general problem that
would affect any and all Asterisk database connectivity.

I would actually expect it to affect only specific types of database
connections.

While there may exist in the source code a general database abstraction
layer, it would only be a wrapper for interfaces to particular databases
implemented using native APIs elsewhere in the code (i.e. the MySQL
protocol, the Postgres protocol, the ODBC interchange protocol, etc.)
--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services