mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SessionS.BiRPCV1InitiateSession force return of maxCallDuration
This commit is contained in:
@@ -1335,6 +1335,8 @@ func (smg *SMGeneric) BiRPCV1InitiateSession(clnt rpcclient.RpcClientConnection,
|
||||
}
|
||||
if authUsage != time.Duration(-1) {
|
||||
*maxUsage = authUsage.Seconds()
|
||||
} else {
|
||||
*maxUsage = smg.cgrCfg.SessionSCfg().MaxCallDuration.Seconds() // Force max since -1 is not supported by OpenSIPS 2.1
|
||||
}
|
||||
} else {
|
||||
*maxUsage = minMaxUsage.Seconds()
|
||||
|
||||
@@ -32,6 +32,18 @@ func IsSliceMember(ss []string, s string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// SliceHasMember is a simpler mode to match inside a slice
|
||||
// useful to search in shared vars (no slice sort)
|
||||
func SliceHasMember(ss []string, s string) (has bool) {
|
||||
for _, mbr := range ss {
|
||||
if mbr == s {
|
||||
has = true
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func SliceWithoutMember(ss []string, s string) []string {
|
||||
sort.Strings(ss)
|
||||
if i := sort.SearchStrings(ss, s); i < len(ss) && ss[i] == s {
|
||||
|
||||
Reference in New Issue
Block a user