[SR-Users] Calculate call duration

Daniel Tryba d.tryba at pocos.nl
Mon Dec 30 17:46:40 CET 2019


On Mon, Dec 30, 2019 at 12:04:47PM +0000, Duarte Rocha wrote:
> How sould a call duration be calculated?
> 
> Let's say the call creation on Kamailio as a proxy has those steps :
> 
> 1 - Invite is received
> 2 - Provisional responses
> 3 - 200 OK is received
> 4 - ACK to 200 OK is received
> 5 - BYE is received
> 6 - 200 OK to BYE is received
> 
> Should the duration begin to count on step 3 (200-Ok Received) or 4 (ACK
> received) ?
> Should it end on the step 5 or 6?
 
IMHO from 3 to 5.

If you choose 4 to start people can get an x (30) amount of seconds for
free by simply not sending an ACK. RTP will already be established and
there will be 2 way communication. Not receiving the ACK will result in
a teardown of the connection. But 30s free phone calls are enough for
most.

Same for 5, you got a BYE and the only option you have to not getting an
ACK is sending other BYEs and eventually tearing down the call. If you
stop RTP at this moment and propagate the BYE there is nothgin more you
can do IMHO.




More information about the sr-users mailing list