login | register
Sat 17 of May, 2008 [07:17 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Juan Ortega, Thu 15 of May, 2008 [10:33 UTC]: Hi everybody, I'm Juan, an ITCom student, and I need to know what basic elements I need to create a VoIP network. Can anybody helpme, please?,Thank you very much
  • gineta, Wed 14 of May, 2008 [03:58 UTC]: any here not fine the configuration of firewall juniper -screem for VOIP asterisk????
  • Anoop Prabhakaran, Tue 13 of May, 2008 [12:16 UTC]: I am developing Asterisk IVR, Whenever i make a internation call to the IVR system, the DTMF is not getting detected properly, this happens only for the first time, second call onwards system works fine. why this is happening
  • joe, Mon 12 of May, 2008 [04:27 UTC]: Is there an opensource browser based softphone, or a system like Busta where everything is not manages through their website?
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
Server Stats
  • Execution time: 0.49s
  • Memory usage: 2.24MB
  • Database queries: 34
  • GZIP: Disabled
  • Server load: 0.59

Asterisk cdr odbc

Asterisk CDR with almost any database

There is a module called cdr_odbc that supports the unixODBC library. ODBC is a standard interface between an application and a database. The unixODBC library supports many databases, from MySQL and MS SQL Server to text files. The cdr_odbc also adds functionality for a more stable connection to the database: If the database connection is lost, cdr_odbc automatically reconnects.

Install ODBC


First you need unixODBC installed. You can install it with the --disable-gui if you don't have/want X. Lots of people have had problems with use ODBC from RPMs, so when possible, please use the ODBC source package.

unixODBC install instructions:

 cd /usr/src
 tar zxf unixODBC-2.2.7.tar.gz
 cd unixODBC-2.2.7
 ./configure --disable-gui
 make
 make install
 

Using ODBC with MySQL

Now you need to configure your datasource. If you choose to use MySQL you need to install MyODBC

MySQL ODBC Install Help

http://dev.mysql.com/doc/connector/odbc/en/faq_2.html

MySSQL ODBC 3.51 Download Page

http://dev.mysql.com/downloads/connector/odbc/3.51.html

IODBC (Required by MySQL ODBC)

http://www.iodbc.org/index.php?page=downloads/index


Configuring ODBC

Basic odbcinst.ini:

This is where you configure your various odbc drivers.

 [MySQL]
 Description     = MySQL ODBC MyODBC Driver
 Driver          = /usr/lib/libmyodbc3.so
 FileUsage       = 1

 [Text]
 Description     = ODBC for Text Files
 Driver          = /usr/lib/libodbctxt.so
 Setup           = /usr/lib/libodbctxtS.so
 FileUsage       = 1
 CPTimeout       =
 CPReuse         =

 [PostgreSQL]
 Description     = PostgreSQL driver for Linux & Win32
 Driver          = /usr/lib/libodbcpsql.so
 Setup           = /usr/lib/libodbcpsqlS.so
 FileUsage       = 1

 [DB2]
 Description     = DB2 Driver
 Driver          = /opt/IBM/db2/V8.1/lib64/libdb2.so
 FileUsage       = 1
 DontDLClose     = 1
 DMEnvAttr       = SQL_ATTR_UNIXODBC_ENVATTR={DB2INSTANCE=db2inst1}



Note: you may have to change the path to the .so files depending on where they are installed.
Default location for Suse 10: /usr/lib/unixODBC

Basic odbc.ini:

This is where you configure your datasources.

 [MySQL-asterisk]
 Description     = MySQL ODBC Driver Testing
 Driver          = MySQL
 Socket          = /var/run/mysqld/mysqld.sock
 Server          = localhost
 User            = username
 Password        = password
 Database        = database
 Option          = 3
 #Port           =

 [Text-asterisk]
 Description     = ODBC for Text Files test
 Driver          = Text
 Database        = /root/flatfile
 Trace           = Yes
 Tracefile       = /root/trace.log

 [PostgreSQL-asterisk]
 Description         = Test to Postgres
 Driver              = PostgreSQL
 Trace               = Yes
 TraceFile           = sql.log
 Database            = asterisk
 Servername          = localhost
 UserName            = username
 Password            = password
 Port                = 5432
 Protocol            = 7.4
 ReadOnly            = No
 RowVersioning       = No
 ShowSystemTables    = No
 ShowOidColumn       = No
 FakeOidIndex        = No
 ConnSettings        =

[DB2-asterisk]
 Database = astdb
 Driver = DB2

Configuring Asterisk


cdr_odbc.conf:

 [global]
 dsn=MySQL-asterisk
 username=username
 password=password
 loguniqueid=yes


Setting up the CDR Database/Table


Table Setup for Specific DB's:

Postgres:

CREATE TABLE cdr (
  calldate timestamp with time zone NOT NULL default now(),
  clid varchar(80) NOT NULL default '', 
  src varchar(80) NOT NULL default '', 
  dst varchar(80) NOT NULL default '', 
  dcontext varchar(80) NOT NULL default '', 
  channel varchar(80) NOT NULL default '', 
  dstchannel varchar(80) NOT NULL default '', 
  lastapp varchar(80) NOT NULL default '', 
  lastdata varchar(80) NOT NULL default '', 
  duration bigint NOT NULL default '0', 
  billsec bigint NOT NULL default '0', 
  disposition varchar(45) NOT NULL default '', 
  amaflags bigint NOT NULL default '0', 
  accountcode varchar(20) NOT NULL default '', 
  uniqueid varchar(32) NOT NULL default '', 
  userfield varchar(255) NOT NULL default '' 
);

Mysql:

CREATE TABLE cdr (
 calldate datetime NOT NULL default '0000-00-00 00:00:00',
 clid varchar(80) NOT NULL default '',  
 src varchar(80) NOT NULL default '',  
 dst varchar(80) NOT NULL default '',  
 dcontext varchar(80) NOT NULL default '',  
 channel varchar(80) NOT NULL default '',  
 dstchannel varchar(80) NOT NULL default '',  
 lastapp varchar(80) NOT NULL default '',  
 lastdata varchar(80) NOT NULL default '',  
 duration int(11) NOT NULL default '0',  
 billsec int(11) NOT NULL default '0',  
 disposition varchar(45) NOT NULL default '',  
 amaflags int(11) NOT NULL default '0',  
 accountcode varchar(20) NOT NULL default '',  
 uniqueid varchar(32) NOT NULL default '',  
 userfield varchar(255) NOT NULL default ''  
);

DB2:

CREATE TABLE cdr (
 calldate timestamp NOT NULL default current timestamp,
 clid varchar(80) NOT NULL default '',
 src varchar(80) NOT NULL default '',
 dst varchar(80) NOT NULL default '',
 dcontext varchar(80) NOT NULL default '',
 channel varchar(80) NOT NULL default '',
 dstchannel varchar(80) NOT NULL default '',
 lastapp varchar(80) NOT NULL default '',
 lastdata varchar(80) NOT NULL default '',
 duration bigint NOT NULL default 0,
 billsec bigint NOT NULL default 0,
 disposition varchar(45) NOT NULL default '',
 amaflags bigint NOT NULL default 0,
 accountcode varchar(20) NOT NULL default '',
 uniqueid varchar(32) NOT NULL default '',
 userfield varchar(255) NOT NULL default ''
);



.....More info coming.


See also:



Created by bkw, Last modification by Ivan F. Martinez on Tue 07 of Feb, 2006 [03:06 UTC]

Comments Filter

HELP!!!!!!! how to connect SQL SERVER 2005 with Asterisk?

by simi on Monday 15 of October, 2007 [11:12:59 UTC]
i want to know how to connect Asterisk with SQL SERVER..... i think its through ODBC but how??? i want to store CDR in SQL SERVER

starting asterisk with mysql-db

by peletiah on Tuesday 05 of July, 2005 [21:30:42 UTC]
this may be a bit newbieish but i just don't know where to start. i've configured odbc and mysql as stated above - so how do i tell asterisk to use those entries? trying to start /usr/sbin/asterisk -vvvvvgc but only get:

app_voicemail.so => (Comedian Mail (Voicemail System))
 == Registered application 'VoiceMail'
 == Registered application 'VoiceMail2'
 == Registered application 'VoiceMailMain'
 == Registered application 'VoiceMailMain2'
 == Registered application 'MailboxExists'
 == Parsing '/etc/asterisk/voicemail.conf': Found
   — Logging into database with user test, password test, and database vmdb
Jul 5 23:26:40 WARNING20079: /var/tmp/portage/asterisk-1.0.8/work/asterisk-addons-1.0.8/mysql-vm-r:20 mysql_login: Error Logging into databaseJul 5 23:26:40 WARNING20079: app_voicemail.c:4366 load_module: SQL init
Jul 5 23:26:40 WARNING20079: loader.c:345 ast_load_resource: app_voicemail.so: load_module failed, returning -1
 == Unregistered application 'VoiceMail'
 == Unregistered application 'VoiceMail2'
 == Unregistered application 'VoiceMailMain'
 == Unregistered application 'VoiceMailMain2'
 == Unregistered application 'MailboxExists'
Jul 5 23:26:40 WARNING20079: loader.c:440 load_modules: Loading module app_voicemail.so failed!
Ouch ... error while writing audio data: : Broken pipe
asterisk asterisk #

PostgreSQL should use text field

by kleptog on Tuesday 22 of March, 2005 [13:04:00 UTC]
Instead of varchar() you should use text for the text fields. It makes no difference in the performance (if anything it's faster) and you remove the risk of losing a record due to a value being too long...
Edit

Nick Gorham

by Anonymous on Monday 15 of November, 2004 [09:32:39 UTC]
Hi, just a small point about the MySQL install, it doesn't have to use iODBC it just depends on what its (MyODBC) built against. One of the first developers of unixODBC is now workign on MyODBC so, FWIW. (:biggrin:)

MSSQL CDR files: /etc/odbc.ini /etc/odbcinst.ini

by duanecox on Thursday 22 of July, 2004 [15:37:07 UTC]
/etc/odbcinst.ini

FreeTDS
Description = FreeTDS ODBC driver for MSSQL
Driver = /usr/lib/libtdsodbc.so
Setup = /usr/lib/libtdsS.so
FileUsage = 1


/etc/odbc.ini

MSSQL-asterisk
description =
driver = FreeTDS
server = localhost
port = 1433
database = asterisk
username = username
password = password
tds_version = 7.0
language = us_english
trace = yes
tracefile = /root/mssql.trace


I am working on geting asterisk to store CDR records in an MSSQL database. If you need any more information, please feel free to email me at dcox@illicom.net

Edit

Mysql syntax is incorrect

by Anonymous on Thursday 27 of May, 2004 [17:36:50 UTC]
From http://sql-info.de/mysql/gotchas.html

"It is not possible to create a column with a default value which is a function or expression, such as NOW()"

Other sources suggest using a timestamp field, which of course doesn't give you a readable date, just a large integer...



Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver