mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-14 12:49:54 +05:00
RawCDR interface now properly returns duration
This commit is contained in:
@@ -523,6 +523,7 @@ func (self *SQLStorage) SetCdr(cdr utils.RawCDR) (err error) {
|
||||
// map[account:1001 direction:out orig_ip:172.16.1.1 tor:call accid:accid23 answer_time:2013-02-03 19:54:00 cdrsource:freeswitch_csv destination:+4986517174963 duration:62 reqtype:prepaid subject:1001 supplier:supplier1 tenant:cgrates.org]
|
||||
setupTime, _ := cdr.GetSetupTime() // Ignore errors, we want to store the cdr no matter what
|
||||
answerTime, _ := cdr.GetAnswerTime() // Ignore errors, we want to store the cdr no matter what
|
||||
dur, _ := cdr.GetDuration()
|
||||
_, err = self.Db.Exec(fmt.Sprintf("INSERT INTO %s VALUES (NULL,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s', %d)",
|
||||
utils.TBL_CDRS_PRIMARY,
|
||||
cdr.GetCgrId(),
|
||||
@@ -538,7 +539,7 @@ func (self *SQLStorage) SetCdr(cdr utils.RawCDR) (err error) {
|
||||
cdr.GetDestination(),
|
||||
setupTime,
|
||||
answerTime,
|
||||
cdr.GetDuration(),
|
||||
dur,
|
||||
))
|
||||
if err != nil {
|
||||
Logger.Err(fmt.Sprintf("failed to execute cdr insert statement: %v", err))
|
||||
|
||||
Reference in New Issue
Block a user