[Serusers] Radius Accounting

Caxton kaifu.chan at gmail.com
Tue Jul 11 06:40:25 CEST 2006


 Hi all:

    I have installed radius server, and I also configure the "ser.cfg" for
the radius accounting.  However, there is a problem confues me.

    While the sip session have set up, the radiusclient send a
Request-Account packet to radius server immediately, than radius server
    can save the start-up time of the session into database.  But after the
session terminated, radiusclient do nothing(it should send a
    Accounting-Stop packet to radius server)!!  Therefore, I can not have a
complete time record.

    I try to look up the solution in seruser mailing list, but I can not
find what I want.  Please help me, thanks.

    Sincerely

    Caxton

-----ser.cfg-----

[cut]

# -- acc params --
modparam("acc", "radius_config",
"/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("acc", "log_level", 2)
modparam("acc", "radius_flag", 1)
modparam("acc", "report_ack", 0)
# -------------------------  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 >=  2048 ) {
                sl_send_reply("513", "Message too big");
                break;
        };
        # we record-route all messages -- to make sure that
        # subsequent messages will go through our proxy; that's
        # particularly good if upstream and downstream entities
        # use different transport protocol
        if (!method=="REGISTER") 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;
        };

        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") {
                       log(1, "REGISTER: Authenticating user\n");
# Uncomment this if you want to use digest authentication
                        if (!www_authorize("pc80.s206.tj.mcu.edu.tw",
"subscriber")) {
                                log(1, "REGISTER: Chanllenging user\n");
                                www_challenge(" pc80.s206.tj.mcu.edu.tw",
"0");
                                break;
                        };
                        save("location");
                        break;
                };
                if(method=="INVITE") {
                        log(1, "INVITE\n");
                        setflag(1);
                }
                if(method=="MESSAGE") {
                        log(1, "MESSAGE\n");
                        setflag(1);
                }
                if(method=="BYE"||method== "CANCEL") {
                        log(1, "BYE or CANCEL\n");
                        setflag(1);
                }

[cut]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20060711/33beb551/attachment.htm>


More information about the sr-users mailing list