Hi CGRateS Community,
I’m currently setting up CGRateS with RADIUS agents integrated to a MikroTik router. I’ve been using some of the sample templates from GitHub as reference.
My setup runs in Docker containers — one for the CGRateS engine, one for PostgreSQL, and one for Redis. I’m also using the Omnitouch CGRateS UI to easily issue API commands and manage configurations.
So far, I’ve successfully configured and verified my Destinations, Destination Rates, Rates, Rating Plans, and Rating Profiles in the PostgreSQL database.
However, during testing, I encountered the following error:
[ERROR] Destination *any not authorized for account: cgrates.org:testuser, subject: *out:cgrates.org:data:testuser 2025/11/07 11:31:10 CGRateS <node1> [ERROR] <Rater> Error getting cost for account key <cgrates.org:testuser>: UNAUTHORIZED_DESTINATION 2025/11/07 11:31:10 CGRateS <node1> [WARNING] <SessionS> could not complete debit operation on session: <9331c9bcc07d2f86c9171eb270e1cceb61c2cadf>, error: <UNAUTHORIZED_DESTINATION>
It seems the rating engine cannot authorize the destination for this account.
I’ve attached my cgrates.json configuration and engine logs for reference.
Any guidance on what might be missing or misconfigured would be greatly appreciated.
Thank you!
— Justin
Hi Armir,
Thank you for your response.
I used the CGRateS API to add Destinations and DestinationRates. Below are the commands I executed:
Create the Destination:

--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cgrates/cb39ad3e-e633-4af6-81a2-96415f5ba777n%40googlegroups.com.
Hi Armir,
Thank you for your response.
I was able to resolve the issue — I can now see the sessions properly, and data balance deductions are working. However, I’m encountering a new problem: the cgrates-engine is being killed randomly.
Below is the ngrep output for reference:
T 2025/11/14 10:46:29.468035 127.0.0.1:50436 -> 127.0.0.1:2012 [AP] #1To view this discussion visit https://groups.google.com/d/msgid/cgrates/87317679-682d-4eeb-bcb1-a0d4f7485035n%40googlegroups.com.
I tried setting the RateUnit and RateIncrement to 1024 (KB) and 1048576 (MB), which reduced how often the process gets killed. I’ll continue adjusting the rate settings.
For a time-based use case, what is the correct category to use? Should it still be under data or should a different category be defined?
Regards,
Justin
To view this discussion visit https://groups.google.com/d/msgid/cgrates/0a57aee2-bb9c-4461-bc53-6c285b04a8f2n%40googlegroups.com.
I tried to configure an action using the following command:
{
"jsonrpc": "2.0",
"id": 1,
"method": "ApierV1.SetActions",
"params": [
{
"ActionsId": "Action_Disconnect_testuser",
"Actions": [
{
"Identifier": "*force_disconnect_sessions",
"ExtraParameters": "tenant=cgrates.org&filters=*string:~*req.Account:testuser&limit=10&APIOpts=&Event=",
"Weight": 10
}
]
}
]
}
However, when I tried to execute the action on the account, it failed with the following error:
[ERROR] Error executing action *force_disconnect_sessions: invalid number of parameters <1> expected 5!
Regards,
Justin
Hi Armir,
Regarding the bidirectional setup, I’ve already configured:
"sessions_conns": ["*bijson_localhost"]
under the RADIUS agent.
I also added the balance using:
curl -X POST http://192.168.1.132:2080/jsonrpc -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "ApierV1.SetBalance",
"params": [
{
"Tenant": "cgrates.org",
"Account": "testuser",
"BalanceType": "*data",
"Categories": "*any",
"Balance": {
"ID": "30MB_data_balance",
"Value": "31457280",
"ExpiryTime": "*daily",
"Weight": 35,
"DestinationIDs": "Dest_DATA"
}
}
]
}'
Verified balance have reaches 0 using:
curl -X POST http://192.168.1.132:2080/jsonrpc -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "ApierV2.GetAccount",
"params": [
{
"Tenant": "cgrates.org",
"Account": "testuser"
}
]
}'
{"id":1,"result":{"ID":"cgrates.org:testuser","BalanceMap":{"*data":[{"Uuid":"f1aa3b25-1506-42df-ac9c-8aefaef872d0","ID":"30MB_data_balance","Value":0,"ExpirationDate":"2025-11-20T15:00:41.554594392+08:00","Weight":35,"DestinationIDs":{"Dest_DATA":true},"RatingSubject":"","Categories":null,"SharedGroups":null,"Timings":null,"TimingIDs":null,"Disabled":false,"Factors":null,"Blocker":false}],"*monetary":[]},"UnitCounters":null,"ActionTriggers":null,"AllowNegative":false,"Disabled":false,"UpdateTime":"2025-11-19T15:08:30.414177991+08:00"},"error":null}
active_sessions return
[
{
"Account": "testuser",
"AnswerTime": "2025-11-19T15:11:37.657401258+08:00",
"CGRID": "c4c267f67576b7a281e40c584ae8d7bc5c822de3",
"Category": "data",
"DebitInterval": "0s",
"Destination": "server1",
"DurationIndex": "105.074626ms",
"ExtraFields": {
"RemoteAddr": "192.168.1.11"
},
"LoopIndex": 28,
"MaxCostSoFar": 0,
"MaxRate": 0,
"MaxRateUnit": "0s",
"NextAutoDebit": "0001-01-01T00:00:00Z",
"NodeID": "node1",
"OriginHost": "192.168.1.11",
"OriginID": "80900011-modified",
"RequestType": "*prepaid",
"RunID": "*default",
"SetupTime": "2025-11-19T15:11:37.657400888+08:00",
"Source": "SessionS_",
"Subject": "testuser",
"Tenant": "cgrates.org",
"ToR": "*data",
"Usage": "91.668553ms"
}
]
Balance deduction works as expected, however when the balance reaches 0, no session disconnection is triggered.
My current session config includes:
"debit_interval": "0",
"channel_sync_interval": "0"
Additional Observations
When using "debit_interval": "10s". I experience <MAX_INCREMENTS_EXCEEDED with 10000000000> error
I've attached:
cgrates.json
cgrates_logs - ngrep logs for no disconnection using debit_interval=0
cg-engine_logs - engine logs when using debit_interval=10s
ngrep capture for debit_interval=10s
Hi Armir,
Here’s my current tariffplans response using the API commands:
=== GetTPDestinationIDs ===--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cgrates/fd5e0507-d97c-4442-b99c-4df29c1ea140n%40googlegroups.com.