<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1476" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2>This
particular config (I don't think?) won't log to a DB, additionally you need to
setflag(1); somewhere in your config. We tried to set on "outbound" only
originally and didn't have much luck so I set it near the top. To log to (my)sql
you will additionally need to set another flag and setup similar mod
params:</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>modparam("acc", "db_url",
"mysql://ser:serro@blah.mysql.haha/dbname")<BR># Note flag 2, you will need to
setflag(1); AND setflag(2);</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>modparam("acc", "db_flag", 2)<BR></DIV></FONT></SPAN>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2>#Note
this one logs all failed calls from the invite response, I find it
useful</DIV></FONT></SPAN>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>modparam("acc", "failed_transactions", 1)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2># In
your route config use something like the following</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2># This
is pretty much near the top, while ACC won't log reg's or INFO anyway, I just
thought it'd be a little cleaner to have</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>...</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2>if
(!method == "REGISTER" || !method == "INFO" )
{<BR>
setflag(1);<BR>
setflag(2);</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>}</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2>...</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2>#
Doing the above ensure everything gets tagged including BYE's. A good reason why
your BYE's may not get</FONT></SPAN></DIV>
<DIV><SPAN class=999040613-26042005><FONT face=Arial color=#0000ff size=2>#
tagged is possibly because record-route could be relaying the call before the
flag gets set, just a thought..</DIV></FONT></SPAN>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Edgardo O.
Gonzales II [mailto:edgardo.g@pacific.net.ph] <BR><B>Sent:</B> Tuesday, April
26, 2005 1:29 AM<BR><B>To:</B> Kofi Obiri-Yeboah<BR><B>Cc:</B>
serusers@lists.iptel.org<BR><B>Subject:</B> RE: [Serusers] ACC into
mysql<BR><B>Importance:</B> High<BR><BR></FONT></DIV><BR>Thanks again for your
help .. Here's my running ser.cfg<BR>Hope you can help me make my accounting
work..
<BR><BR>thanks,<BR>ed<BR><BR>================================================================<BR>#
----------- global configuration parameters
------------------------<BR><BR>#debug=3<BR>#fork=yes<BR>#log_stderror=no<BR><BR>#debug=7<BR>#fork=no<BR>#log_stderror=yes<BR><BR>check_via=no<BR>dns=no<BR>rev_dns=no<BR>#port=5060<BR>#children=4<BR>fifo="/tmp/ser_fifo"<BR><BR>#
------------------ module loading
----------------------------------<BR><BR>loadmodule
"/usr/local/ser/lib/ser/modules/mysql.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/sl.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/tm.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/rr.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/maxfwd.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/usrloc.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/registrar.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/auth.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/auth_db.so"<BR>loadmodule
"/usr/local/ser/lib/ser/modules/acc.so"<BR><BR># ----------------- setting
module-specific parameters ---------------<BR><BR># -- usrloc params
--<BR><BR>modparam("usrloc", "db_mode", 1)<BR>modparam("usrloc",
"db_url","mysql://ser:heslo@localhost/ser")<BR><BR># -- auth params
--<BR><BR>modparam("auth_db", "calculate_ha1", yes)<BR>modparam("auth_db",
"password_column", "password")<BR><BR># -- rr params --<BR><BR>modparam("rr",
"enable_full_lr", 1)<BR><BR># -- acc params --<BR><BR>modparam("acc",
"log_level", 1)<BR>modparam("acc", "log_flag", 1)<BR>modparam("acc",
"log_missed_flag", 3)<BR><BR># ------------------------- request routing
logic -------------------<BR><BR>alias=abc.com.ph<BR><BR># main routing
logic<BR><BR>route{<BR> if
(!mf_process_maxfwd_header("10"))
{<BR>
sl_send_reply("483","Too Many
Hops");<BR>
break;<BR>
};<BR> if ( msg:len > max_len )
{<BR>
sl_send_reply("513", "Message too
big");<BR>
break;<BR>
};<BR><BR>
record_route();<BR> if
(loose_route())
{<BR>
t_relay();<BR>
break;<BR>
};<BR><BR> if (uri=~"abc.com.ph")
{<BR>
if (method=="REGISTER")
{<BR>
if (!www_authorize("abc.com.ph", "subscriber"))
{<BR>
www_challenge("abc.com.ph",
"0");<BR>
break;<BR>
};<BR><BR>
save("location");<BR>
break;<BR>
};<BR><BR>
lookup("aliases");<BR><BR>
if (!lookup("location"))
{<BR>
sl_send_reply("404", "Not
Found");<BR>
break;<BR>
};<BR>
};<BR> if (!t_relay())
{<BR>
sl_reply_error();<BR>
};<BR><BR>}<BR><BR><BR><BR><BR>================================================================<BR>At
10:55 AM 4/26/2005, Kofi Obiri-Yeboah wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT face=arial color=#0000ff
size=2>I am assuming your question is if the record_route() function is a
parameter for accounting? If that was your question then the answer is no.
Generally you invoke record_route() to ensure acl acceptance on a gateway
(i.e. all calls through that gateway)<BR></FONT>
<DL>
<DD><FONT face=tahoma size=2>-----Original Message-----<BR>
<DD>From:</B> Edgardo O. Gonzales II [<A
href="mailto:edgardo.g@pacific.net.ph" eudora="autourl">
mailto:edgardo.g@pacific.net.ph</A>]<BR>
<DD>Sent:</B> Monday, April 25, 2005 6:22 PM<BR>
<DD>To:</B> Kofi Obiri-Yeboah<BR>
<DD>Cc:</B> serusers@lists.iptel.org<BR>
<DD>Subject:</B> RE: [Serusers] ACC into mysql<BR><BR></FONT><BR>
<DD>Hi Kofi!<BR><BR>
<DD>got it.. thanks for immediate feedback .. however my accounting is not
working.<BR>
<DD>any parameters to be added to make it work..<BR><BR>
<DD>I have the following info already on my ser.cfg<BR><BR>
<DD>modparam("acc", "log_level", 1)<BR>
<DD>modparam("acc", "log_flag", 1)<BR>
<DD>modparam("acc", "log_missed_flag", 3)<BR><BR><BR>
<DD>record_route(); -> its this a parameter for accounting<BR><BR>
<DD>thanks,<BR>
<DD>ed<BR><BR><BR>
<DD>At 08:32 AM 4/26/2005, Kofi Obiri-Yeboah wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite">
<DD><FONT face=arial color=#0000ff size=2>I think the correct modparam
statement should read as follows:<BR></FONT>
<DD>modparam("acc", "db_url", "mysql://ser:heslo@localhost/ser")<BR></B>
<DD><BR>
<DD><FONT face=arial size=2>please note that "my" is required in front
of sql<BR></B></FONT>
<DD><BR>
<DD><FONT face=arial size=2>and not:<BR>
<DD>modparam("acc", "db_url",
"sql://ser:heslo@localhost/ser")</B></FONT> <FONT face=arial
color=#0000ff size=2><BR><BR></FONT>
<DL>
<DD><FONT face=tahoma size=2>-----Original Message-----
<DD>From: serusers-bounces@lists.iptel.org [ <A
href="mailto:serusers-bounces@lists.iptel.org%5DOn"
eudora="autourl">mailto:serusers-bounces@lists.iptel.org]On</A> Behalf Of
Edgardo O. Gonzales II
<DD>Sent: Monday, April 25, 2005 5:20 PM
<DD>To: serusers@lists.iptel.org
<DD>Subject: Re: [Serusers] ACC into mysql<BR><BR></FONT>
<DD>Hi all!<BR>
<DD>Im also receiving this error message.<BR>
<DD>Can somebody help us on how to make accounting work using
mysql.<BR>
<DD>thanks,
<DD>ed<BR>
<DD>At 06:01 AM 4/26/2005, Leon Sun wrote:
<BLOCKQUOTE class=cite cite="" type="cite">
<DD><FONT face=arial size=2>Hi,
<DD>I am using 0.8.12 in Fedora 3. I tried to log account info into
Mysql followed instruction from manual. I found, first,
modparam("acc", "db_url", "sql://ser:heslo@localhost/ser") coudnlt
work at all in ser.cfg. If I enabled in cfg file, it showed
Starting ser: ERROR: bad config file (1 errors)<BR>
<DD>
<DD>If I disabled it, SER worked fine but I couldnt see any record
in acc table. <BR>
<DD>
<DD>Would anyone suggest how to put call records into Mysql? <BR>
<DD>
<DD>Thank you.<BR>
<DD> <BR>
<DD> <BR>
<DD>
<DD># ----------- global configuration parameters
------------------------<BR>
<DD>
<DD>#debug=3 # debug
level (cmd line: -dddddddddd)
<DD>#fork=yes
<DD>#log_stderror=no #
(cmd line: -E)<BR>
<DD>
<DD>/* Uncomment these lines to enter debugging mode
<DD>debug=7
<DD>fork=no
<DD>log_stderror=yes
<DD>*/<BR>
<DD>
<DD>check_via=no # (cmd. line: -v)
<DD>dns=no
# (cmd. line: -r)
<DD>rev_dns=no # (cmd. line: -R)
<DD>#port=5060
<DD>#children=4
<DD>fifo="/tmp/ser_fifo"<BR>
<DD>
<DD># ------------------ module loading
----------------------------------<BR>
<DD>
<DD># Uncomment this if you want to use SQL database
<DD>loadmodule "/usr/lib/ser/modules/mysql.so"<BR>
<DD>
<DD>loadmodule "/usr/lib/ser/modules/acc.so"
<DD>loadmodule "/usr/lib/ser/modules/sl.so"
<DD>loadmodule "/usr/lib/ser/modules/tm.so"
<DD>loadmodule "/usr/lib/ser/modules/rr.so"
<DD>loadmodule "/usr/lib/ser/modules/maxfwd.so"
<DD>loadmodule "/usr/lib/ser/modules/usrloc.so"
<DD>loadmodule "/usr/lib/ser/modules/registrar.so"<BR>
<DD>
<DD># Uncomment this if you want digest authentication
<DD># mysql.so must be loaded !
<DD>loadmodule "/usr/lib/ser/modules/auth.so"
<DD>loadmodule "/usr/lib/ser/modules/auth_db.so"<BR><BR>
<DD>
<DD># ----------------- setting module-specific parameters
---------------<BR>
<DD>
<DD>#modparam("acc", "db_url", "sql://ser:heslo@localhost/ser")<BR>
<DD>
<DD># -- usrloc params --<BR>
<DD>
<DD>#modparam("usrloc", "db_mode", 0)<BR>
<DD>
<DD># Uncomment this if you want to use SQL database
<DD># for persistent storage and comment the previous line
<DD>modparam("usrloc", "db_mode", 2)<BR>
<DD>
<DD># -- auth params --
<DD># Uncomment if you are using auth module
<DD>#
<DD>modparam("auth_db", "calculate_ha1", yes)
<DD>#
<DD># If you set "calculate_ha1" parameter to yes (which true in
this config),
<DD># uncomment also the following parameter)
<DD>#
<DD>modparam("auth_db", "password_column", "password")<BR>
<DD>
<DD># -- rr params --
<DD># add value to ;lr param to make some broken UAs happy
<DD>modparam("rr", "enable_full_lr", 1)<BR>
<DD> <BR>
<DD>
<DD>modparam("acc","log_level",1)
<DD>modparam("acc","log_flag",1)
<DD># ------------------------- request routing logic
-------------------<BR>
<DD>
<DD># main routing logic<BR>
<DD>
<DD>route{<BR>
<DD>
<DD> # initial sanity
checks -- messages with
<DD> # max_forwards==0, or
excessively long requests
<DD> if
(!mf_process_maxfwd_header("10")) {
<DD>
sl_send_reply("483","Too Many Hops");
<DD>
break;
<DD> };
<DD> if ( msg:len >
max_len ) {
<DD>
sl_send_reply("513", "Message too big");
<DD>
break;
<DD> };<BR>
<DD>
<DD> # we record-route all
messages -- to make sure that
<DD> # subsequent messages
will go through our proxy; that's
<DD> # particularly good
if upstream and downstream entities
<DD> # use different
transport protocol
<DD> record_route();
<DD> # loose-route
processing
<DD> if (loose_route()) {
<DD>
if (method=="BYE") {
<DD>
setflag(1);
<DD>
setflag(2);
<DD>
}<BR>
<DD>
<DD>
t_relay();<BR>
<DD>
<DD>
break;
<DD> };<BR>
<DD>
<DD> #labeled all
transaction for accounting
<DD> setflag(1);
<DD> setflag(2);<BR>
<DD>
<DD> if
(method=="CANCEL"){
<DD>
t_relay();
<DD>
};<BR>
<DD>
<DD> # (in case, it does
not work, use the following command
<DD> # with proper names
and addresses in it)<BR>
<DD> <BR>
<DD>
<DD> if (uri==myself)
{<BR>
<DD>
<DD>
# This for PSTN destination<BR>
<DD>
<DD>
if (uri=~"^sip:1")<BR>
<DD>
<DD>
{ rewritehost("10.10.10.10");
<DD>
forward(10.10.10.10,5060);
<DD>
break;
<DD>
}
<DD>
if (method=="REGISTER") {<BR>
<DD>
<DD>
# Uncomment this if you want to use digest authentication
<DD>
if (!www_authorize("sip.mycommunications.com", "subscriber")) {
<DD>
www_challenge("sip.mycommunications.com", "0");
<DD>
break;
<DD>
};<BR>
<DD>
<DD>
save("location");
<DD>
break;
<DD>
};<BR>
<DD>
<DD>
# native SIP destinations are handled using our USRLOC DB
<DD>
if (!lookup("location")) {
<DD>
sl_send_reply("404", "Not Found");
<DD>
break;
<DD>
};
<DD> };
<DD> # forward to current
uri now; use stateful forwarding; that
<DD> # works reliably even
if we forward from TCP to UDP
<DD> if (!t_relay()) {
<DD>
sl_reply_error();
<DD> };<BR>
<DD>
<DD>}</FONT>
<DD>_______________________________________________
<DD>Serusers mailing list
<DD>serusers@lists.iptel.org
<DD><A href="http://lists.iptel.org/mailman/listinfo/serusers"
eudora="autourl">http://lists.iptel.org/mailman/listinfo/serusers</A></DD></BLOCKQUOTE></DD></DL></DD></BLOCKQUOTE></DD></DL>
<DL></DL></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>