示例#1
0
文件: kamevent.go 项目: bhepp/cgrates
func (kev KamEvent) AsStoredCdr(timezone string) *engine.CDR {
	storCdr := new(engine.CDR)
	storCdr.CGRID = kev.GetCgrId(timezone)
	storCdr.ToR = utils.VOICE
	storCdr.OriginID = kev.GetUUID()
	storCdr.OriginHost = kev.GetOriginatorIP(utils.META_DEFAULT)
	storCdr.Source = kev.GetCdrSource()
	storCdr.RequestType = kev.GetReqType(utils.META_DEFAULT)
	storCdr.Direction = kev.GetDirection(utils.META_DEFAULT)
	storCdr.Tenant = kev.GetTenant(utils.META_DEFAULT)
	storCdr.Category = kev.GetCategory(utils.META_DEFAULT)
	storCdr.Account = kev.GetAccount(utils.META_DEFAULT)
	storCdr.Subject = kev.GetSubject(utils.META_DEFAULT)
	storCdr.Destination = kev.GetDestination(utils.META_DEFAULT)
	storCdr.SetupTime, _ = kev.GetSetupTime(utils.META_DEFAULT, timezone)
	storCdr.AnswerTime, _ = kev.GetAnswerTime(utils.META_DEFAULT, timezone)
	storCdr.Usage, _ = kev.GetDuration(utils.META_DEFAULT)
	storCdr.PDD, _ = kev.GetPdd(utils.META_DEFAULT)
	storCdr.Supplier = kev.GetSupplier(utils.META_DEFAULT)
	storCdr.DisconnectCause = kev.GetDisconnectCause(utils.META_DEFAULT)
	storCdr.ExtraFields = kev.GetExtraFields()
	storCdr.Cost = -1

	return storCdr
}