19
19
<LINK REL="STYLESHEET" HREF="asterisk.css">
21
<LINK REL="next" HREF="node216.html">
21
22
<LINK REL="previous" HREF="node214.html">
22
<LINK REL="up" HREF="node213.html">
23
<LINK REL="up" HREF="node214.html">
23
24
<LINK REL="next" HREF="node216.html">
28
29
<DIV CLASS="navigation"><!--Navigation Panel-->
29
<A NAME="tex2html3449"
30
<A NAME="tex2html3463"
30
31
HREF="node216.html">
31
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
32
33
SRC="/usr/share/latex2html/icons/next.png"></A>
33
<A NAME="tex2html3445"
34
<A NAME="tex2html3459"
35
36
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
36
37
SRC="/usr/share/latex2html/icons/up.png"></A>
37
<A NAME="tex2html3441"
38
<A NAME="tex2html3453"
38
39
HREF="node214.html">
39
40
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
40
41
SRC="/usr/share/latex2html/icons/prev.png"></A>
41
<A NAME="tex2html3447"
42
<A NAME="tex2html3461"
43
44
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
44
45
SRC="/usr/share/latex2html/icons/contents.png"></A>
46
<B> Next:</B> <A NAME="tex2html3450"
47
HREF="node216.html">MYSQL</A>
48
<B> Up:</B> <A NAME="tex2html3446"
49
HREF="node213.html">MSSQL</A>
50
<B> Previous:</B> <A NAME="tex2html3442"
51
HREF="node214.html">ODBC using cdr_odbc</A>
52
<B> <A NAME="tex2html3448"
47
<B> Next:</B> <A NAME="tex2html3464"
48
HREF="node216.html">TDS, using cdr_tds</A>
49
<B> Up:</B> <A NAME="tex2html3460"
50
HREF="node214.html">Microsoft SQL Server</A>
51
<B> Previous:</B> <A NAME="tex2html3454"
52
HREF="node214.html">Microsoft SQL Server</A>
53
<B> <A NAME="tex2html3462"
53
54
HREF="node1.html">Contents</A></B>
56
57
<!--End of Navigation Panel-->
58
<H2><A NAME="SECTION001142000000000000000">
59
TDS, using cdr_tds</A>
61
Compile, configure, and install the latest FreeTDS package:
65
tar -zxvf freetds-0.62.4.tar.gz &&
66
cd freetds-0.62.4 &&
67
./configure --prefix=/usr --with-tdsver=7.0
70
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
72
</UL> Compile, or recompile, asterisk so that it will now add support
77
make clean && ./configure --with-tds &&
78
make update &&
81
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
83
</UL> Only install one database connector. Do not confuse asterisk
84
by using both ODBC (cdr_odbc) and FreeTDS (cdr_tds).
85
This command will erase the contents of cdr_odbc.conf
89
[ -f /etc/asterisk/cdr_odbc.conf ] > /etc/asterisk/cdr_odbc.conf
90
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
92
</UL> Setup cdr_tds configuration files. These are working samples
93
from my system. You will need to modify for your setup. Define
94
your usernames and passwords here, secure file as well.
98
/etc/asterisk/cdr_tds.conf
59
<H3><A NAME="SECTION001141100000000000000">
60
ODBC using cdr_odbc</A>
62
Compile, configure, and install the latest unixODBC package:
66
tar -zxvf unixODBC-2.2.9.tar.gz &&
67
cd unixODBC-2.2.9 &&
68
./configure --sysconfdir=/etc --prefix=/usr --disable-gui &&
71
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
75
Compile, configure, and install the latest FreeTDS package:
79
tar -zxvf freetds-0.62.4.tar.gz &&
80
cd freetds-0.62.4 &&
81
./configure --prefix=/usr --with-tdsver=7.0 \
82
--with-unixodbc=/usr/lib &&
83
make && make install
84
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
88
Compile, or recompile, asterisk so that it will now add support
93
make clean && ./configure --with-odbc &&
94
make update &&
97
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
101
Setup odbc configuration files. These are working examples
102
from my system. You will need to modify for your setup.
103
You are not required to store usernames or passwords here.
109
Description = FreeTDS ODBC driver for MSSQL
110
Driver = /usr/lib/libtdsodbc.so
111
Setup = /usr/lib/libtdsS.so
116
description = Asterisk ODBC for MSSQL
118
server = 192.168.1.25
122
language = us_english
123
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
127
Only install one database connector. Do not confuse asterisk
128
by using both ODBC (cdr_odbc) and FreeTDS (cdr_tds).
129
This command will erase the contents of cdr_tds.conf
133
[ -f /etc/asterisk/cdr_tds.conf ] > /etc/asterisk/cdr_tds.conf
134
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
136
</UL> NOTE: unixODBC requires the freeTDS package, but asterisk does
137
not call freeTDS directly.
140
Now set up cdr_odbc configuration files. These are working samples
141
from my system. You will need to modify for your setup. Define
142
your usernames and passwords here, secure file as well.
146
/etc/asterisk/cdr_odbc.conf
100
hostname=192.168.1.25
106
152
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
108
</UL> And finally, create the 'cdr' table in your mssql database.
154
</UL> And finally, create the 'cdr' table in your mssql database.
112
158
CREATE TABLE cdr (
113
[accountcode] [varchar] (20) NULL ,
114
[src] [varchar] (80) NULL ,
115
[dst] [varchar] (80) NULL ,
116
[dcontext] [varchar] (80) NULL ,
117
[clid] [varchar] (80) NULL ,
118
[channel] [varchar] (80) NULL ,
119
[dstchannel] [varchar] (80) NULL ,
120
[lastapp] [varchar] (80) NULL ,
121
[lastdata] [varchar] (80) NULL ,
122
[start] [datetime] NULL ,
123
[answer] [datetime] NULL ,
124
[end] [datetime] NULL ,
125
[duration] [int] NULL ,
126
[billsec] [int] NULL ,
127
[disposition] [varchar] (20) NULL ,
128
[amaflags] [varchar] (16) NULL ,
129
[uniqueid] [varchar] (150) NULL ,
130
[userfield] [varchar] (256) NULL
159
[calldate] [datetime] NOT NULL ,
160
[clid] [varchar] (80) NOT NULL ,
161
[src] [varchar] (80) NOT NULL ,
162
[dst] [varchar] (80) NOT NULL ,
163
[dcontext] [varchar] (80) NOT NULL ,
164
[channel] [varchar] (80) NOT NULL ,
165
[dstchannel] [varchar] (80) NOT NULL ,
166
[lastapp] [varchar] (80) NOT NULL ,
167
[lastdata] [varchar] (80) NOT NULL ,
168
[duration] [int] NOT NULL ,
169
[billsec] [int] NOT NULL ,
170
[disposition] [varchar] (45) NOT NULL ,
171
[amaflags] [int] NOT NULL ,
172
[accountcode] [varchar] (20) NOT NULL ,
173
[uniqueid] [varchar] (150) NOT NULL ,
174
[userfield] [varchar] (255) NOT NULL
132
176
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
134
</UL> Start asterisk in verbose mode, you should see that asterisk
135
logs a connection to the database and will now record every
136
call to the database when it's complete.
178
</UL> Start asterisk in verbose mode, you should see that asterisk
179
logs a connection to the database and will now record every
180
call to the database when it's complete.
184
<DIV CLASS="navigation"><HR>
185
<!--Navigation Panel-->
186
<A NAME="tex2html3463"
188
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
189
SRC="/usr/share/latex2html/icons/next.png"></A>
190
<A NAME="tex2html3459"
192
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
193
SRC="/usr/share/latex2html/icons/up.png"></A>
194
<A NAME="tex2html3453"
196
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
197
SRC="/usr/share/latex2html/icons/prev.png"></A>
198
<A NAME="tex2html3461"
200
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
201
SRC="/usr/share/latex2html/icons/contents.png"></A>
203
<B> Next:</B> <A NAME="tex2html3464"
204
HREF="node216.html">TDS, using cdr_tds</A>
205
<B> Up:</B> <A NAME="tex2html3460"
206
HREF="node214.html">Microsoft SQL Server</A>
207
<B> Previous:</B> <A NAME="tex2html3454"
208
HREF="node214.html">Microsoft SQL Server</A>
209
<B> <A NAME="tex2html3462"
210
HREF="node1.html">Contents</A></B> </DIV>
211
<!--End of Navigation Panel-->