mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
get cost from call cost
This commit is contained in:
@@ -155,15 +155,10 @@ func (mys *MySQLStorage) SetCdr(cdr CDR) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (mys *MySQLStorage) SetRatedCdr(cdr CDR, callcost *CallCost) (err error) {
|
||||
rate, err := cdr.GetRate()
|
||||
if err != nil {
|
||||
fmt.Println("Could not find rate in cdr")
|
||||
return err
|
||||
}
|
||||
func (mys *MySQLStorage) SetRatedCdr(cdr CDR, cc *CallCost) (err error) {
|
||||
_, err = mys.Db.Exec(fmt.Sprintf("INSERT INTO rated_cdrs VALUES ('%s', '%s', '%s', '%s')",
|
||||
cdr.GetCgrId(),
|
||||
rate,
|
||||
cc.Cost,
|
||||
"cgrcostid",
|
||||
"cdrsrc",
|
||||
))
|
||||
|
||||
@@ -155,14 +155,13 @@ func (psl *PostgresStorage) SetCdr(cdr CDR) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (psl *PostgresStorage) SetRatedCdr(cdr CDR, callcost *CallCost) (err error) {
|
||||
rate, err := cdr.GetRate()
|
||||
func (psl *PostgresStorage) SetRatedCdr(cdr CDR, cc *CallCost) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = psl.Db.Exec(fmt.Sprintf("INSERT INTO cdrs_extra VALUES ('%s', '%s', '%s', '%s')",
|
||||
cdr.GetCgrId(),
|
||||
rate,
|
||||
cc.Cost,
|
||||
"cgrcostid",
|
||||
"cdrsrc",
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user