Dear Alexandru,
Thank you very much for your reply, it helped me alot understanding some more things about dispatchers.
I am now running
/go/bin/cgr-engine --version
CGR...@v0.10.3~dev-20210512064421-a8ecf36bec3d
with your latest commit but I am getting the DISPATCHER_ERROR:NOT_FOUND when running :
/go/bin/cgr-loader -config_path /etc/cgrates/
2021/05/12 16:40:39 Could not reload cache: DISPATCHER_ERROR:NOT_FOUND
ngrep on 2012
==============================================================
{"method":"CacheSv1.ReloadCache","params":[{"APIKey":"","RouteID":"","Tenant":"","DestinationIDs":[],"ReverseDestinationIDs":[],"RatingPlanIDs":[],"RatingProfileIDs":[],"ActionIDs":[],"ActionPlanIDs":[],"AccountActionPlanIDs":[],"ActionTriggerIDs":[],"SharedGroupIDs":[],"ResourceProfileIDs":[],"ResourceIDs":null,"StatsQueueIDs":null,"StatsQueueProfileIDs":[],"ThresholdIDs":null,"ThresholdProfileIDs":[],"FilterIDs":[],"SupplierProfileIDs":[],"AttributeProfileIDs":[],"ChargerProfileIDs":[],"DispatcherProfileIDs":["voiceland.dev:ALL","voiceland.dev:RALS"],"DispatcherHostIDs":["voiceland.dev:SELF","voiceland.dev:RALS","voiceland.dev:RALS2"],"DispatcherRoutesIDs":null,"FlushAll":false}],"id":0}
##
T 2021/05/13 16:07:01.683501
127.0.0.1:2012 ->
127.0.0.1:48464 [AP] #43536
{"id":0,"result":null,"error":"DISPATCHER_ERROR:NOT_FOUND"}
==============================================================
I managed to send the CacheSv1.ReloadCache by changing "Tenant":"" --> "Tenant":"
voiceland.dev" via postman and it worked.
Why is Tenant not populated to the Tenant param?
Here is my config
cat DispatcherHosts.csv
---------------------------------
#Tenant[0],ID[1],Address[2],Transport[3],TLS[4]
voiceland.dev,SELF,*internal,,
voiceland.dev,RALS,
ns-dev-cgrates-rals-1-87cb29be59d6bac1.elb.eu-central-1.amazonaws.com:2070,*json,
voiceland.dev,RALS2,
ns-dev-cgrates-rals-2-5337e20271c10a49.elb.eu-central-1.amazonaws.com:2070,*json,
cat DispatcherProfiles.csv
---------------------------------
#Tenant,ID,Subsystems,FilterIDs,ActivationInterval,Strategy,StrategyParameters,ConnID,ConnFilterIDs,ConnWeight,ConnBlocker,ConnParameters,Weight
voiceland.dev,ALL,*sessions,,,*weight,,SELF,,20,false,,10
voiceland.dev,RALS,*rals,,,*weight,,RALS,,20,false,,10
voiceland.dev,RALS,,,,,,RALS2,,10,,,
I want only rals to be send to external boxes RALS and RALS2 and all the other queries to be send to *internal.
so for example I have configured in the sessions section to have *localhost only on rals_conns and all the other data are locally cached and should be accessed by *internal
"sessions": {
"enabled": true,
"listen_bijson": "
127.0.0.1:2014",
"chargers_conns": ["*internal"],
"rals_conns": ["*localhost"],
"cdrs_conns": ["*internal"],
"resources_conns": ["*internal"],
"thresholds_conns": ["*internal"],
"stats_conns": ["*internal"],
"suppliers_conns": ["*internal"],
"attributes_conns": ["*internal"],
"debit_interval": "5s",
},
complete cgrates.json -->
here
The problem is that for example this method cannot be found when dispatcher is enabled (because of APier been disabled). for example OpenSIPS send to CGRateS when trying to make a call:
ngrep 2014 (opensips side)
=============================================================
{ "method": "SessionSv1.AuthorizeEventWithDigest", "id": 1367673414, "params": [ { "Tenant": "
voiceland.dev", "ProcessStatQueues": true, "ProcessThresholds": true, "ReleaseResources": true, "AllocateResources": true, "AuthorizeResources": true, "GetSuppliers": true, "GetAttributes": true, "GetMaxUsage": true, "Event": { "UserAgent": "snomD712\/
10.1.54.13", "OriginIP": "80.245.164.225", "Category": "call-out", "Destination": "
+302107001397", "OriginCLD": "
+302107001397", "OriginCLI": "
+302107001398", "ID": "OPENSIPS_CHECK_USER_BALANCE_OUT", "CDRType": "CUSTOMER", "Source": "SIP-1-AWS", "OriginHost": "10.100.0.21", "Subject": "INTERNAL", "RequestType": "*prepaid", "Account": "+302107001398", "Tenant": "
voiceland.dev", "OriginID": "313632303932353935353537363639-bl2knv6apee6", "SetupTime": "1620925956" } } ] }
#
T 2021/05/13 17:12:36.896354
127.0.0.1:2014 ->
127.0.0.1:56408 [AP] #24
{"id":1367673414,"result":null,"error":"SUPPLIERS_ERROR:SERVER_ERROR:
rpc: can't find method Responder.GetCostOnRatingPlans"}
=============================================================
ngrep 2012
==============================================================
{"method":"Responder.GetCostOnRatingPlans","params":[{"Account":"9b83b82a-878c-457d-8879-eece6a492994","Subject":"9b83b82a-878c-457d-8879-eece6a492994","Destination":"+302107001397","Tenant":"
voiceland.dev","SetupTime":"2021-05-13T16:23:21Z","Usage":10800000000000,"RatingPlanIDs":["TP_RP_SPL_VOICELAND_INTERNAL_DST_ID_RT_GR_LANDLINE_2020_02_IN"]}],"id":1}
##
T 2021/05/13 16:23:21.235972
127.0.0.1:2012 ->
127.0.0.1:48816 [AP] #43941
{"id":1,"result":null,"error":"rpc: can't find method Responder.GetCostOnRatingPlans"}
==============================================================
When I disable dispatcher service this query is working fine.
A second request from OpenSIPS like this is working fine:
{ "method": "SessionSv1.AuthorizeEventWithDigest", "id": 1367673410, "params": [ { "GetAttributes": true, "Tenant": "
voiceland.dev", "Event": { "ID": "GET_USER_PROFILE", "Account": "
+302107001398", "Tenant": "
voiceland.dev" } } ] }
As you may have understood I am a little bit confused and testing 2 days now but can't find the ideal configuration for this setup I want.
Is this a bug of "Responder.GetCostOnRatingPlans" on sessions service not working when dispatcher is enabled?
What should I configure on DispatcherProfiles and cgrates.json for all requests to go on local engine(or other external box) and only *rals to --> RALS and RALS2 connections?
Should I set more subsystems to make this setup work?
Also I would like to ask how can we verify data currently been on the dispatcher host? I ask this because APier is disabled.
If APier for dispatcher will be available on version 1.0 then this is great news. We already have plans
to migrate to v1.0 after you release it. It is very important that you also provide some migration guidelines from v0.10 --> v1.0 for all of us that we are stuck on v0.10.
A final question, now lets assume that we have the fail over scenario with dispatcher working.
Can CGRateS send out any event if RALS Host is not reachable and request is send to RALS2 Host?
I want CGRateS to send me an Event (for example using actions && http POST) to my NMS service
when each Remote Host Connections for selected subsystem is not accessible so that my NMS can enable schedulers service to the second RALS2 Host etc..
Is that possible somehow? Can CGRateS stick to the second Host even though the RALS Host may be up again after a while?
thank you in advance for your support.
This email communication (and any attachments) are confidential and are intended only for the individual(s) or entity named above and others who have been specifically authorized to receive it. If you are not the intended recipient, please do not read, copy, use or disclose the contents of this communication to others. Please notify the sender that you have received this email in error by replying to the email or by telephoning
+30-212-222-8000. Please then delete the email and any copies of it. This information may be subject to legal professional or other privilege or may otherwise be protected by work product immunity or other legal rules. Thank you.
Think Green // Print if only necessary