One of the biggest issues with SIP accounting is the occurrence of missing BYEs. If one leg of a call is abruptly disconnected from the network, the BYE request is not generated. In this case, it is not possible to receive the BYE message and determine the duration of the call correctly. There are some approaches to solve this issue:
The SIP session timers
The SIP session timers, described in RFC 4028, enhance the SIP protocol by adding the capability to refresh the SIP sessions by resending periodic re-INVITEs or UPDATEs. To implement SIP session timers, it is necessary to have support on at least one of the SIP endpoints, the client, or the gateway. The advantage of this method is that it uses only signaling without any control of the media. In the Chapter 8, Managing Dialogs, we have already discussed the setup of the SIP Session Timers (SST).
The RTP proxy timeout
Recently, a timeout socket was included in the RTP proxy. You can use an external program connected...