CGrates auth failed

296 views
Skip to first unread message

Vince-0

unread,
Feb 3, 2022, 8:34:00 AM2/3/22
to CGRateS
First post!

Following the opensips tutorial but cannot get the test calls connecting 1001 to 1002.
Opensips log error keeps showing not at call time:

CGRateS auth failed: rc=-2, code=ROUTES_ERROR:SERVER_ERROR: MANDATORY_IE_MISSING: [connIDs]

Opensips log at call time:
Feb  3 15:13:01 dsip1 /usr/sbin/opensips[13087]: ERROR:drouting:route2_carrier: carrier <route2> was not found, skipping...
Feb  3 15:13:01 dsip1 /usr/sbin/opensips[13087]: ERROR:drouting:route2_carrier: carrier <route1> was not found, skipping...

CGrates log shows this at call time:

The mysql cgrates database auth works when I try it manually from the CLI.
What auth is that failing in opensips log?  Any advice is greatly appreciated.



Nickolas Daniel Filip

unread,
Feb 3, 2022, 9:33:00 AM2/3/22
to CGRateS
Hi Vince!

Can you send me the config file which you are using in order to start the engine?

Thanks, Nick

Vince-0

unread,
Feb 4, 2022, 2:26:47 AM2/4/22
to CGRateS
Hi Nick,

I'm just using the default tutorial configs for cgrates and opensips:

/usr/share/cgrates/tutorials/osips/cgrates/etc/cgrates/cgrates.json
/usr/share/cgrates/tutorials/osips/opensips/etc/opensips/opensips.cfg

Thanks,

Nickolas Daniel Filip

unread,
Feb 4, 2022, 9:53:51 AM2/4/22
to CGRateS
Hi Vince!

So after looking at the config, the error makes sense now. In the CGRateS logs you have a Partially executed event which has an ExtraInfo field with the value of  NOT_CONNECTED: RALs. This means that RouteS does not have a connection defined to RALs. In order to change this, you should add a RALs connection in your config file, in the routes section.
e.g: "rals_conns": ["*localhost"]

Thanks, Nick

Vince-0

unread,
Feb 8, 2022, 4:55:54 AM2/8/22
to CGRateS
Hi Nick, thanks,

Struggling with the osips tutorial newbie here.
Looks like partially executed and rals not connected issue still.

I added the rals_conns to routes section, full config here:

opensips.cfg here:

Error in cgrates log on call attempt 1001 to 1002:
CGRateS <7b478c7> [16628]: <StatQueue> metricID: *tcc, add eventID: e6d44e0, error: NEGATIVE:Cost
CGRateS <7b478c7> [16628]: <StatS> Queue: cgrates.org:Stats2, ignoring event: cgrates.org:e6d44e0, error: NEGATIVE:Cost
CGRateS <7b478c7> [16628]: <CDRs> error: <PARTIALLY_EXECUTED> processing event {"Tenant":"cgrates.org","ID":"e6d44e0","Time":null,"Event":{"Account":"1001","AnswerTime":"0001-01-01T00:00:00Z","CGRID":"9c9d13330a22ea547a1bc010e73377b717d619cf","Category":"call","Cost":-1,"CostSource":"","Destination":"1002","DisconnectCause":"","ExtraInfo":"NOT_CONNECTED: RALs","OrderID":0,"OriginHost":"127.0.0.1","OriginID":"Call-ID: 15acafb8b28b016f4ca8d037db26c6de@0:0:0:0:0:0:0:0","Partial":false,"PreRated":false,"RequestType":"*prepaid","RouteID":"route1","RunID":"*default","SetupTime":"2022-02-08T11:24:47+02:00","Source":"OpenSIPS","Subject":"1001","Tenant":"cgrates.org","ToR":"*voice","Usage":0},"APIOpts":{"*subsys":"*chargers"}} with Stats

opensips.log at call time:
ERROR:drouting:route2_carrier: carrier <route2> was not found, skipping...
ERROR:drouting:route2_carrier: carrier <route1> was not found, skipping...

