MySQL_CDR Problem

Hi all,

I am using MySQL for mysql_cdr. I have very strange issue, while destination is ringing and caller disconnect the phone without any conversation, i can see in cdr of mysql the duration is starting and for this customer are charged without any calls.

Any can suggest me how i can stop this issue i checked with my sipprovider (MCI) and they monitor the call but the told our GW is not sending call connect message while remote is ringing so it means there is some mis configuration my Asterisk.

I will appriciate your kinds of help and idea.



Any suggestion 8)

I think I know what you mean.

The CDR for the call is calculated from when the time the call is delivered to the other end (ringing). You’ll need to set the userfield and play with a couple of call variables.

cdr_mysql.conf shoudl look something like this

In your dialplan you’ll need to do this:
exten => h,1,Set(CDR(userfield)=$[${DIALEDTIME} - ${ANSWEREDTIME}])

Read the variable.README file in the doc directory of the asterisk source code regarding the variable evaluation and stuff…

this userfield in this case, shows the time the call was ringing before it was picked up - if it wasn’t picked up it shows the same value as the call length. you’ll then have to do your own code to not bill the stuff that wasn’t answered…

If that’s what you were looking for :smile: