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 Previous  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 6:08 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.

Oh... Also... does your system have idle periods? You said your servers where under high load. The issue seems to be that Asterisk does not re-establish the database connection after it is disconnected do to being idle. If you don't have idle periods, you'd never see this problem anyway.


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





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

Quote:
Not at all, just offering a workaround. If your master.csv is

Quote:
complete and correct then it makes sense to use that data unless
someone can identify your problem and offer a fix.

Unfortunately, not really feesible. I didn't design the system but we are using CDR's not only for billing purposes, but also to keep state on users. The state info (in a call, not in a call etc) needs to be updated in as close to real time as possible. Files won't do it.

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





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

On Wed, May 21, 2008 at 7:11 PM, Douglas Garstang <dougmig33 at yahoo.com> wrote:
Quote:
Quote:
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.

Unfortunately, not really feesible. I didn't design the system but we are
using CDR's not only for billing purposes, but also to keep state on users.
The state info (in a call, not in a call etc) needs to be updated in as
close to real time as possible. Files won't do it.



A named pipe would write in realtime but if broken would cause big problems.

http://www.mail-archive.com/asterisk-users at lists.digium.com/msg203863.html

This thread may be of help.

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





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

Douglas Garstang wrote:
Quote:
Quote:
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.

Unfortunately, not really feesible. I didn't design the system but we
are using CDR's not only for billing purposes, but also to keep state on
users. The state info (in a call, not in a call etc) needs to be updated
in as close to real time as possible. Files won't do it.

The Manager API can get that information out for you in even more
real-time, although I've had some problems with its accuracy (vide
disconnect events, etc).

But, I agree, it's easier to just get the CDRs working. Smile
--
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
sherwood.mcgowan at gm...
Guest





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

Douglas Garstang 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.

Oh... Also... does your system have idle periods? You said your
servers where under high load. The issue seems to be that Asterisk
does not re-establish the database connection after it is disconnected
do to being idle. If you don't have idle periods, you'd never see this
problem anyway.

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

_______________________________________________
-- 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
True, I should have also mentioned that I have used it on low load
testing servers and it did not have a problem with reconnecting. Like I
said, I haven't used the ODBC method, but the cdr_mysql addon
reconnected for me. Currently, however, I'm operating a high load (1K
calls per hour or more) server with cdr_pgsql with no keep alive, but as
far as I remember I never had to institute a keep_alive of any sort on
my other servers. However, don't take this as gold, it's been more than
6 months since I worked with a low load server.

Sherwood McGowan
Back to top
sherwood.mcgowan at gm...
Guest





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

Douglas Garstang 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.

Oh... Also... does your system have idle periods?
oh and yes, overnight there is NO load or next to no load on our server
at my current project, but in the morning nothing needs to be done to
have the pgsql cdrs work just fine.
Back to top
tilghman at mail.jeffa...
Guest





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

On Wednesday 21 May 2008 17:02:07 Alex Balashov wrote:
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?

Please check the 'idlecheck' option in res_odbc.conf.

--
Tilghman
Back to top
tilghman at mail.jeffa...
Guest





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

On Wednesday 21 May 2008 17:52:45 Alex Balashov wrote:
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}.

Most of the CDR backends suck. The ODBC backend has gotten a
complete workover in 1.6, though. The adaptive ODBC CDR backend
should make it easier to log anything that people might want in their
CDRs.

--
Tilghman
Back to top
dougmig33 at yahoo.com
Guest





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

Looks like an Asterisk 1.4 option?
----- Original Message ----
From: Tilghman Lesher <tilghman at mail.jeffandtilghman.com>
To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com>
Sent: Wednesday, May 21, 2008 4:39:24 PM
Subject: Re: [asterisk-users] Asterisk Database Handling

On Wednesday 21 May 2008 17:02:07 Alex Balashov wrote:
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?

Please check the 'idlecheck' option in res_odbc.conf.

--
Tilghman

_______________________________________________
-- 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/48e80bfc/attachment.htm
Back to top
tilghman at mail.jeffa...
Guest





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

On Wednesday 21 May 2008 19:03:25 Douglas Garstang wrote:
Quote:
On Wednesday, May 21, 2008 4:39:24 PM, Tilghman Lesher wrote:
Quote:
On Wednesday 21 May 2008 17:02:07 Alex Balashov wrote:
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?

Please check the 'idlecheck' option in res_odbc.conf.

Looks like an Asterisk 1.4 option?

Correct; it's actually a workaround for a bug in the MySQL drivers. It was
discovered long after 1.2 was end-of-lifed.

--
Tilghman
Back to top
sprior at geekster.com
Guest





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

Tilghman Lesher wrote:
Quote:
Correct; it's actually a workaround for a bug in the MySQL drivers. It was
discovered long after 1.2 was end-of-lifed.


I got bit by MySQL reconnects on some other software I wrote I think when I
jumped from MySQL 4.* to 5.*. If memory serves, here is the relevant info from
the official MySQL documentation:

From: http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html

