Adding prepaid1centpsec rate sample files

This commit is contained in:
DanB
2013-04-11 15:29:30 +02:00
parent 44d5ef8854
commit 2e649e7330
17 changed files with 76 additions and 44 deletions

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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{}