[asterisk-users] Authorize & Microsoft SQL
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Fri Dec 19 17:50:24 CST 2008
On Thursday 18 December 2008 21:37:29 Gregory Malsack wrote:
> I have an installation where the client has a Microsoft SQL database that
> holds all of their case information. They would like the asterisk system to
> require users to enter a valid case number when making an outgoing call.
> I’m seeing some documentation regarding people using Microsoft SQL for CDR
> storage, however nothing regarding validating authentication using a
> Microsoft SQL database.
Install tdsodbc and UnixODBC. Configure UnixODBC:
odbcinst.ini:
[TDS]
Driver = /usr/lib/odbc/libtdsodbc.so
odbc.ini:
[windows]
Driver=TDS
tds_version=8.0
Server=192.168.1.150
Database=asterisk
Port=1433
res_odbc.conf:
[sqlserver]
dsn=windows
pooling=yes
limit=100
username=oscar
password=thegrouch
pre-connect => yes
sanitysql => select count(*) from systables
func_odbc.conf:
[WHATEVER]
dsn=sqlserver
read=SELECT foo FROM bar WHERE baz='${SQL_ESC(${ARG1})}'
write=UPDATE bar SET foo='${SQL_ESC(${VAL1})}' WHERE baz='${SQL_ESC(${ARG1})}'
extensions.conf:
exten => 123,1,Set(foo=${ODBC_WHATEVER(${CALLERID(num)})})
exten => 456,1,Set(ODBC_WHATEVER(${CALLERID(num)})=someotherfoo)
--
Tilghman
More information about the asterisk-users
mailing list