acc_db_request did log to the log file, but it didn't provide the resp code and message (first line is a properly working log, 2nd line is the result of acc_db_request):

INVITE|16||16-15065@173.192.77.66|420|Request Failure|1422031914|||||||||||||||||||||
INVITE|2||2-9800@173.192.77.66||Some comment|1422300028

Ryan Brindley
Software Development Officer
Stratics Networks, Inc.
1.866.635.6918 x108

On Mon, Jan 26, 2015 at 12:50 PM, Ryan Brindley <ryan@straticsnetworks.com> wrote:
Yea, confirmed that added t_newtran(); above my setflag(FLT_ACC); line (and t_release() after the send_reply() line) did not produce a log entry.

Ryan Brindley
Software Development Officer
Stratics Networks, Inc.

On Mon, Jan 26, 2015 at 11:33 AM, Ryan Brindley <ryan@straticsnetworks.com> wrote:

Thanks Daniel.

Ive tried with t_newtran (just before the setflag calls) and i don't remember it working.

I will try again as well as explicitly calling the requests.

Is there any (major) performance hit by calling the requests explicitly?

On Jan 26, 2015 11:25 AM, "Daniel-Constantin Mierla" <miconda@gmail.com> wrote:
The accounting with flags is relying on transaction states, so you have to create it.

Either use acc_db_request() and acc_log_request() in the config (they work without creating the transaction in your example) or t_newtran() before send_reply().

Cheers,
Daniel


On 26/01/15 18:08, Ryan Brindley wrote:

I've been working to try to get kamailio (4.1) to log every transaction to file, but can't seem to do it -- or even get it to reliably log. What the heck am i missing?

It seems Kamailio logs the first time i try it on a day, but then won't do it again no matter what variation of configs I try.

Is it something wrongly configured with flatstore? Permission issues? Any help/leads/hunches are greatly appreciated.

The following is my truncated test config

#!KAMAILIO

#!define DBURL "flatstore:/var/log/kamailio-acc"
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3

(the config and load mod stuff)

modparam("acc", "log_level", 1)
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
modparam("acc", "log_facility", "LOG_LOCAL2") #confirmed in Ubuntu rsyslog LOG_LOCAL2 is configured
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
modparam("acc", "db_url", DBURL)
modparam("acc", "db_flag", FLT_ACC)
modparam("acc", "db_missed_flag", FLT_ACCMISSED)

request_route {

 (non-invite request stuff)

 setflag(FLT_ACC);
 setflag(FLT_ACCMISSED);
 setflag(FLT_ACCFAILED);

 send_reply("420", "Test");
 exit;

}

Ryan Brindley



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users