Posted: Fri Feb 25, 2005 3:53 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
Hi,
I have postgresql and * all up and running as the latest cvs-250205,
although something weird.
Every outgoing call regardless of whether or not it is answered or busy
or just rings out in the database the entry has the disposition as
ANSWERED, instead of BUSY or NOT ANSWERED.
As a test I intentionally rang numbers that would be busy or wouldn't be
there to answer the call.
Posted: Fri Feb 25, 2005 4:21 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
James Bean <james@hdcs.com.au> wrote:
[...]
Quote:
Every outgoing call regardless of whether or not it is answered or
busy or just rings out in the database the entry has the disposition
as ANSWERED, instead of BUSY or NOT ANSWERED.
Quote:
As a test I intentionally rang numbers that would be busy or
wouldn't be there to answer the call. Anyone got an idea where it
might be going wrong?
Are you using analogue lines? Such lines are considered "answered" as
soon as the number has been dialled by the Zaptel interface.
Posted: Fri Feb 25, 2005 4:59 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
Quote:
James Bean <james@hdcs.com.au> wrote:
[...]
> Every outgoing call regardless of whether or not it is answered or
> busy or just rings out in the database the entry has the
disposition
> as ANSWERED, instead of BUSY or NOT ANSWERED.
> As a test I intentionally rang numbers that would be busy
or wouldn't
> be there to answer the call. Anyone got an idea where it might be
> going wrong?
Are you using analogue lines? Such lines are considered
"answered" as soon as the number has been dialled by the
Zaptel interface.
--
Marriage: a souvenir of love.
Yes they are analogue lines.
I am sorry I did not see anything in any of the docs about analogue
lines causing ANSWERED response on all calls.
Could you point me in the right direction to a fix or setup that fixes
this situation?
Posted: Fri Feb 25, 2005 6:16 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
James Bean <james@hdcs.com.au> wrote:
[...]
Quote:
I am sorry I did not see anything in any of the docs about analogue
lines causing ANSWERED response on all calls. Could you point me in
the right direction to a fix or setup that fixes this situation?
The only real fix is to get some form of digital service, either ISDN
or VoIP. There is no reliable means to detect when a call has been
answered on an analogue line, so Asterisk doesn't bother trying.
The usual kludge for analogue PBXes is to assume that a call was
answered only if the recorded time is longer than a certain number of
seconds.
Posted: Fri Feb 25, 2005 7:13 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
Quote:
James Bean <james@hdcs.com.au> wrote:
[...]
> I am sorry I did not see anything in any of the docs about analogue
> lines causing ANSWERED response on all calls. Could you point me in
> the right direction to a fix or setup that fixes this situation?
The only real fix is to get some form of digital service,
either ISDN or VoIP. There is no reliable means to detect
when a call has been answered on an analogue line, so
Asterisk doesn't bother trying.
The usual kludge for analogue PBXes is to assume that a call
was answered only if the recorded time is longer than a
certain number of seconds.
Hhmm well that's annoying....
Is the kludge done at the software side when the data is pulled out for
accounting and being under say 45 seconds is a no answer or busy? Or is
there a tweak that can be done at the database itself?
So by that any calls that go out over the net using IAX to the telco are
considered digital and will report correctly?
Posted: Fri Feb 25, 2005 7:39 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
James Bean <james@hdcs.com.au> wrote:
[...]
Quote:
Is the kludge done at the software side when the data is pulled out
for accounting and being under say 45 seconds is a no answer or
busy? Or is there a tweak that can be done at the database itself?
Since you're using PostgreSQL, you can use a trigger to mangle the
data before it hits the database. In fact, there's no reason why you
couldn't log to a view rather than a table (but again, you will need a
trigger for the actual INSERT.)
For MySQL and other glorified flat-file databases, you would need to
postprocess the data. You may feel more confident skipping triggers
and doing this anyway.
Quote:
So by that any calls that go out over the net using IAX to the telco
are considered digital and will report correctly?
Yes. You will probably be able to make the simple assumption that if
dstchannel ILIKE 'Zap/%' , you're going to have to fudge it, otherwise
it's correctly recorded.
--
The intuitive mind is a sacred gift and the rational mind is a faithful
servant. We have created a society that honors the servant and has forgotten
the gift.
- Albert Einstein
Posted: Fri Feb 25, 2005 8:04 am Post subject: [Asterisk-Users] CDR writing incorrect data to pgsql tables
Quote:
For MySQL and other glorified flat-file databases, you would
need to postprocess the data. You may feel more confident
skipping triggers and doing this anyway.
> So by that any calls that go out over the net using IAX to
the telco
> are considered digital and will report correctly?
Yes. You will probably be able to make the simple assumption
that if dstchannel ILIKE 'Zap/%' , you're going to have to
fudge it, otherwise it's correctly recorded.
Thank you for your help sir it was very informative I am going to write
the trigger with my own rules for the database and see how I go :-)
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