mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
Adding prepaid1centpsec rate sample files
This commit is contained in:
@@ -207,14 +207,14 @@ func (sm *FSSessionManager) OnChannelHangupComplete(ev Event) {
|
||||
return
|
||||
}
|
||||
cd := rater.CallDescriptor{
|
||||
Direction: ev.GetDirection(),
|
||||
Tenant: ev.GetTenant(),
|
||||
TOR: ev.GetTOR(),
|
||||
Subject: ev.GetSubject(),
|
||||
Account: ev.GetAccount(),
|
||||
Destination: ev.GetDestination(),
|
||||
TimeStart: startTime,
|
||||
TimeEnd: endTime,
|
||||
Direction: ev.GetDirection(),
|
||||
Tenant: ev.GetTenant(),
|
||||
TOR: ev.GetTOR(),
|
||||
Subject: ev.GetSubject(),
|
||||
Account: ev.GetAccount(),
|
||||
Destination: ev.GetDestination(),
|
||||
TimeStart: startTime,
|
||||
TimeEnd: endTime,
|
||||
FallbackSubject: ev.GetFallbackSubj(),
|
||||
}
|
||||
cc := &rater.CallCost{}
|
||||
@@ -342,8 +342,8 @@ func (sm *FSSessionManager) Shutdown() (err error) {
|
||||
rater.Logger.Info("Shutting down all sessions...")
|
||||
cmdKillPrepaid := "hupall MANAGER_REQUEST cgr_reqtype prepaid"
|
||||
cmdKillPostpaid := "hupall MANAGER_REQUEST cgr_reqtype postpaid"
|
||||
for _,cmd := range[]string{cmdKillPrepaid, cmdKillPostpaid} {
|
||||
if err = fsock.FS.SendApiCmd(cmd); err!= nil {
|
||||
for _, cmd := range []string{cmdKillPrepaid, cmdKillPostpaid} {
|
||||
if err = fsock.FS.SendApiCmd(cmd); err != nil {
|
||||
rater.Logger.Err(fmt.Sprintf("Error on calls shutdown: %s", err))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ func NewSession(ev Event, sm SessionManager) (s *Session) {
|
||||
return
|
||||
}
|
||||
// Make sure cgr_type is enforced even if not set by FreeSWITCH
|
||||
if err := fsock.FS.SendApiCmd(fmt.Sprintf("uuid_setvar %s cgr_reqtype %s\n\n", ev.GetUUID(), ev.GetReqType())); err!=nil {
|
||||
if err := fsock.FS.SendApiCmd(fmt.Sprintf("uuid_setvar %s cgr_reqtype %s\n\n", ev.GetUUID(), ev.GetReqType())); err != nil {
|
||||
rater.Logger.Err(fmt.Sprintf("Error on attempting to overwrite cgr_type in chan variables: %v", err))
|
||||
}
|
||||
startTime, err := ev.GetStartTime(START_TIME)
|
||||
|
||||
@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package sessionmanager
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/cgrates/cgrates/config"
|
||||
"testing"
|
||||
// "time"
|
||||
)
|
||||
|
||||
@@ -67,9 +67,9 @@ var (
|
||||
func TestSessionNilSession(t *testing.T) {
|
||||
cfgTestPath := "../config/test_data.txt"
|
||||
var errCfg error
|
||||
cfg,errCfg = config.NewCGRConfig(&cfgTestPath) // Needed here to avoid nil on cfg variable
|
||||
if errCfg!= nil {
|
||||
t.Errorf("Cannot get configuration %v",errCfg)
|
||||
cfg, errCfg = config.NewCGRConfig(&cfgTestPath) // Needed here to avoid nil on cfg variable
|
||||
if errCfg != nil {
|
||||
t.Errorf("Cannot get configuration %v", errCfg)
|
||||
}
|
||||
newEvent := new(FSEvent).New("")
|
||||
sm := &FSSessionManager{}
|
||||
|
||||
Reference in New Issue
Block a user