$sessionNum is much bigger than actual session number

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
seohangal
Posts: 2
Joined: Fri Apr 27, 2018 11:38 pm

$sessionNum is much bigger than actual session number

Post by seohangal »

1. Brekeke Product Name and Version: Brekeke SIP Server, Version 3.8.3.4, Advanced

2. Java version: 1.8.0_161

3. OS type and the version: Windows Server 2012 R2 Standard

4. UA (phone), gateway or other hardware/software involved:

5. Your problem:
Here are my dial plans.
Rule 1.
[Matching Patterns]
$request = ^INVITE
To = sip:01

[Deploy Patterns]
$target = *.*.*.4
$routename = rt4
$continue = false

Rule 2.
[Matching Patterns]
$request = ^INVITE
To = sip:(.+)@
$route.concurrent("kt0") = (.+)
$route.concurrent("kt55") = (.+)
$route.concurrent("rt4") = (.+)
$sessionNum = (.+)
$math.le("%2","%3") = true

[Deploy Patterns]
To = sip:%1@*.*.0.*
$continue = false
$routename = kt0
$log = kt0:%2,%3,%4,%5

Rule 3.
[Matching Patterns]
$request = ^INVITE
To = sip:(.+)@
$route.concurrent("kt0") = (.+)
$route.concurrent("kt55") = (.+)
$route.concurrent("rt4") = (.+)
$sessionNum = (.+)

[Deploy Patterns]
To = sip:%1@*.*.55.*
$continue = false
$routename = kt55
$log = kt55:%2,%3,%4,%5

Parts of sv.yyyymmdd.log.
kt0:0,0,0,0
kt55:1,0,0,1
kt55:1,0,0,2
kt55:1,0,0,3
kt55:1,0,0,4
...
kt0:92,93,0,1000
kt0:93,93,0,1001
kt0:93,93,0,1002
kt55:96,93,0,1003
kt55:96,94,0,1004
...
kt0:203,203,0,2000
kt55:204,203,0,2000
kt0:204,204,0,2001
kt55:205,204,0,2002
kt55:188,185,0,1999
...
kt55:337,327,0,4900
kt55:337,328,0,4901
kt55:337,328,0,4902
kt55:337,329,0,4903
kt55:337,330,0,4904
...
kt55:257,256,0,9660
kt55:258,257,0,9661
kt55:258,258,0,9662
kt0:258,258,0,9663
kt0:258,259,0,9664
...
kt55:308,307,0,13897
kt55:309,307,0,13898
kt55:309,309,0,13899
kt0:309,309,0,13900 ****
kt0:309,310,0,13901
...

For example, the number of active sessons is 618(309+309) but $sessionNum is 13900.
'Active Sessions' page of admin tool only shows real active sessions(618, not 13900).
What and why is the difference(13900-618)?
Is there a way to release sessions as soon as possible when calls end?
Mike
Posts: 733
Joined: Mon Mar 07, 2005 2:25 pm
Location: Sunny San Mateo
Contact:

Post by Mike »

$sessionNum returns the number of sessions including the closing phase while $route.concurrent doesn't include it.

If a session is canceled or error response is returned, the session will be kept for 90000 ms (1.5min) for waiting for subsequent response packets or ACK.

To shorten this period, let's you tune the variable "net.sip.timeout.bye".
You can set it at [Configuration]->[Advanced] page for applying all sessions, or set it at DialPlan's Deploy Pattern for applying certain sessions.


For example, set the variable below if you want to terminate the closing phase after 1000ms.
-----------------------------
net.sip.timeout.bye=1000
-----------------------------
Depends on network environment but 1000 will be no problem in most cases.


FYI:
> 'Active Sessions' page of admin tool only shows real active sessions(618, not 13900).

You can get all sessions including the closing phase with the command "sessionlist -a" at [Tools]->[Command] page
seohangal
Posts: 2
Joined: Fri Apr 27, 2018 11:38 pm

Post by seohangal »

Thank you for perfect answer. Really what I want to know.
Post Reply