Why does the RTP payload shift by 80 bytes?

When RTP is relayed through Asterisk, the payload may shift by 80 bytes.
On the sender side, I set a marker value (e.g. aa) in the first byte of the payload.
If you look at the packet on the receiving side(with Wireshark), the marker appears at byte 81.

ex)

sender side:
aa ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff

receiving side:
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
aa ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff

Some calls are misaligned and some are not. For the calls that are misaligned, every packet is misaligned until the end of the call.
The percentage of misaligned calls is maybe about 50%.
Due to system requirements, I can’t use SRTP and am planning to use my own encryption, so I want to identify the cause of the discrepancy.
Does anyone know anything about where this discrepancy is occurring? I would be very grateful if you could tell me.

Asterisk Version:16.14.1
CODEC:G.711μ

I imagine that something like the following image is happening

Because Asterisk is a back to back user agent and doesn’t simply forward RTP (or signalling) as received. There was probably already a partial frame assembled on the outgoing side before the first incoming frame arrived, but, in general you cannot assume that alignment is retained, even for the same codec and packetisation.

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