Just to update back in case anyone lands on this post.
Got it working as described above after a bit of playing around
DispatcherHosts looks like this
#Tenant[0],ID[1],Address[2],Transport[3],TLS[4]
thetenant.ie,DH_EU_CGR_1,eu-cgr-1:2012,*json,false
thetenant.ie,DH_EU_CGR_2,eu-cgr-2:2012,*json,false
thetenant.ie,DH_EU_CGR_3,eu-cgr-3:2012,*json,false
DispatcherProfiles looks like this
#Tenant,ID,Subsystems,FilterIDs,ActivationInterval,Strategy,StrategyParameters,ConnID,ConnFilterIDs,ConnWeight,ConnBlocker,ConnParameters,Weight
thetenant.ie,DP_RAL_GROUP_1,*any,*string:~*req.RalGroup:1,,*weight,,DH_EU_CGR_1,,30,false,,20
thetenant.ie,DP_RAL_GROUP_1,,,,,,DH_EU_CGR_2,,20,,,
thetenant.ie,DP_RAL_GROUP_1,,,,,,DH_EU_CGR_3,,10,,,
thetenant.ie,DP_RAL_GROUP_2,*any,*string:~*req.RalGroup:2,,*weight,,DH_EU_CGR_2,,30,false,,20
thetenant.ie,DP_RAL_GROUP_2,,,,,,DH_EU_CGR_3,,20,,,
thetenant.ie,DP_RAL_GROUP_2,,,,,,DH_EU_CGR_1,,10,,,
thetenant.ie,DP_RAL_GROUP_3,*any,*string:~*req.RalGroup:3,,*weight,,DH_EU_CGR_3,,30,false,,20
thetenant.ie,DP_RAL_GROUP_3,,,,,,DH_EU_CGR_1,,20,,,
thetenant.ie,DP_RAL_GROUP_3,,,,,,DH_EU_CGR_2,,10,,,
thetenant.ie,DP_RAL_GROUP_NOT_FOUND,*any,,,*random,,DH_EU_CGR_1,,30,false,,10
thetenant.ie,DP_RAL_GROUP_NOT_FOUND,,,,,,DH_EU_CGR_2,,20,,,
thetenant.ie,DP_RAL_GROUP_NOT_FOUND,,,,,,DH_EU_CGR_3,,10,,,
Session Attribute for Dispatcher is called RalGroup in my example.
#Tenant,ID,Contexts,FilterIDs,ActivationInterval,AttributeFilterIDs,FieldName,Type,Value,Blocker,Weight
thetenant.ie,AT_AU_35345987653,simpleauth,FI_AC_35345987653,,,*req.Password,*constant,hello,false,10
thetenant.ie,AT_SS_35345987653,*sessions,FI_AC_35345987653,,,*req.Password,*constant,hello,false,20
thetenant.ie,AT_SS_35345987653,,,,,*req.RequestType,*constant,*prepaid,,
thetenant.ie,AT_SS_35345987653,,,,,*req.RalGroup,*constant,3,,
thetenant.ie,AT_SS_35345987653,,,,,*req.Country,*constant,IE,,
Before it has this value in the session it can go to any Cgrates Attributes instance for simpleauth. When it does get it the *string:~*req.RalGroup:3 filter in DispatcherProfiles will ensure the Dispatcher routes queries to its "sticky" cgrates host for everything else (with failover)
Sessions + Dispatchers only are enabled on the Cgrates instance thats colocated with Kamailio server with config like below (needs Datadb to get the dispatcher info)
{
// Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
// Copyright (C) ITsysCOM GmbH
"general": {
"node_id":"eu-kam-1",
"reply_timeout": "5s",
"logger": "*stdout",
"log_level": 7,
},
"listen": {
"rpc_json": "eu-kam-1:2012",
"rpc_gob": "eu-kam-1:2013",
"http": "eu-kam-1:2080",
},
"data_db": {
"db_type": "*redis",
"db_host": "redis.url",
"db_port": 6379,
"db_name": "10",
},
"rpc_conns": {
"birpcconn": {
"strategy": "*first",
"conns": [{"address": "eu-kam-1:2014", "transport": "*json"}],
},
"dispatcherconn": {
"strategy": "*first",
"conns": [{"address": "eu-kam-1:2012", "transport": "*json"}],
},
"session_replication_cgrates": {
"strategy": "*first",
"conns": [{"address": "eu-kam-2:2012", "transport": "*json"}],
},
},
"caches":{
"*dispatcher_profiles" : {"limit": 10000, "ttl":"5s", "precache": true},
"*dispatcher_hosts" : {"limit": 10000, "ttl":"5s", "precache": true},
"*dispatcher_routes": {"limit": -1, "ttl": "5s"},
},
"sessions": {
"enabled": true,
"listen_bijson": "eu-kam-1:2014",
"rals_conns": ["dispatcherconn"],
"cdrs_conns": ["dispatcherconn"],
"resources_conns": ["dispatcherconn"],
"suppliers_conns": ["dispatcherconn"],
"attributes_conns": ["dispatcherconn"],
"stats_conns": ["dispatcherconn"],
"routes_conns": ["dispatcherconn"],
"thresholds_conns": ["dispatcherconn"],
"chargers_conns": ["dispatcherconn"],
"replication_conns": ["session_replication_cgrates"],
"min_call_duration": "1s",
"max_call_duration": "3h",
"min_dur_low_balance": "5s",
"debit_interval": "10s",
"store_session_costs": true,
"channel_sync_interval":"5m",
},
"dispatchers": {
"enabled": true,
},
"kamailio_agent": {
"enabled": true,
"evapi_conns":[{"address": "eu-kam-1:8448", "reconnects": 10}],
"sessions_conns": ["birpcconn"],
"create_cdr": false,
},
}
One thing to note was that on the v10.2 current build I got an error saying there was a missing mandatory parameter ArgDispatcher on a Thresholds query. When I upgraded to v10.3 from late Sep 21 it all worked (the latest dev build on 20th Dec 21 caused a crash on load with a time parsing error)
Hope this helps someone else.
Great software by the way guys - so many great features on top of real time rating. Attributes, Filters and Dispatchers are particularly cool. So flexible
thanks
Paul