MySQL CDR missing clid [solved]

I just setup a Asterisk 1.6.0.5 with MySQL support. All CDR write to MySQLDB. But there is no clid. Other CDR information, like src, date… are all correct.

Here I give more info about my setup:

  1. cdr_mysql.conf

[quote][global]
hostname=localhost
dbname=asterisk
table=cdr
password=myRealPassword
user=asterisk
;port=3306
sock=/tmp/mysql.sock

;
; Older versions of cdr_mysql set the calldate field to whenever the
; record was posted, rather than the start date of the call. This flag
; reverts to the old (incorrect) behavior. Note that you’ll also need
; to comment out the “start=calldate” alias, below, to use this.
;compat=no
;
; ssl connections (optional)
;ssl_ca=
;ssl_cert=
;ssl_key=
;
; You may also configure the field names used in the CDR table.
;
[aliases]
start=calldate
callerid=clid
;src=src
;dst=dst
;dcontext=dcontext
;channel=channel
;dstchannel=dstchannel
;lastapp=lastapp
;lastdata=lastdata
;duration=duration
;billsec=billsec
;disposition=disposition
;amaflags=amaflags
;accountcode=accountcode
;userfield=userfield
;uniqueid=uniqueid
[/quote]

  1. MySQL CDR table:

[quote]mysql> DESC cdr;
±------------±-------------±-----±----±--------------------±------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------------------±------+
| calldate | datetime | | MUL | 0000-00-00 00:00:00 | |
| clid | varchar(80) | | | | |
| src | varchar(80) | | | | |
| dst | varchar(80) | | MUL | | |
| dcontext | varchar(80) | | | | |
| channel | varchar(80) | | | | |
| dstchannel | varchar(80) | | | | |
| lastapp | varchar(80) | | | | |
| lastdata | varchar(80) | | | | |
| duration | int(11) | | | 0 | |
| billsec | int(11) | | | 0 | |
| disposition | varchar(45) | | | | |
| amaflags | int(11) | | | 0 | |
| accountcode | varchar(20) | | MUL | | |
| userfield | varchar(255) | | | | |
| uniqueid | varchar(32) | | | | |
±------------±-------------±-----±----±--------------------±------+
16 rows in set (0.00 sec)[/quote]

  1. extensions.conf

[quote][from-trunk] ;incoming call handling
exten => 6042885566,1,NoOP(-----------------------${CDR(clid)}-------------)
exten => 6042885566,n,Macro(stdexten,1002,SIP/1002,r)
[/quote]

  1. CDR table clid

[quote]mysql> select clid from cdr;
±-----+
| clid |
±-----+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
±-----+
42 rows in set (0.00 sec)[/quote]

I can’t figure out how this can be happen. When a incoming call arrive, I see on the CLI that the NoOP show the caller’s name and number. But later I check the MySQL, the CallerID name and number (field clid) is blank.

Please help.

Thanks.

solved.

Why can’t you tell us what the problem was. :smile:

May be it could be a lesson to us as well.

What was your solution?