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.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Apr | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | |||
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
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.
hello eddy
i am freddy and i am working in a small proyecto with asterisk, i install ubuntu, asterisk, php5, php-agi….the asterisk is working i can do a external call and transfer to one sip phone, but i have problem whit php-agi i can not do working,,,i need some helpme has freelance and i dont know is you has time and interest in working in this proyect.
the proyect es basic recive a external call, search in db, see if register and he has credit, and transfer the call and control the time in function his credit…..i prefer work with two server, one asterisk and another for de db…
i need somebody guide step by step to do all this…..and better the program…..i read several example..but i can do working the agi….i supose is a configuration problem…
i’ll hope your are interest, and i’ll apreciate if you can estimate the cost
my regards.
freddy