mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 21:59:53 +05:00
Diameter fix timezone in message, fix values returned from session generic in case of debits
This commit is contained in:
@@ -201,7 +201,7 @@ func TestDmtAgentSendCCRInit(t *testing.T) {
|
||||
time.Sleep(time.Duration(100) * time.Millisecond)
|
||||
var acnt *engine.Account
|
||||
attrs := &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "1001"}
|
||||
eAcntVal := 9.5
|
||||
eAcntVal := 9.484
|
||||
if err := apierRpc.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal {
|
||||
@@ -232,7 +232,7 @@ func TestDmtAgentSendCCRUpdate(t *testing.T) {
|
||||
time.Sleep(time.Duration(100) * time.Millisecond)
|
||||
var acnt *engine.Account
|
||||
attrs := &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "1001"}
|
||||
eAcntVal := 9.25
|
||||
eAcntVal := 9.214
|
||||
if err := apierRpc.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal {
|
||||
@@ -263,7 +263,7 @@ func TestDmtAgentSendCCRUpdate2(t *testing.T) {
|
||||
time.Sleep(time.Duration(100) * time.Millisecond)
|
||||
var acnt *engine.Account
|
||||
attrs := &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "1001"}
|
||||
eAcntVal := 9.0
|
||||
eAcntVal := 8.944
|
||||
if err := apierRpc.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal {
|
||||
@@ -293,7 +293,7 @@ func TestDmtAgentSendCCRTerminate(t *testing.T) {
|
||||
time.Sleep(time.Duration(100) * time.Millisecond)
|
||||
var acnt *engine.Account
|
||||
attrs := &utils.AttrGetAccount{Tenant: "cgrates.org", Account: "1001"}
|
||||
eAcntVal := 9.2416
|
||||
eAcntVal := 9.205
|
||||
if err := apierRpc.Call("ApierV2.GetAccount", attrs, &acnt); err != nil {
|
||||
t.Error(err)
|
||||
} else if acnt.BalanceMap[utils.MONETARY].GetTotalValue() != eAcntVal { // Should also consider derived charges which double the cost of 6m10s - 2x0.7584
|
||||
|
||||
@@ -246,7 +246,7 @@ func (self *CCR) AsDiameterMessage() (*diam.Message, error) {
|
||||
diam.NewAVP(420, avp.Mbit, 0, datatype.Unsigned32(self.RequestedServiceUnit.CCTime))}}); err != nil { // CC-Time
|
||||
return nil, err
|
||||
}
|
||||
if si, err := m.NewAVP("Service-Information", avp.Mbit, 10415, &diam.GroupedAVP{
|
||||
if _, err := m.NewAVP("Service-Information", avp.Mbit, 10415, &diam.GroupedAVP{
|
||||
AVP: []*diam.AVP{
|
||||
diam.NewAVP(20300, avp.Mbit, 20300, &diam.GroupedAVP{
|
||||
AVP: []*diam.AVP{
|
||||
@@ -259,15 +259,13 @@ func (self *CCR) AsDiameterMessage() (*diam.Message, error) {
|
||||
diam.NewAVP(20313, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.BearerCapability)), // Bearer-Capability
|
||||
diam.NewAVP(20321, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.CallReferenceNumber)), // Call-Reference-Number
|
||||
diam.NewAVP(20322, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.MSCAddress)), // MSC-Address
|
||||
diam.NewAVP(20324, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.TimeZone)), // Time-Zone
|
||||
diam.NewAVP(20324, avp.Mbit, 20300, datatype.Unsigned32(self.ServiceInformation.INInformation.TimeZone)), // Time-Zone
|
||||
diam.NewAVP(20385, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.CalledPartyNP)), // Called-Party-NP
|
||||
diam.NewAVP(20386, avp.Mbit, 20300, datatype.UTF8String(self.ServiceInformation.INInformation.SSPTime)), // SSP-Time
|
||||
},
|
||||
}),
|
||||
}}); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
fmt.Printf("### Service-Information AVP: %+v\n", si)
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user