SessionSv1.AuthorizeEventWithDigest fails with CHARGERS_ERROR: MANDATORY_IE_MISSING: [connIDs] - OpenSIPS on separate server

19 views
Skip to first unread message

Software Development

unread,
Jun 1, 2026, 2:18:35 AM (5 days ago) Jun 1
to CGRateS
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,

Armir Veliaj

unread,
Jun 1, 2026, 11:04:37 AM (5 days ago) Jun 1
to cgr...@googlegroups.com
Hi @s...@ispbazaarindia.com,

Welcome to CGRateS.

Sorry for the late response, but since your account is new, it was marked as spam and we couldn’t see it in time.

Regarding the issue you are having, based on the error CHARGERS_ERROR:SERVER_ERROR: MANDATORY_IE_MISSING: [connIDs], it seems that when ChargerS tries to process the event through AttributeS, it finds an empty connection that needs to be set.

In the JSON config, you need to update it by adding `attributes_conns` to the `chargers` section and enabling attributes.

Alternatively, if you do not need AttributeS processing, you can load a ChargerProfile with AttributeIDs set to *none to bypass AttributeS entirely.

If you haven’t checked it already, you can find more in our docs, especially in the ChargerS and AttributeS sections at this link: https://cgrates.readthedocs.io/en/latest/index.html

Hope it helps.

Thanks,
Armir

--
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/5b8d3a0e-261d-4920-b855-5214a643a8aen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages