[asterisk-users] Record CDR in a Oracle database
Tim Panton
tim at mexuar.com
Sat Jun 16 02:52:15 CDT 2007
On 12 Jun 2007, at 20:04, Everton Goularth wrote:
> Hello All,
>
> How can I do to record my asterisk's CDR in a Oracle database?
>
> I have to use unixODBC?
>
> Can anybody send me a step to step to do this configuration?
>
> Thank's All
>
> Everton Goularth
I've just been doing some work on getting realtime to talk to a
remote oracle XE (not cdr though)
Here's what I needed:
1) oracle running somewhere (I used XE - its free - as in lunch :-) )
2) unix odbc installed (I used unixODBC-2.2.11-x86-linux-rh9.tar.gz )
3) asterisk built for odbc
4) oracle 'instantclient' for linux (oracle-instantclient-
basic-10.2.0.3-1.i386.rpm
downloadable from oracle.com)
5) a working sqlnet connection between my asterisk and oracle boxes
I used sqlplus to test it. (oracle-instantclient-
sqlplus-10.2.0.3-1.i386.rpm from oracle.com)
Make sure you configure a tnsnames.ora somewhere.
6) odbc driver for oracle - (I used instantclient-odbc-
linux32-10.2.0.3-20061115.zip from oracle.com)
Make sure isql will talk to your oracle. I needed to set the
following environment vars:
ORACLE_SID=XE
TNS_ADMIN=/home/thp
PATH=/usr/local/bin:/usr/lib/oracle/client/10.2.0.3/bin:${PATH}
LD_LIBRARY_PATH=/usr/local/lib/:/usr/lib/oracle/10.2.0.3/client/lib/:/
home/thp/instantclient_10_2
And I had to edit /usr/local/etc/odbc.ini to set my Oracle SID
ServerName = XE
7) now configure asterisk to use odbc (follow the advice in www.voip-
info.org)
8) create suitable users/tables in oracle (follow the advice in
www.voip-info.org) remembering to
use VARCHAR2 instead of varchar
9) make sure that the environment vars above are set, then start
asterisk.
use netstat on your oracle system to check for an active connection
to 1521 from your asterisk.
- you should be good to go.....
I've only used it for realtime iaxusers not for anything else yet. I
also have no clue how robust it is,
but I'll no-doubt find out soon !
Good luck..
Tim.
Tim Panton
www.mexuar.net
www.westhawk.co.uk/
More information about the asterisk-users
mailing list