fix for UNAUTHORIZED_DESTINATION on sms/mms

This commit is contained in:
Radu Ioan Fericean
2016-01-28 14:22:59 +02:00
parent 03f2ba4ee9
commit de5e332e72

View File

@@ -358,6 +358,8 @@ func (rs *Responder) GetDerivedMaxSessionTime(ev *CDR, reply *float64) error {
usage = config.CgrConfig().MaxCallDuration
}
cd := &CallDescriptor{
CgrId: ev.GetCgrId(rs.Timezone),
TOR: ev.ToR,
Direction: ev.GetDirection(dc.DirectionField),
Tenant: ev.GetTenant(dc.TenantField),
Category: ev.GetCategory(dc.CategoryField),
@@ -435,6 +437,13 @@ func (rs *Responder) GetSessionRuns(ev *CDR, sRuns *[]*SessionRun) error {
})
return errors.New("Error parsing answer event start time")
}
endTime, err := ev.GetEndTime("", rs.Timezone)
if err != nil {
rs.getCache().Cache(utils.GET_SESS_RUNS_CACHE_PREFIX+ev.CGRID, &cache2go.CacheItem{
Err: err,
})
return errors.New("Error parsing answer event end time")
}
cd := &CallDescriptor{
CgrId: ev.GetCgrId(rs.Timezone),
TOR: ev.ToR,
@@ -445,6 +454,7 @@ func (rs *Responder) GetSessionRuns(ev *CDR, sRuns *[]*SessionRun) error {
Account: ev.GetAccount(dc.AccountField),
Destination: ev.GetDestination(dc.DestinationField),
TimeStart: startTime,
endTime: endTime,
ExtraFields: ev.GetExtraFields()}
sesRuns = append(sesRuns, &SessionRun{DerivedCharger: dc, CallDescriptor: cd})
}