Max Session Duration

Last updated by FlySIP Support on November 11, 2019 22:17

When providing a service to a wholesale customer an owner of the Flysip Softswitch needs to allow as many simultaneous sessions as possible while at the same time prohibiting the customer to overuse his balance.

To achieve this goal the flysip Softswitch starting from version 5.3 extends the allowed maximum duration of an active call in real time. The algorithm is changed only for Accounts's balance and works like this:

  • A call comes in. The flysip tries to allocate money for the first period of time.
  • If the balance is sufficient then the call is allowed to connect and continue at least for this first period.
  • The call connects and some time before the allocated time is over the flysip tries to allocate additional period of time to extend the duration of the call.
  • If this allocation is successful then the maximum allowed call duration is extended accordingly.
  • This re-allocation is repeated until either balance is over or Max Session Time of an Account is reached.
  • When the next re-allocation is unsuccessful the f;does not extend the max call duration anymore and the call is disconnected by Session Timeout when it reaches the max call duration which was set previously.

There are two possible algorithms of the session time allocation.

  • Average Call Duration (ACD) only - every new allocation tries to acquire exactly one more ACD. This algorithm fails if the ACD is 5 seconds or less.
  • Incremental - the flysip tries to acquire 10 seconds first and twice as much as previously attempted duration until it reaches either 200 seconds or ACD, whichever is bigger. Further allocation till Session Timeout is performed according to the tables below

New allocation attempt is performed 5 seconds before Session Timeout for the call.

Example

Lets assume that:

  • Interval 1 = 10 seconds
  • Interval N = 15 seconds
  • Price 1 = $6 / minute
  • Price N = $4 / minute

ACD algorithm, ACD = 140 seconds

TimelineTry To Allocate

Actually Allocated Period

Session TimeoutBlocked Balance
Connect + 0 seconds140 seconds145 seconds145 seconds$1+$9=$10
Connect + 140 seconds140 seconds150 seconds295 seconds$10+$10=$20
Connect + 290 seconds140 seconds150 seconds445 seconds$20+$10=$30

Incremental algorithm for the case when ACD <200 (ACD = 140)

TimelineTry To AllocateActually Allocated PeriodSession TimeoutBlocked Balance
Connect + 0 seconds10 seconds10 seconds10 seconds$1
Connect + 5 seconds20 seconds30 seconds40 seconds$1+$2=$3
Connect + 35 seconds40 seconds45 seconds85 seconds$3+$3=$6
Connect + 80 seconds80 seconds90 seconds175 seconds$6+$6=$12
Connect + 170 seconds160 seconds165 seconds340 seconds$12+$11=$23
Connect + 335 seconds200 seconds210 seconds550 seconds$23+$14=$37
Connect + 545 seconds200 seconds210 seconds760 seconds$37+$14=$51
Connect + 755 seconds200 seconds210 seconds970 seconds$51+$14=$65

Incremental algorithm for the case when ACD >200 (ACD = 230)

TimelineTry To AllocateActually Allocated PeriodSession TimeoutBlocked Balance
Connect + 0 seconds10 seconds10 seconds10 seconds$1
Connect + 5 seconds20 seconds30 seconds40 seconds$1+$2=$3
Connect + 35 seconds40 seconds45 seconds85 seconds$3+$3=$6
Connect + 80 seconds80 seconds90 seconds175 seconds$6+$6=$12
Connect + 170 seconds160 seconds165 seconds340 seconds$12+$11=$23
Connect + 335 seconds230 seconds240 seconds580 seconds$23+$16=$39
Connect + 575 seconds230 seconds240 seconds820 seconds$39+$16=$55
Connect + 815 seconds230 seconds240 seconds1060 seconds$55+$16=$71

This algorithm is available only in the new version of the strackerd, which can be enabled by setting 'system/strackerd/binary' option to a value 'pkg' in the system_config table. This option is unavailable via XML-RPC API and can be tuned manually only.

The time allocation algorithm can be chosen with the option 'system/strackerd/next_duration_algorithm' in the system_config table. The available values are 'ACD' (default) and 'incremental'. This option is unavailable via XML-RPC API and can be tuned manually only.