ptime=20, 30, 40
In the SIP session, we can set ‘ptime’ parameter of SDP to negotiate RTP packages between two call parties. If one side has different idea about the RTP package size, it can send its own ‘ptime’ parameter back with the value it wishs. But the world is so complex, some SIP devices don’t care ‘ptime’ paramter and they don’t tell other sides which values they like, they just send RTP packages back directly. It could cause problem.
For example, as we know, ‘call recording‘ service requires miniSIPServer to mix two audio streams from both call parties. In order to make the work easy, miniSIPServer will set ‘ptime’ to 20 which means the call parties should send their audio streams in RTP packages every 20 milliseconds, then miniSIPServer get two packages every 20 milliseconds and mix them into local audio files. Now surprised, some devices send RTP packages every 30 milliseconds, some send RTP packages every 40 milliseconds. When miniSIPServer has to mix these packages, some bytes have to been lost since the time is different and the package size is different too. It makes the audio quality of local audio files very poor.
Of course, the perfect solution is all SIP devices respect ‘ptime’ parameter, but we cannot count on it.
So miniSIPServer is upgraded to V40 (build 20220922) to fix it. The new version will try to cache RTP packages of both sides and smooth the mixing procedures. And we have to say that it will increase the workload of miniSIPServer.