Hi CGRateS team,
I am trying to integrate OpenSIPS 3.6.6 with CGRateS v0.11.0~dev-20260521092007-7c28dbe00e5e for prepaid billing. The two servers are on separate machines and I am having an issue with cgrates_auth() in OpenSIPS always failing with CHARGERS_ERROR:SERVER_ERROR: MANDATORY_IE_MISSING: [connIDs].
--- SETUP ---
OpenSIPS 3.6.6 on <OPENSIPS_IP>
CGRateS v0.11.0~dev-20260521092007-7c28dbe00e5e on <CGRATES_IP>
MongoDB as data_db and stor_db
OpenSIPS cgrates module connecting via BiJSON to port 2014
--- CGRATES CONFIG ---
{
"listen": {
"rpc_json": "
0.0.0.0:2012",
"rpc_gob": "
0.0.0.0:2013",
"http": "
0.0.0.0:2080",
"birpc_json": "
0.0.0.0:2014"
},
"rals": {"enabled": true},
"chargers": {"enabled": true},
"cdrs": {
"enabled": true,
"chargers_conns": ["*internal"],
"rals_conns": ["*internal"]
},
"sessions": {
"enabled": true,
"rals_conns": ["*internal"],
"cdrs_conns": ["*internal"],
"chargers_conns": ["*internal"]
},
"apiers": {
"enabled": true,
"scheduler_conns": ["*internal"]
}
}
--- OPENSIPS CONFIG ---
loadmodule "cgrates.so"
modparam("cgrates", "cgrates_engine", "<CGRATES_IP>:2014")
modparam("cgrates", "max_async_connections", 20)
modparam("cgrates", "retry_timeout", 5)
In the routing script:
$cgr_opt(GetMaxUsage) = 1;
$cgr_opt(GetAttributes) = 0;
$cgr_opt(GetRoutes) = 0;
$cgr_opt(AuthorizeResources) = 0;
$cgr_opt(AllocateResources) = 0;
$cgr_opt(ReleaseResources) = 0;
$cgr_opt(ProcessThresholds) = 0;
$cgr_opt(ProcessStatQueues) = 0;
$cgr(RequestType) = "*prepaid";
$cgr(Source) = "OpenSIPS";
if (!cgrates_auth($avp(cgr_account), $var(normalized))) {
send_reply(402, "Insufficient Credit");
exit;
}
--- REQUEST SENT VIA BIJSON (confirmed via tcpdump) ---
{
"method": "SessionSv1.AuthorizeEventWithDigest",
"params": [{
"GetMaxUsage": true,
"GetAttributes": false,
"GetRoutes": false,
"AuthorizeResources": false,
"AllocateResources": false,
"ReleaseResources": false,
"ProcessThresholds": false,
"ProcessStatQueues": false,
"Event": {
"Account": "1001",
"Destination": "1002",
"RequestType": "*prepaid",
"Source": "OpenSIPS",
"OriginID": "test-call-id-001",
"SetupTime": "2026-01-01T00:00:00Z"
}
}]
}
--- RESPONSE FROM CGRATES ---
{"result":null,"error":"CHARGERS_ERROR:SERVER_ERROR: MANDATORY_IE_MISSING: [connIDs]"}
--- WHAT WORKS ---
1. The BiJSON connection IS established - confirmed via tcpdump showing active TCP connections between <OPENSIPS_IP> and <CGRATES_IP>:2014.
2. Direct HTTP call to ApierV1.GetMaxUsage works correctly and returns balance:
curl -X POST http://<CGRATES_IP>:2080/jsonrpc -d '{
"method": "ApierV1.GetMaxUsage",
"params": [{"ToR":"*voice","RequestType":"*prepaid","Tenant":"
cgrates.org","Category":"call","Account":"1001","Destination":"1002","SetupTime":"*now","Usage":"72h"}],
"id": 1
}'
Result: {"result":259200000000000,"error":null}
3. CDRsV1.ProcessExternalCDR with RequestType *none works for CDR storage.
4. Account has balance confirmed via ApierV2.GetAccount.
--- QUESTION ---
Why does SessionSv1.AuthorizeEventWithDigest via BiJSON fail with connIDs error even when:
- ChargerS is enabled with *internal connection
- The BiJSON TCP connection from OpenSIPS is established
- All unnecessary subsystems (attributes, routes, resources) are disabled in the request
Is there additional configuration required when OpenSIPS and CGRateS run on separate servers? Do we need to configure rpc_conns with the OpenSIPS IP for CGRateS to call back? Or is there a different approach recommended for this setup?
Any guidance would be greatly appreciated.
Thank you,