Packet loss when channels get bridged

Hello, everyone.
Why do I often experience packet loss right at the moment two channels get bridged? Is it a timing issue? How can I correct this? I have been assured there should no network problems.

The machine is in the intranet, average ping is about 0.7 ms, but occasionally it may jump to 5-11 seconds. I have also noticed that one of the sources of ping surges is calls of agi php scripts. Can this be the source of problem?

It sounds like you have a lot going on – so this is probably a load issue. I’d suggest paring things back in your testing environment to the bare minimum of external AGI and PHP integration, or even cut that out altogether for a bit, and then see if you still get packet loss.

What is interesting that there is no loss until two channels get bridged. If someone just calls for self-service (check out account balance, for example, or manage services), everything is OK. It looks like there is some asynchronization between the channels within bridges. I tried to set jitter buffer on the outbound channel, but in this case I always get a pop at the beginning of bridged calls.

Continuing from the other thread…

Bridging is asynchronous as you say, and there may be a small period of time where media isn’t exchanged. It depends upon the precise scenario and what is going on.

Hello, everyone.

I experience random packet loss in bridged calls (seen with the pjsip show channelstats command). When a subscriber just listens to IVR menus, everything is OK.

When I analyze rtp packes in Wireshark, I see splashes of jitter on the outgoing channels. The ToS settings are the same. The differences I see is the flags and identification IP protocol parameters. In asterisk the DF (don’t fragment) parameter is set to 1, whereas the peer’s value is set to 0. And the identification param of the incoming channel is 0, whereas that of the outgoing channel is above zero.

Can these parameters cause packet loss or they have little influence on audio quality?

Neither will cause outbound jitter. The only thing that will cause that is likely to be resource overloads, e.g. congested eithernet, or scheduling delays for the CPU.

Both the parameters you mention relate to fragmenttion. RTP packets should not be long enough for fragmentation to be relevant.

Hello, everyone.
I try to set jitter buffer on an outnbound channel, but everything gets worse with it. I hear loss of audio at the start of talk. Also, I tried to set it on an inbound channel. How should it set it correctly?

If using the JITTERBUFFER dialplan function then it interacts with the audio from a channel, so you place it on the channel where you want to buffer the incoming audio. Since it’s a buffer it will introduce a bit of delay, and depending on network setup time it can still cause a bit of loss of audio at the start.

What problem are you trying to solve ultimately?

I have some random packet loss. I think there are random network delays. When I ping the router, there are occasional spikes. The average ping is 0,6 ms, but it may jump up to 40 ms, as if there is a short network problem. I changed the cable, network cards, but that did not help. The cable is only 5 meters long.
I also use the MixMonitor application and suspect that it may cause problems when it starts at the time channels get bridged (temporarily removed the “b” switch).

What actually happens to things in Asterisk as a result?

The result is packet loss. Loss happens when channels get bridged. Until bridging everything is fine. I suspect, the cause may be either network delays (such as ping delays) or excessive loads. Also there may be something within the dialplan, that produces this.

Have you isolated things? Used wireshark to see the traffic flowing and where it is getting dropped?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

I tried to analyze it in Wireshark. I looks like the inbound traffic is perfect, but the outbound traffic has jitter.

I tried to listen to RTP streams, and in some of them there were several calls mixed together (this caused huge jitter), although in recordings there were separate as needed.

I have watched this problem for a while and found out that major loss occurs on first seconds, as though there must be some time for two channels to set a connection and get synchronized. This results in some loss of voice data. I have changed the mix monitor setting (now it starts without the “b” switch from the beginning of dialing), and this has made sound better. Is there a way to completely eliminate this problem or it is considered insignificant?

What happens if you take out MixMonitor() completely ? Does a Wireshark analysis still show RTP problems in this case ?

In my case MixMonitor definitely contributes to the increase of packet loss, but not so much. I turned it off, but packet loss still occured (checked with pjsjp show channelstats command), though to a lesser degree. Wireshark does not show any packet loss, but it shows very high jitter, cause by incorrect timestamp.