[Serusers] Accounting and missed calls..
Marian Dumitru
marian.dumitru at voice-sistem.ro
Wed Jan 26 18:50:26 CET 2005
Hi Amos,
To get mysql accounting, be sure to compile the mysql support (look into
modules/acc/Makefile).
Also set the appropriate acc params from a SB accounting:
modparam("acc", "db_flag", 1 )
modparam("acc", "db_missed_flag", 3 )
The flags that you set in your cfg are for syslog accounting.
Regards,
Marian
Amos Nungu wrote:
> Hi all,
> Help needed.
>
> I'm running SER 0.8.14 (i386/linux) with serweb_2004-07-27 on a debian
> machine. I need to achieve the missed calls and accounting... Be able to
> see them from my serweb interface which I can't for now.
>
> I can register, authenticate and make calls normally.
> I tried to check from the database i.e without serweb, nothing is stored
> also.
>
> Here is my ser.cfg file:
> ................................ser.cfg.....................
> #
> # config script + accounting + misseed calls
> #
>
> # ----------- global configuration parameters ------------------------
>
> debug=3 # debug level (cmd line: -dddddddddd)
> fork=yes
> log_stderror=no # (cmd line: -E)
>
> /* Uncomment these lines to enter debugging mode
> fork=no
> log_stderror=yes
> */
>
> check_via=no # (cmd. line: -v)
> dns=no # (cmd. line: -r)
> rev_dns=no # (cmd. line: -R)
> port=5060
> children=4
> fifo="/tmp/ser_fifo"
>
> # ------------------ module loading ----------------------------------
>
> # Uncomment this if you want to use SQL database
> loadmodule "/usr/lib/ser/modules/mysql.so"
> loadmodule "/usr/lib/ser/modules/sl.so"
> loadmodule "/usr/lib/ser/modules/tm.so"
> loadmodule "/usr/lib/ser/modules/rr.so"
> loadmodule "/usr/lib/ser/modules/maxfwd.so"
> loadmodule "/usr/lib/ser/modules/usrloc.so"
> loadmodule "/usr/lib/ser/modules/registrar.so"
> loadmodule "/usr/lib/ser/modules/textops.so"
> loadmodule "/usr/lib/ser/modules/auth.so"
> loadmodule "/usr/lib/ser/modules/auth_db.so"
> loadmodule "/usr/lib/ser/modules/acc.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # -- usrloc params --
>
> #modparam("usrloc", "db_mode", 0)
>
> modparam("usrloc", "db_mode", 2)
>
> # -- auth params --
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
>
> # -- rr params --
> modparam("rr", "enable_full_lr", 1)
>
> # -- acc params --
> modparam("acc", "log_level", 1) #Accounting
> modparam("acc", "log_flag", 1 ) #Accounting
> modparam("acc", "log_missed_flag", 3 ) #missed calls
>
> # ------------------------- request routing logic -------------------
>
> # main routing logic
>
> route{
>
> # initial sanity checks -- messages with
> # max_forwards==0, or excessively long requests
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> break;
> };
> if (msg:len >= max_len ) {
> sl_send_reply("513", "Message too big");
> break;
> };
>
> # record-route INVITES to make sure BYEs will visit our server too
> if (method=="INVITE") record_route();
>
> # subsequent messages withing a dialog should take the
> # path determined by record-routing
> if (loose_route()) {
> # mark routing logic in request
> append_hf("P-hint: rr-enforced\r\n");
> route(1);
> break;
> };
>
> # labeled all transaction for accounting
> setflag(1);
>
> if (!uri==myself) {
> # mark routing logic in request
> append_hf("P-hint: outbound\r\n");
> route(1);
> break;
> };
>
> # if the request is for other domain use UsrLoc
> # (in case, it does not work, use the following command
> # with proper names and addresses in it)
> if (uri==myself) {
>
> if (method=="REGISTER") {
>
> # Uncomment this if you want to use digest authentication
> if (!www_authorize("xxx.org", "subscriber")) {
> www_challenge("xxx.org", "0");
> break;
> };
>
> save("location");
> break;
> };
>
> lookup("aliases");
> if (!uri==myself) {
> append_hf("P-hint: outbound alias\r\n");
> route(1);
> break;
> };
>
> # native SIP destinations are handled using our USRLOC DB
> if (!lookup("location")) {
> # call invitations to off-line users are reported using the
> # acc_request action; to avoid duplicate reports on request
> # retransmissions, request is processed statefuly (t_newtran,
> # t_reply)
> if ((method=="INVITE" || method=="ACK") && t_newtran() ) {
> t_reply("404", "Not Found");
> #acc_request("404 Not Found"); #produce error (not found)
> break;
> };
> # all other requests to off-line users are simply replied
> # statelessly and no reports are issued
> sl_send_reply("404", "Not Found");
> break;
> } else {
> # user on-line; report on failed transactions; mark the
> # transaction for reporting using the same number as
> # configured above; if the call is really missed, a report
> # will be issued
> setflag(3);
> # forward to user's current destination
> t_relay();
> break;
> };
> };
> append_hf("P-hint: usrloc applied\r\n");
> route(1);
> }
>
> route[1]
> {
> # send it out now; use stateful forwarding as it works reliably
> # even for UDP2TCP
> if (!t_relay()) {
> sl_reply_error();
> };
> }
> #............................end....................
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
--
Voice System
http://www.voice-system.ro
More information about the sr-users
mailing list