About

November 30th, 2009 Leave a comment Go to comments

This is my blog, I blog about anything I’m working on. Its almost entirely technical and the technologies I’ve mostly dealt with are C++, ColdFusion, Asterisk, iPhone Development, PHP and MySQL. You can contact me at eddie at edmundlong dot com.

  1. Ryan
    November 26th, 2009 at 01:12 | #1

    Hello Ed,

    I am current working on Asterisk on debian, right now I am trying to install and configure ODBC CDR. I am using version MySQL 5.0.51a. While creating table in asterisk DB, I run into a syntax error. It reads as follows: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ ’0000-00-00 00:00:00′, clid varchar(80) NOT NULL DEFAULT , src varchar(80)’ at line 2

    Is it possible for you to help me out with this?

    Thanks

    Ryan

  2. admin
    November 26th, 2009 at 05:07 | #2

    Hi Ryan,

    After some head-scratching I found the problem. Apparently there can’t be any spaces in the create table mysql statement. Just copy the mySQL below and you should be golden(it worked for me locally)

    CREATE TABLE cdr(calldate DATETIME NOT NULL,clid varchar(80) NOT NULL DEFAULT ‘aDefaultValue’,src varchar(80) NOT NULL DEFAULT ‘aDefaultValue’,dst VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,dcontext VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,channel VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,dstchannel VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,lastapp VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,lastdata VARCHAR(80) NOT NULL DEFAULT ‘aDefaultValue’,duration int(11) NOT NULL DEFAULT ’0′,billsec int(11) NOT NULL DEFAULT ’0′,disposition VARCHAR(45) NOT NULL DEFAULT ‘aDefaultValue’,amaflags int(11) NOT NULL DEFAULT ’0′,accountcode VARCHAR(20) NOT NULL DEFAULT ‘aDefaultValue’,uniqueid VARCHAR(32) NOT NULL DEFAULT ‘aDefaultValue’,userfield VARCHAR(255) NOT NULL DEFAULT ‘aDefaultValue’);

    I’ve updated the post on my blog to have this code and not the spaced out version.

  1. No trackbacks yet.

Anti-Spam Protection by WP-SpamFree