[OpenSIPS-Users] accounting problem after failover

Edwin eahaselhoff at gmail.com
Tue Feb 4 11:35:09 CET 2014


I need a little (lot of) help with an accounting problem.

I try to deliver an inbound call to the ip of a client. If the transactions
times out I route the call outbound to his mobile. (Of course) the outbound
call should be accounted (in mysql CDR database).

I tried to show routing down here in a simplified way. I put the
uac_replace_from in a branch route because I can not use the function twice.

If I route the call straight to route 2 everythings works fine and the call
shows up in the accountingdatabase. If I route the call to route 1 and the
route times out it is pushed throught the failure route to route 2. The call
is delivered but I don't get the accounting working.

I hope I put enought information down here, any help is appreciated!


loadmodule "acc.so"
modparam("acc", "db_url", "mysql://opensips:xxx@localhost/yyy")
modparam("acc", "db_flag", "DB_FLAG")
modparam("acc", "cdr_flag", "DB_FLAG")

route[0]
{
	if(is_method("INVITE") && is_from_gw())
	{
		route(1); # from trusted route
	}
}

# from trusted route
route[1]
{
	create_dialog("B");
	
	if(lookup("location"))	# route to local user
	{
		t_on_branch("0");
		t_on_failure("1");
		t_relay("0x05");
	}
}

branch_route[0]
{
	uac_replace_from("","sip:anonymous-at-invalid");
	append_hf("Privacy: id\r\n");
}


# to mobiel number
route[2]
{
	$rU = $avp(mobile_number);
	
	setflag(DB_FLAG); # account successful transactions

	t_on_branch("1");
	
	create_dialog("B");

	t_relay("0x05");
}

branch_route[1]
{
	uac_replace_from("","sip:1234-at-xyz");
	append_hf("Privacy: full\r\n");
}


# timeout on t_relay, goto mobile number
failure_route[1]
{
	route(2);
}



--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/accounting-problem-after-failover-tp7589422.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list