mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SMKamailio - empty rls fix, Kamailio tutorial configuration updates
This commit is contained in:
@@ -6,6 +6,13 @@
|
||||
// This file contains the default configuration hardcoded into CGRateS.
|
||||
// This is what you get when you load CGRateS with an empty configuration file.
|
||||
|
||||
"general": {
|
||||
"log_level": 7,
|
||||
},
|
||||
|
||||
"stor_db": { // database used to store offline tariff plans and CDRs
|
||||
"db_password": "CGRateS.org", // password to use when connecting to stordb
|
||||
},
|
||||
|
||||
"rals": {
|
||||
"enabled": true,
|
||||
|
||||
@@ -66,7 +66,7 @@ route[CGR_AUTH_REPLY] {
|
||||
$var(CgrMaxSessionTime) = $(var(MaxSessionTime){s.int});
|
||||
$var(CgrSuppliers) = $(var(Suppliers){s.rm,"});
|
||||
$var(CGRResourceAllowed) = $(var(CGRResourceAllowed){s.rm,"});
|
||||
$var(CgrError) = $(var(Error){s.rm,"});
|
||||
$var(CgrError) = $(var(CgrError){s.rm,"});
|
||||
t_continue("$var(id_index)", "$var(id_label)", "CGRATES_AUTH_REPLY"); # Unpark the transaction
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ dns_use_search_list=no
|
||||
|
||||
####### Modules Section ########
|
||||
|
||||
mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/"
|
||||
mpath="/usr/lib64/kamailio/modules/"
|
||||
|
||||
loadmodule "kex.so"
|
||||
loadmodule "corex.so"
|
||||
|
||||
@@ -569,7 +569,6 @@ func (ec *EventCost) Trim(atUsage time.Duration) (srplusEC *EventCost, err error
|
||||
srplsIncrement := lastIncrement.Clone()
|
||||
srplsIncrement.CompressFactor = srplsIncrement.CompressFactor - laItCF
|
||||
srplsIncrements = append([]*ChargingIncrement{srplsIncrement}, srplsIncrements...) // prepend the surplus out of compress
|
||||
//lastIncrement.CompressFactor = laItCF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ package sessionmanager
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"time"
|
||||
|
||||
@@ -32,6 +33,9 @@ import (
|
||||
|
||||
func NewKamailioSessionManager(smKamCfg *config.SmKamConfig, rater, cdrsrv,
|
||||
rlS rpcclient.RpcClientConnection, timezone string) (ksm *KamailioSessionManager, err error) {
|
||||
if rlS != nil && reflect.ValueOf(rlS).IsNil() {
|
||||
rlS = nil
|
||||
}
|
||||
ksm = &KamailioSessionManager{cfg: smKamCfg, rater: rater, cdrsrv: cdrsrv, rlS: rlS,
|
||||
timezone: timezone, conns: make(map[string]*kamevapi.KamEvapi), sessions: NewSessions()}
|
||||
return
|
||||
@@ -70,6 +74,7 @@ func (self *KamailioSessionManager) allocateResources(kev KamEvent) (err error)
|
||||
if self.rlS == nil {
|
||||
return errors.New("no RLs connection")
|
||||
}
|
||||
fmt.Printf("In allocateResources, rls: %+v", self.rlS)
|
||||
var ev map[string]interface{}
|
||||
if ev, err = kev.AsMapStringIface(); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user