When providing a service to a wholesale customer an owner of the Sippy 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 Sippy Softswitch starting from Sippy 2020 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 Sippy 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 Sippy 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 Sippy 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.
Algorithms of the session time allocation:
- Average Call Duration (ACD) only - every new allocation tries to acquire exactly one more ACD. This algorithm defaults to 5 seconds if ACD is 5 seconds or less.
- Incremental - Default algorithm. the Sippy 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.
Setup:
Web UI:
Billing section of System Parameters/ Billing, SMTP Server has value Balance Allocation Alg.
XMLAPI:
System Config xmlapi processes the key 'system/strackerd/next_duration_algorithm'
Allocation 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
Timeline | Try To Allocate | Actually Allocated Period | Session Timeout | Blocked Balance |
---|---|---|---|---|
Connect + 0 seconds | 140 seconds | 145 seconds | 145 seconds | $1+$9=$10 |
Connect + 140 seconds | 140 seconds | 150 seconds | 295 seconds | $10+$10=$20 |
Connect + 290 seconds | 140 seconds | 150 seconds | 445 seconds | $20+$10=$30 |
Incremental algorithm for the case when ACD <200 (ACD = 140)
Timeline | Try To Allocate | Actually Allocated Period | Session Timeout | Blocked Balance |
---|---|---|---|---|
Connect + 0 seconds | 10 seconds | 10 seconds | 10 seconds | $1 |
Connect + 5 seconds | 20 seconds | 30 seconds | 40 seconds | $1+$2=$3 |
Connect + 35 seconds | 40 seconds | 45 seconds | 85 seconds | $3+$3=$6 |
Connect + 80 seconds | 80 seconds | 90 seconds | 175 seconds | $6+$6=$12 |
Connect + 170 seconds | 160 seconds | 165 seconds | 340 seconds | $12+$11=$23 |
Connect + 335 seconds | 200 seconds | 210 seconds | 550 seconds | $23+$14=$37 |
Connect + 545 seconds | 200 seconds | 210 seconds | 760 seconds | $37+$14=$51 |
Connect + 755 seconds | 200 seconds | 210 seconds | 970 seconds | $51+$14=$65 |
Incremental algorithm for the case when ACD >200 (ACD = 230)
Timeline | Try To Allocate | Actually Allocated Period | Session Timeout | Blocked Balance |
---|---|---|---|---|
Connect + 0 seconds | 10 seconds | 10 seconds | 10 seconds | $1 |
Connect + 5 seconds | 20 seconds | 30 seconds | 40 seconds | $1+$2=$3 |
Connect + 35 seconds | 40 seconds | 45 seconds | 85 seconds | $3+$3=$6 |
Connect + 80 seconds | 80 seconds | 90 seconds | 175 seconds | $6+$6=$12 |
Connect + 170 seconds | 160 seconds | 165 seconds | 340 seconds | $12+$11=$23 |
Connect + 335 seconds | 230 seconds | 240 seconds | 580 seconds | $23+$16=$39 |
Connect + 575 seconds | 230 seconds | 240 seconds | 820 seconds | $39+$16=$55 |
Connect + 815 seconds | 230 seconds | 240 seconds | 1060 seconds | $55+$16=$71 |