The reconnect flag in the MYSQL structure is set to 0 by mysql_real_connect().
Only those client programs which did not explicitly set this flag to 0 or 1
after mysql_real_connect() experience a change. Having automatic reconnection
enabled by default was considered too dangerous (due to the fact that table
locks, temporary tables, user variables, and session variables are lost after
reconnection).
This may explain why this is happening in Asterisk. In the case of my other
code the answer was not to keep a long term connection through idle periods.

Steve
Back to top
tilghman at mail.jeffa...
Guest





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

On Wednesday 21 May 2008 19:36:11 Steve Prior wrote:
Quote:
Tilghman Lesher wrote:
Quote:
Correct; it's actually a workaround for a bug in the MySQL drivers. It
was discovered long after 1.2 was end-of-lifed.

I got bit by MySQL reconnects on some other software I wrote I think when I
jumped from MySQL 4.* to 5.*. If memory serves, here is the relevant info
from the official MySQL documentation:

From: http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html

The reconnect flag in the MYSQL structure is set to 0 by
mysql_real_connect(). Only those client programs which did not explicitly
set this flag to 0 or 1 after mysql_real_connect() experience a change.
Having automatic reconnection enabled by default was considered too
dangerous (due to the fact that table locks, temporary tables, user
variables, and session variables are lost after reconnection).


This may explain why this is happening in Asterisk. In the case of my
other code the answer was not to keep a long term connection through idle
periods.

No, actually, we're using that flag to try to get automatic reconnection, and
we're getting a segmentation fault from the MySQL drivers. It would be one
thing if queries simply failed, but that's not the case. Note also that we're
not only not using any of those items which could be lost after a
reconnection, we're actually re-preparing the statement handle after each
reconnect.

However, once I added the idlecheck timeout, I have yet to have gotten the
segmentation fault related to this MySQL driver bug.

Interestingly, the segfault only happens on the second statement run after
a reconnect, which leads me to believe that there is some shared structure
which is getting properly reallocated in one place, leaving a stale handle to
another, which when dereferenced causes the segmentation fault. However,
not being familiar with the driver code, I haven't gone any further in trying
to track this bug down.

--
Tilghman
Back to top
sherwood.mcgowan at gm...
Guest





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

Steve Prior wrote:
Quote:
Tilghman Lesher wrote:

Quote:
Correct; it's actually a workaround for a bug in the MySQL drivers. It was
discovered long after 1.2 was end-of-lifed.



I got bit by MySQL reconnects on some other software I wrote I think when I
jumped from MySQL 4.* to 5.*. If memory serves, here is the relevant info from
the official MySQL documentation:

From: http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html

The reconnect flag in the MYSQL structure is set to 0 by mysql_real_connect().
Only those client programs which did not explicitly set this flag to 0 or 1
after mysql_real_connect() experience a change. Having automatic reconnection
enabled by default was considered too dangerous (due to the fact that table
locks, temporary tables, user variables, and session variables are lost after
reconnection).


This may explain why this is happening in Asterisk. In the case of my other
code the answer was not to keep a long term connection through idle periods.

Steve

_______________________________________________
-- 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

That's probably why I've never had timeout issues, I use
asterisk-addons-1.4 when I do use cdr_mysql and I think at one point
there WAS a problem, but there was a published fix from the
mysql_connect vs mysql_real_connect issue
Back to top
pezhman_lali at yahoo.com
Guest





PostPosted: Thu May 22, 2008 1:22 am    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

using odbc+( postgres or mysql) is more stable,
but at all odbc + postgres is recommended

--- Sherwood McGowan <sherwood.mcgowan at gmail.com>
wrote:

Quote:
Steve Prior wrote:
Quote:
Tilghman Lesher wrote:

Quote:
Correct; it's actually a workaround for a bug in
the MySQL drivers. It was
Quote:
Quote:
discovered long after 1.2 was end-of-lifed.



I got bit by MySQL reconnects on some other
software I wrote I think when I
Quote:
jumped from MySQL 4.* to 5.*. If memory serves,
here is the relevant info from
Quote:
the official MySQL documentation:

From:

http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html
Quote:
Quote:

The reconnect flag in the MYSQL structure is set
to 0 by mysql_real_connect().
Quote:
Only those client programs which did not
explicitly set this flag to 0 or 1
Quote:
after mysql_real_connect() experience a change.
Having automatic reconnection
Quote:
enabled by default was considered too dangerous
(due to the fact that table
Quote:
locks, temporary tables, user variables, and
session variables are lost after
Quote:
reconnection).


This may explain why this is happening in
Asterisk. In the case of my other
Quote:
code the answer was not to keep a long term
connection through idle periods.
Quote:

Steve

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

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:


http://lists.digium.com/mailman/listinfo/asterisk-users
Quote:
That's probably why I've never had timeout issues, I
use
asterisk-addons-1.4 when I do use cdr_mysql and I
think at one point
there WAS a problem, but there was a published fix
from the
mysql_connect vs mysql_real_connect issue

_______________________________________________
-- 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
Quote:
Back to top
abalashov at evaristes...
Guest





PostPosted: Thu May 22, 2008 1:41 am    Post subject: [asterisk-users] Asterisk Database Handling Reply with quote

Pezhman Lali wrote:

Quote:
using odbc+( postgres or mysql) is more stable,
but at all odbc + postgres is recommended

Really?

--
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 Previous  1, 2, 3  Next
Page 2 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