Fix for SMG CDR source to be the same between CDR and log

This commit is contained in:
DanB
2015-12-10 18:15:07 +01:00
parent a86db78a1d
commit cc8ecc4e51
4 changed files with 4 additions and 3 deletions

View File

@@ -204,7 +204,7 @@ func (self SMGenericEvent) GetOriginatorIP(fieldName string) string {
}
func (self SMGenericEvent) GetCdrSource() string {
return "SM_GENERIC_" + self.GetName()
return utils.SessionManagerGeneric // Needs to match the one in the SMGEvent.saveOperations
}
func (self SMGenericEvent) GetExtraFields() map[string]string {

View File

@@ -148,7 +148,7 @@ func TestSMGenericEventAsStoredCdr(t *testing.T) {
smGev["Extra1"] = "Value1"
smGev["Extra2"] = 5
eStoredCdr := &engine.StoredCdr{CgrId: "0711eaa78e53937f1593dabc08c83ea04a915f2e",
TOR: utils.VOICE, AccId: "12345", CdrHost: "10.0.3.15", CdrSource: "SM_GENERIC_TEST_EVENT", ReqType: utils.META_PREPAID,
TOR: utils.VOICE, AccId: "12345", CdrHost: "10.0.3.15", CdrSource: "SMG", ReqType: utils.META_PREPAID,
Direction: utils.OUT, Tenant: "cgrates.org", Category: "call", Account: "account1", Subject: "subject1",
Destination: "+4986517174963", SetupTime: time.Date(2015, 11, 9, 14, 21, 24, 0, time.UTC), AnswerTime: time.Date(2015, 11, 9, 14, 22, 2, 0, time.UTC),
Usage: time.Duration(83) * time.Second, Pdd: time.Duration(300) * time.Millisecond, Supplier: "supplier1", DisconnectCause: "NORMAL_DISCONNECT",

View File

@@ -206,7 +206,7 @@ func (self *SMGSession) saveOperations() error {
var reply string
err := self.cdrsrv.LogCallCost(&engine.CallCostLog{
CgrId: self.eventStart.GetCgrId(self.timezone),
Source: utils.SESSION_MANAGER_SOURCE,
Source: utils.SessionManagerGeneric,
RunId: self.runId,
CallCost: firstCC,
CheckDuplicate: true,

View File

@@ -261,6 +261,7 @@ const (
NegativePrefix = "!"
MatchStartPrefix = "^"
MatchEndPrefix = "$"
SessionManagerGeneric = "SMG"
)
var (