[OpenSIPS-Users] Simple ACC test with MySQL

David Santiago david.santiago at almiralabs.com
Wed Nov 10 16:25:08 CET 2010


This is the part where the ACC module is setup:

...
# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
/* by default ww do not adjust the direct of the sequential requests.
   if you enable this parameter, be sure the enable "append_fromtag"
   in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("acc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
#Pointer to the DB
modparam("acc", "db_extra", "caller_id=$fu; callee_id=$tu")
...


and this is the part where the INVITE for an initial request is handled...

...
        # record routing
        if (!is_method("REGISTER|MESSAGE"))
                record_route();
*
        # account only INVITEs
        xlog("mozaa - about to check if it's an INVITE...");
        if (is_method("INVITE")) {
                xlog("mozaa - yes, it is. Setting flag");
                setflag(1); # do accounting
        }
        xlog("mozaa - INVITE check done");*

        if (!uri==myself)
        ## replace with following line if multi-domain support is used
        ##if (!is_uri_host_local())
        {
                append_hf("P-hint: outbound\r\n");
...

...and these are the traces being written to the log:

...
Nov 10 16:18:04 s18 /opt/opensipsnotls/sbin/opensips[8997]: mozaa - about to
check if it's an INVITE...
Nov 10 16:18:04 s18 /opt/opensipsnotls/sbin/opensips[8997]:
DBG:core:pv_printf: final buffer length 32
Nov 10 16:18:04 s18 /opt/opensipsnotls/sbin/opensips[8997]: mozaa - yes, it
is. Setting flag
Nov 10 16:18:04 s18 /opt/opensipsnotls/sbin/opensips[8997]:
DBG:core:pv_printf: final buffer length 25
Nov 10 16:18:04 s18 /opt/opensipsnotls/sbin/opensips[8997]: mozaa - INVITE
check done
...

On Wed, Nov 10, 2010 at 4:02 PM, Brett Nemeroff <brett at nemeroff.com> wrote:

> On Wed, Nov 10, 2010 at 5:16 AM, David Santiago <
> david.santiago at almiralabs.com> wrote:
>
>> Modified... and still no records in the ACC table nor errors in the syslog
>> (although I have set the debug level to 9).
>>
>>
> Are you sure you are looking at the right logs? Put some xlogs into your
> code and be sure they show up as well.
>
> If you have acc loaded up, the db params set **and the db flag set during
> the INVITE**, you should either get an acc record or an error while debug is
> up.
>
> I've seen cases where depending on configuration and linux distro that it's
> tricky to tell which logfile is being written to. Or rather, perhaps it's
> not being written to the log you're expecting.
>
> -Brett
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20101110/85e27a1d/attachment.htm>


More information about the Users mailing list