Mysql-CDR Logging

Hi There Everyone

Can anybody help me in setting up CDR logging with MYSQL or provide a step by step method on doing so
I have Asterisk Version 1.4.23.1 running on a Eneteprise Linux 5

and if possible please post the config files too !

quick replies will b appreciated because i need a quick solution
Thanks in advance :smile:

I think you’ll find your new best friend… here

Ive Tried that already !
not workin for me ! :frowning:

Ive been going crazy since 2 days
please help me out guys

Give me a step by step method on enabling cdr-mysl on asterisk 1. 4.23 EL5

here is my cli

localhost*CLI> cdr status
CDR logging: enabled
CDR mode: simple
CDR output unanswered calls: yes
CDR registered backend: cdr_manager

Hi,

Have you looked at this post?

forums.digium.com/viewtopic.php?t=21911

Cheers

Brett

What do the commands

and

show you?

ok now i have the modules registered
i noticed i didnt have unixodbc installed for that

neway

cdr mysql status show me that i was connected to the mysql server
but now when i restarted asterisk

it says not connect to a MYSQL server ???

y is that so ?

You only need unixODBC if you’re going to be connecting to your MySQL db through ODBC rather than using the cdr_mysql module.

Anyway, can you start asterisk with ‘asterisk -cvvvvv’. You should see a bunch of lines scroll by. Find the bit relating to your cdr and paste it here.

What Would i have to do if i have a scenario like

I want to Subtract the ${CDR(duration)} time from the ${CDR(billsec)} time and display the result time in the ${CDR(userfield)}.

???
:wink:

Easy.

voip-info.org/wiki/view/Asterisk+func+math

CDR(userfield)=MATH(${CDR(duration)}-${CDR(billsec)});

Although this seems like a bit of a waste of the userfield. If you’re going to be showing the CDR on the web using PHP or something you’re better off letting PHP calc the result.

Or just get something that does it for you areski.net/asterisk-stat-v2/about.php

[code][ani-callback]

exten => s,1,Background(vm-enter-num-to-call)
exten => s,2,Read(NUMBER,1)
exten => s,n,Set(exten=${exten}${NUMBER})
exten => s,n,GosubIf($["${NUMBER:-1}" != “”]?2:5)
exten => s,5,Playback(/var/lib/asterisk/sounds/followme/pls-hold-while-try)
exten => s,n,MixMonitor(wav,f-${exten})
exten => s,n,Dial(SIP/${exten},g)
exten => s,n,Set(CDR(userfield)=MATH(${CDR(duration)}-${CDR(billsec)})) [/code]

is this context correct ?
will it set the userfield to as i want it to ?
if not please let me know how it will !
thanks for the replies !

This is the CLI Output

 == Begin MixMonitor Recording SIP/1111-084782a0
    -- Called 2222
    -- SIP/2222-08473708 is ringing
    -- SIP/2222-08473708 answered SIP/1111-084782a0
    -- Executing [s@ani-callback:8] Set("SIP/1111-084782a0", "CDR(userfield)=MATH(0-0") in new stack

the billsec and duration are showing times as 0 . ??[/quote]