Trying to implement the above derived rating example with dual prepaid debiting but struggling
Two Chargers are both setup and both are triggered.
The first charger does the Retail charging based in the end user account and tenant
The second charger substitutes the account and tenant for the reseller charger account and tenant via Attributes. The end user session sets these reseller values and then the wholesale charger attributesID swaps the values.
The initial response looks good as per below ngrep of the Sessions to Rals.
The retail charger then does GetMaxSessionTime and this comes back OK
When the wholesale charger attempts to do GetMaxSessionTime the tenant has reverted to the retail tenant even though the account has been substituted and I get ACCOUNT_NOT_FOUND (as its on the other tenant). I thought the principle of the Attribute substitution in Chargers was that it was maintained for the forked charging session. I have tried many combinations of substitution using *tenant, *req.Tenant and both but its the same result.
Any ideas?
interface: any
filter: ( port 32051 ) and (ip || ip6)
#
{"method":"AttributeSv1.ProcessEvent","params":[{"AttributeIDs":null,"Context":"*sessions","ProcessRuns":null,"Tenant":"
reta.tn","ID":"23948b8","Time":"2021-07-03T23:03:00+01:00","Event":{"Account":"3532268
03023","Destination":"35322392293","EvapiConnID":0,"OriginHost":"
10.131.91.10:8448","SetupTime":"1625349780","Source":"KamailioAgent","Tenant":"
reta.tn"}}],"id":166}.
#
{"id":166,"result":{"MatchedProfiles":["AT_SS_353226803023"],"AlteredFields":["*req.Password","*req.RequestType","*req.ResellerAccount","*req.ResellerTenant","*req.Country"],"CGREvent":{"Tenant":"
reta.tn","
ID":"23948b8","Time":"2021-07-03T23:03:00+01:00","Event":{"Account":"353226803023","Country":"IE","Destination":"35322392293","EvapiConnID":0,"OriginHost":"
10.131.91.10:8448","Password":"blahblahb","Request
Type":"*prepaid","ResellerAccount":"88100001","ResellerTenant":"wholes.ten","SetupTime":"1625349780","Source":"KamailioAgent","Tenant":"
reta.tn"}}},"error":null}.
##
{"method":"ChargerSv1.ProcessEvent","params":[{"Tenant":"
reta.tn","ID":"ba39304","Time":null,"Event":{"Account":"353226803023","CGRID":"6d41ec4f886f3cfab28cf043cfacb3e540e36ba1","Country":"IE","Destination"
:"35322392293","EvapiConnID":0,"OriginHost":"
10.131.91.10:8448","Password":"blahblahb","RequestType":"*prepaid","ResellerAccount":"88100001","ResellerTenant":"wholes.ten","SetupTime":"1625349780","Source":"
KamailioAgent","Tenant":"
reta.tn","Usage":43200000000000}}],"id":167}.
#
{"id":167,"result":[{"ChargerSProfile":"CG_RETAIL","AttributeSProfiles":["AT_CG_RETAIL"],"AlteredFields":["*req.RunID","*req.Subject"],"CGREvent":{"Tenant":"
reta.tn","ID":"ba39304","Time":null,"Event":{"Acc
ount":"353226803023","CGRID":"6d41ec4f886f3cfab28cf043cfacb3e540e36ba1","Country":"IE","Destination":"35322392293","EvapiConnID":0,"OriginHost":"
10.131.91.10:8448","Password":"blahblahb","RequestType":"*pre
paid","ResellerAccount":"88100001","ResellerTenant":"wholes.ten","RunID":"Retail","SetupTime":"1625349780","Source":"KamailioAgent","Subject":"Retail","Tenant":"
reta.tn","Usage":43200000000000}}},{"ChargerS
Profile":"CG_WHOLESALE","AttributeSProfiles":["AT_CG_WHOLESALE"],"AlteredFields":["*req.RunID","*req.Account","*req.OriginalAccount","*req.OriginalTenant","*req.Subject","*req.Tenant","*tenant","*req.Reques
tType"],"CGREvent":{"Tenant":"wholes.ten","ID":"ba39304","Time":null,"Event":{"Account":"88100001","CGRID":"6d41ec4f886f3cfab28cf043cfacb3e540e36ba1","Country":"IE","Destination":"35322392293","EvapiConnID"
:0,"OriginHost":"
10.131.91.10:8448","OriginalAccount":"353226803023","OriginalTenant":"
reta.tn","Password":"blahblahb","RequestType":"*prepaid","ResellerAccount":"88100001","ResellerTenant":"wholes.ten","Ru
nID":"Wholesale","SetupTime":"1625349780","Source":"KamailioAgent","Subject":"Wholesale","Tenant":"wholes.ten","Usage":43200000000000}}}],"error":null}.
#
{"method":"Responder.GetMaxSessionTime","params":[{"Category":"call","Tenant":"
reta.tn","Subject":"Retail","Account":"353226803023","Destination":"35322392293","TimeStart":"2021-07-03T23:03:00+01:00","TimeE
nd":"2021-07-04T11:03:00+01:00","LoopIndex":0,"DurationIndex":0,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"","ExtraFields":{"Country":"IE","EvapiConnID":"0","Password":"blahblahb","Res
ellerAccount":"88100001","ResellerTenant":"wholes.ten"},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"6d41ec4f886f3cfab28cf043cfacb3e540e36ba1","RunID":"Retail","ForceDuration":false,"PerformRoundin
g":false,"DryRun":false,"DenyNegativeAccount":false}],"id":168}.
##
{"id":168,"result":117000000000,"error":null}.
#
{"method":"Responder.GetMaxSessionTime","params":[{"Category":"call","Tenant":"
reta.tn","Subject":"Wholesale","Account":"88100001","Destination":"35322392293","TimeStart":"2021-07-03T23:03:00+01:00","TimeEn
d":"2021-07-04T11:03:00+01:00","LoopIndex":0,"DurationIndex":0,"FallbackSubject":"","RatingInfos":null,"Increments":null,"ToR":"","ExtraFields":{"Country":"IE","EvapiConnID":"0","OriginalAccount":"353226803
023","OriginalTenant":"
reta.tn","Password":"blahblahb","ResellerAccount":"88100001","ResellerTenant":"wholes.ten"},"MaxRate":0,"MaxRateUnit":0,"MaxCostSoFar":0,"CgrID":"6d41ec4f886f3cfab28cf043cfacb3e540e36
ba1","RunID":"Wholesale","ForceDuration":false,"PerformRounding":false,"DryRun":false,"DenyNegativeAccount":false}],"id":169}.
##
{"id":169,"result":null,"error":"ACCOUNT_NOT_FOUND"}.
#exit
12 received, 8 matched