[OpenSIPS-Users] cdr_flag not working in v1.7

John Quick john.quick at smartvox.co.uk
Tue Sep 20 18:07:42 CEST 2011


My favourite module (dialog) got even better when the cdr_flag option was
added. I use it all the time now.

But it doesn't seem to be working in version 1.7. I know the call is
creating a dialog because db_mode is set to 1 and the record can be seen in
the dialog table while the call is active. However, 2 records are written to
the acc table - one for the INVITE and another for the BYE. So cdr_flag is
being ignored. Is this a problem in v1.7 or have I done something wrong?

Here's the relevant bits from opensips.cfg:
modparam("acc", "db_flag", 2)
modparam("acc", "cdr_flag", 2)
modparam("acc", "db_missed_flag", 3)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 1)
modparam("acc", "db_extra", "authid=$avp(authid); srcip=$si; called=$rU;
route=$rd; cli=$fU")

modparam("dialog", "db_mode", 1)        # 1 during testing; 0 or 3 for
production
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "rr_param", "scdg")  # unique rr tag value in case other
opensips servers in route
modparam("dialog", "default_timeout", 14400)   # default timeout set to 4
hours

route[3]
    if (method=="INVITE" || method=="BYE") {
        # Write CDR records to the database
        setflag(2);
        # ...and missed calls too
        setflag(3);
    }

    if (method=="INVITE") {
        # make OpenSIPS create a dialog record (see dialog module for info)
        create_dialog();
    }

...and my loose routing section:
    if (has_totag()) {
        if (loose_route()) {
            # Attempt to match this request with an existing dialog
            match_dialog();

            # Check authentication of re-invites - don't challenge if from a
known address
            if(method=="INVITE" &&
(!check_address("0","$si","$sp","$proto"))) {
                if (!proxy_authorize("","subscriber")) {
                      proxy_challenge("","1");
                      exit;
                };
            };

            if (method=="INVITE" || method=="BYE") {
                # Write CDR records to the database
                setflag(2);
            }


John Quick
Smartvox Limited
Web: www.smartvox.co.uk

Smartvox is a limited company, registered in England and Wales, number
5005263.
Registered office: Spectrum House, Dunstable Road, Redbourn, St.Albans,
Herts AL3 7PR






More information about the Users mailing list