本文整理汇总了Golang中github.com/cgrates/cgrates/utils.StoredCdr.Destination方法的典型用法代码示例。如果您正苦于以下问题:Golang StoredCdr.Destination方法的具体用法?Golang StoredCdr.Destination怎么用?Golang StoredCdr.Destination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/cgrates/cgrates/utils.StoredCdr
的用法示例。
在下文中一共展示了StoredCdr.Destination方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: AsStoredCdr
func (fsev FSEvent) AsStoredCdr() *utils.StoredCdr {
storCdr := new(utils.StoredCdr)
storCdr.CgrId = fsev.GetCgrId()
storCdr.TOR = utils.VOICE
storCdr.AccId = fsev.GetUUID()
storCdr.CdrHost = fsev.GetOriginatorIP(utils.META_DEFAULT)
storCdr.CdrSource = "FS_" + fsev.GetName()
storCdr.ReqType = fsev.GetReqType(utils.META_DEFAULT)
storCdr.Direction = fsev.GetDirection(utils.META_DEFAULT)
storCdr.Tenant = fsev.GetTenant(utils.META_DEFAULT)
storCdr.Category = fsev.GetCategory(utils.META_DEFAULT)
storCdr.Account = fsev.GetAccount(utils.META_DEFAULT)
storCdr.Subject = fsev.GetSubject(utils.META_DEFAULT)
storCdr.Destination = fsev.GetDestination(utils.META_DEFAULT)
storCdr.SetupTime, _ = fsev.GetSetupTime(utils.META_DEFAULT)
storCdr.AnswerTime, _ = fsev.GetAnswerTime(utils.META_DEFAULT)
storCdr.Usage, _ = fsev.GetDuration(utils.META_DEFAULT)
storCdr.ExtraFields = fsev.GetExtraFields()
storCdr.Cost = -1
return storCdr
}
示例2: AsStoredCdr
func (fsCdr FSCdr) AsStoredCdr() *utils.StoredCdr {
storCdr := new(utils.StoredCdr)
storCdr.CgrId = fsCdr.getCgrId()
storCdr.TOR = utils.VOICE
storCdr.AccId = fsCdr.vars[FS_UUID]
storCdr.CdrHost = fsCdr.vars[FS_IP]
storCdr.CdrSource = FS_CDR_SOURCE
storCdr.ReqType = utils.FirstNonEmpty(fsCdr.vars[FS_REQTYPE], cfg.DefaultReqType)
storCdr.Direction = "*out"
storCdr.Tenant = utils.FirstNonEmpty(fsCdr.vars[FS_CSTMID], cfg.DefaultTenant)
storCdr.Category = utils.FirstNonEmpty(fsCdr.vars[FS_CATEGORY], cfg.DefaultCategory)
storCdr.Account = utils.FirstNonEmpty(fsCdr.vars[FS_ACCOUNT], fsCdr.vars[FS_USERNAME])
storCdr.Subject = utils.FirstNonEmpty(fsCdr.vars[FS_SUBJECT], fsCdr.vars[FS_USERNAME])
storCdr.Destination = utils.FirstNonEmpty(fsCdr.vars[FS_DESTINATION], fsCdr.vars[FS_CALL_DEST_NR], fsCdr.vars[FS_SIP_REQUSER])
storCdr.SetupTime, _ = utils.ParseTimeDetectLayout(fsCdr.vars[FS_SETUP_TIME]) // Not interested to process errors, should do them if necessary in a previous step
storCdr.AnswerTime, _ = utils.ParseTimeDetectLayout(fsCdr.vars[FS_ANSWER_TIME])
storCdr.Usage, _ = utils.ParseDurationWithSecs(fsCdr.vars[FS_DURATION])
storCdr.ExtraFields = fsCdr.getExtraFields()
storCdr.Cost = -1
return storCdr
}