Balance query , same for 1002:
# cgr-console 'accounts Tenant="cgrates.org" AccountIds=["1001"]'
[
 {
  "ActionTriggers": null,
  "AllowNegative": false,
  "BalanceMap": {
   "*monetary": [
    {
     "Blocker": false,
     "Categories": {},
     "DestinationIDs": {},
     "Disabled": false,
     "ExpirationDate": "0001-01-01T00:00:00Z",
     "Factor": null,
     "ID": "test",
     "RatingSubject": "",
     "SharedGroups": {},
     "TimingIDs": {},
     "Timings": null,
     "Uuid": "cc2f977d-0da8-4d2f-ad81-4ce4c95adaae",
     "Value": 10,
     "Weight": 10
    }
   ]
  },
  "Disabled": false,
  "ID": "cgrates.org:1001",
  "UnitCounters": null,
  "UpdateTime": "2022-02-08T11:37:10.442714902+02:00"
 }
]

Query call test:
# cgr-console 'cost Category="call" Tenant="cgrates.org" Subject="1001" Destination="1002" AnswerTime="2014-08-04T13:00:00Z" Usage="20s"'
{
 "AccountSummary": null,
 "Accounting": {},
 "CGRID": "",
 "Charges": [
  {
   "CompressFactor": 1,
   "Increments": [
    {
     "AccountingID": "",
     "CompressFactor": 1,
     "Cost": 0.4,
     "Usage": "0s"
    },
    {
     "AccountingID": "",
     "CompressFactor": 1,
     "Cost": 0.2,
     "Usage": "1m0s"
    }
   ],
   "RatingID": "9d47267"
  }
 ],
 "Cost": 0.6,
 "Rates": {
  "4624e9c": [
   {
    "GroupIntervalStart": "0s",
    "RateIncrement": "1m0s",
    "RateUnit": "1m0s",
    "Value": 0.2
   },
   {
    "GroupIntervalStart": "1m0s",
    "RateIncrement": "1s",
    "RateUnit": "1m0s",
    "Value": 0.1
   }
  ]
 },
 "Rating": {
  "9d47267": {
   "ConnectFee": 0.4,
   "MaxCost": 0,
   "MaxCostStrategy": "",
   "RatesID": "4624e9c",
   "RatingFiltersID": "2030b7b",
   "RoundingDecimals": 4,
   "RoundingMethod": "*up",
   "TimingID": "0e7d369"
  }
 },
 "RatingFilters": {
  "2030b7b": {
   "DestinationID": "DST_1002",
   "DestinationPrefix": "1002",
   "RatingPlanID": "RP_1001",
   "Subject": "*out:cgrates.org:call:1001"
  }
 },
 "RunID": "",
 "StartTime": "2014-08-04T13:00:00Z",
 "Timings": {
  "0e7d369": {
   "MonthDays": [],
   "Months": [],
   "StartTime": "00:00:00",
   "WeekDays": [],
   "Years": []
  }
 },
 "Usage": "1m0s"
}

I'm shooting in the dark here, any advice is greatly appreciated.
Vin.

Nickolas Daniel Filip

unread,
Feb 18, 2022, 6:30:42 AM2/18/22
to CGRateS
Hi Vince!

First of all, I want to apologize for late response.
Second, as I can see in your config file, you don't have your CDRs connected to RALs. Try adding a connection from CDRs to RALs.

Thanks, Nick

Vincent Swart

unread,
Feb 21, 2022, 6:40:03 AM2/21/22
to cgr...@googlegroups.com
No problemo Nick, any advice is appreciated.

Adding the rals_conns to the cdrs section did indeed get past the partially executed error.

Now I have a SIP 404 route response: carrier <route1> was not found skipping in opensips log and I am investigating further and will update what I find.

Thank you,
Vin

--
You received this message because you are subscribed to a topic in the Google Groups "CGRateS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cgrates/a1pOpWTNVC8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cgrates+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgrates/c8fdc7a3-f116-4033-bf62-b502255279e3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages