mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Changes to cgr-tester sessions
This commit is contained in:
committed by
Dan Christian Bogos
parent
f2108901a1
commit
bbdef8921e
@@ -54,7 +54,7 @@ func callSessions(digitMin, digitMax int64) (err error) {
|
||||
|
||||
event := &utils.CGREvent{
|
||||
Tenant: *tenant,
|
||||
ID: "TheEventID100000",
|
||||
ID: "EventID1",
|
||||
Time: utils.TimePointer(time.Now()),
|
||||
Event: map[string]any{
|
||||
utils.AccountField: acc,
|
||||
@@ -69,8 +69,8 @@ func callSessions(digitMin, digitMax int64) (err error) {
|
||||
|
||||
if *updateInterval > *maxUsage {
|
||||
return fmt.Errorf(`"update_interval" should be smaller than "max_usage"`)
|
||||
} else if *maxUsage <= *minUsage {
|
||||
return fmt.Errorf(`"min_usage" should be smaller than "max_usage"`)
|
||||
} else if *maxUsage < *minUsage {
|
||||
return fmt.Errorf(`"min_usage" should be equal or smaller than "max_usage"`)
|
||||
}
|
||||
|
||||
clntHandlers := map[string]any{
|
||||
@@ -170,6 +170,19 @@ func callSessions(digitMin, digitMax int64) (err error) {
|
||||
log.Printf("Account: <%v>, Destination: <%v>, SessionSv1TerminateSession reply: <%v>", acc, dest, utils.ToJSON(tRply))
|
||||
}
|
||||
|
||||
if countTerminate == *calls {
|
||||
go func() {
|
||||
time.Sleep(10 * time.Second)
|
||||
var sSRply string
|
||||
if err = brpc.Call(utils.SessionSv1SyncSessions, tArgs, &sSRply); err != nil {
|
||||
return
|
||||
}
|
||||
if *verbose {
|
||||
log.Printf("Account: <%v>, Destination: <%v>, SessionSv1TerminateSession reply: <%v>", acc, dest, utils.ToJSON(sSRply))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// Delay between terminate and processCDR for a more realistic case
|
||||
time.Sleep(time.Duration(utils.RandomInteger(20, 40)) * time.Millisecond)
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
debug=2
|
||||
log_stderror=no
|
||||
|
||||
listen=udp:enp0s8:5060
|
||||
listen=udp:enp0s3:5060
|
||||
listen=udp:127.0.0.1:5080
|
||||
listen=udp:127.0.0.1:5060
|
||||
listen=udp:enp0s8:5080
|
||||
listen=udp:enp0s3:5080
|
||||
|
||||
memdbg=5
|
||||
memlog=5
|
||||
|
||||
Reference in New Issue
Block a user