[Serusers] SER+PostgreSQL module for Accouting

Emerson Oatis emerson.oatis at gmail.com
Fri Jun 16 07:34:11 CEST 2006


hi list!

we tried to log accounting of ser on postgres, but it seems that logging was
not successful. here are the simulations we did :

- we convert all the schema of mysql to postgresql databse (ser schema),
just minor revision on datatypes since we don't find any posgresql.sql for
ser on the net
- followed this steps http://www.voip-info.org/wiki/view/SER+module+postgres
- recompiled ser to support postgresql database
- tried to configure/run ser.cfg to log accounting but no luck
- we did some search and tried it first on mysql database
   - edit the src of acc module and edit the Makefile to support SQL
logging, recompile the acc.so
   - copy the new acc.so to /path/of/ser/modules/
   - add db_flag on ser.cfg
   - now acc mysql was logging
- tried to replace the connector from mysql to postgresql on ser.cfg with
the same config
   - ngrep port 5432 on localhost but it seems no request came from ser
   - ser was running ok and we see logs on /var/log/messages that acc was
working

* do we missed something? or probably tweak some configuration?
* below are snippet of my ser.cfg

thanks and regards
emer

------------------------------------------------------------
fifo="/tmp/ser_fifo"
fifo_db_url="postgres://ser:heslo-757@localhost:5432/ser"

# ------------------ module loading ----------------------------------

loadmodule "/usr/local/lib/ser/modules/tm.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
loadmodule "/usr/local/lib/ser/modules/rr.so"
loadmodule "/usr/local/lib/ser/modules/postgres.so"

# ----------------- setting module-specific parameters ---------------
modparam("usrloc", "db_mode", 0)
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("auth_db","db_url", "postgres://ser:heslo-757@localhost:5432/ser")

# -- acc params --
modparam("acc", "log_level", 1)
# that is the flag for which we will account -- don't forget to
# set the same one :-)
modparam("acc", "log_flag", 1 )
modparam("acc", "db_flag", 1)

        /* ********* RR ********************************** */

        /* grant Route routing if route headers present */
        if (loose_route())
        {
                # mark the BYEs -- they are requests within a dialog
                if(method=="BYE")
                        setflag(1);
                t_relay();
                break;
        };

        /* record-route INVITEs -- all subsequent requests must visit us */
        if (method=="INVITE") {
                setflag(1);
                record_route();
        };
----------------------------------------------------------------------------------------------------
# postges/ser process
10199 ?        S      0:00 ser -f pstn.ser02
10201 ?        S      0:00 ser -f pstn.ser02
10205 ?        S      0:00 postgres: ser ser 127.0.0.1(56629) idle
10203 ?        S      0:00 ser -f pstn.ser02
10209 ?        S      0:00 postgres: ser ser 127.0.0.1(56630) idle
10211 ?        S      0:00 postgres: ser ser 127.0.0.1(56631) idle
10206 ?        S      0:00 ser -f pstn.ser02
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20060616/ed64f785/attachment.htm>


More information about the sr-users mailing list