This commit is contained in:
DanB
2015-05-13 23:42:57 +02:00
4 changed files with 10 additions and 6 deletions

View File

@@ -24,7 +24,7 @@ func init() {
c := &CmdGetMaxDuration{
name: "maxduration",
rpcMethod: "Responder.GetMaxSessionTime",
clientArgs: []string{"Direction", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"},
clientArgs: []string{"Direction", "Category", "TOR", "Tenant", "Subject", "Account", "Destination", "TimeStart", "TimeEnd", "CallDuration", "FallbackSubject"},
}
commands[c.Name()] = c
c.CommandExecuter = &CommandExecuter{c}

View File

@@ -15,7 +15,7 @@ cd /usr/share/cgrates/storage/mysql && ./setup_cgr_db.sh root CGRateS.org
cd /usr/share/cgrates/storage/postgres && ./setup_cgr_db.sh
#env vars
export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
# build and install cgrates
/root/cgr/update_external_libs.sh
@@ -29,5 +29,5 @@ cd /usr/share/cgrates/tutorials/fs_evsock/freeswitch/etc/ && tar xzf freeswitch_
cd /root/cgr
echo "for cgradmin run: cgr-engine -config_dir data/conf/samples/cgradmin"
echo 'export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$PATH:$GOROOT/bin:$GOPATH/bin'>>/root/.zshrc
echo 'export GOROOT=/root/go; export GOPATH=/root/code; export PATH=$GOROOT/bin:$GOPATH/bin:$PATH'>>/root/.zshrc
zsh

View File

@@ -2,6 +2,6 @@
ALWAYS,*any,*any,*any,*any,00:00:00
ASAP,*any,*any,*any,*any,*asap
PEAK,*any,*any,*any,1;2;3;4;5,08:00:00
OFFPEAK_MORNING,*any,*any,*any,1,00:00:00
OFFPEAK_MORNING,*any,*any,*any,1;2;3;4;5,00:00:00
OFFPEAK_EVENING,*any,*any,*any,1;2;3;4;5,19:00:00
OFFPEAK_WEEKEND,*any,*any,*any,6;7,00:00:00
1 #Tag Years Months MonthDays WeekDays Time
2 ALWAYS *any *any *any *any 00:00:00
3 ASAP *any *any *any *any *asap
4 PEAK *any *any *any 1;2;3;4;5 08:00:00
5 OFFPEAK_MORNING *any *any *any 1 1;2;3;4;5 00:00:00
6 OFFPEAK_EVENING *any *any *any 1;2;3;4;5 19:00:00
7 OFFPEAK_WEEKEND *any *any *any 6;7 00:00:00

View File

@@ -324,6 +324,10 @@ func (b *Balance) DebitUnits(cd *CallDescriptor, ub *Account, moneyBalances Bala
ts.createIncrementsSlice()
}
//log.Printf("TS: %+v", ts)
if ts.RateInterval == nil {
Logger.Err(fmt.Sprintf("Nil RateInterval ERROR on TS: %+v, CC: %+v, from CD: %+v", ts, cc, cd))
continue
}
maxCost, strategy := ts.RateInterval.GetMaxCost()
for incIndex, inc := range ts.Increments {
// debit minutes and money
@@ -420,10 +424,10 @@ func (b *Balance) DebitMoney(cd *CallDescriptor, ub *Account, count bool, dryRun
ts.createIncrementsSlice()
}
//log.Printf("TS: %+v", ts)
/*if ts.RateInterval == nil {
if ts.RateInterval == nil {
Logger.Err(fmt.Sprintf("Nil RateInterval ERROR on TS: %+v, CC: %+v, from CD: %+v", ts, cc, cd))
continue
}*/
}
maxCost, strategy := ts.RateInterval.GetMaxCost()
//log.Printf("Timing: %+v", ts.RateInterval.Timing)
//log.Printf("Rate: %+v", ts.RateInterval.Rating)