Search:
Asterisk app_dbodbc
app_dbodbc
This is original Brian's re-implementation of the Asterisk database using unixODBC.This allows for easy creation of dialplan modifiers that link into a GUI with a back-end database.
Download Brian's Version (patched to work with 1.0RC1 and above)
- http://www.asterisk-support.de/mirror/odbc/app_dbodbc.c.orig (rename it to app_dbodbc.c)
Download modified version to work with Asterisk 1.0RC1 and above. This version is also extended by Rob Fugina (ODBCLookupCIDName, ODBCLookupBlacklist) and Jukka Laaksola (database recconnect function).
or
Download modified version to work with asterisk cvs-head. This version is modified by Gregory Nietsky. Also a patch for realtime.
Install
rpm -ivh unixODBC*rpmrpm -ivh MyODBC*rpm
cp app_dbodbc.c /usr/src/asterisk/apps/
vi /usr/src/asterisk/apps/Makefile +28
add in the end of line: app_dbodbc.so
vi /usr/src/asterisk/apps/Makefile +110
app_dbodbc.so: app_dbodbc.o
$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
cd /usr/src/asterisk
make
make install
Configure
This assumes using MySQL database on RedHat - will vary for other DBs & slightly for other OS's.Configure MySQL:
- Add a database called 'asterisk'
- Create a user with full read/write access to this database
- Add a table within this database called 'astdb'
- Add 3 fields to the structure of this table: 'astfamily', 'astkey' & 'astvalue'
vi /etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
vi /etc/odbc.ini
[MySQL-asterisk]
Description = MySQL Asterisk database
Trace = Off
TraceFile = stderr
Driver = MySQL
SERVER = localhost
USER =
PASSWORD =
PORT = 3306
DATABASE = asterisk
Test ODBC:
isql -v MySQL-asterisk myusername mypassword
vi /etc/asterisk/odbc.conf
[global]
dsn=MySQL-asterisk
username=myusername
password=mypassword
Usage
- ODBCget(varname=family/key):
- ODBCput(family/key=value):
- ODBCdel(family/key):
- ODBCdeltree(family[/keytree]):
and if you use the extented version:
- ODBCLookupCIDName:
- ODBCLookupBlacklist:
See also
- Asterisk database
- Asterisk configuration from database
- Asterisk GUI
- unixODBC
- Asterisk cdr odbc - has some general info on configuring unixODBC
- Asterisk | FAQ | Tips & Tricks

Page Changes
