Question about RTP initiation after SIP call establishment

I'm not sure if I understand what your question is, but I'll try to answer it.

RTP is usually started by whoever initiated the SDP. Generally the SDP is established from the INVITE (from the UAC, i.e., the device that initiated the request) and the 200OK (from the UAS, i.e., the device responding to the request).

You can flip it though. What I explained is an Early Offer (which most devices use these days). There's also a Late Offer where the UAC doesn't put the SDP inside the invite. In that case, the UAS sends the offer in the 200OK, and the UAC responds with their SDP inside the ACK.

The reason for this is, the first side to send SDP sends what it can support, and the response side chooses which codecs to use.

So for instance:

Early Offer: Side A sends the SDP inside the invite requesting G729 as first priority and G711 as second. Side B has G711 first and G729 second (even those side A prefers G729). Since Side B is the responder, they will use G711 (the responder decides over a conflict). In this case Side A requested the SDP, Side B answered the SDP, so Side A starts the RTP

Late Offer. Side A sends an Invite without SDP. Side B sends it's SDP over the 200OK requesting (just like before) G711 first, G729 second. Now Side A sends it's SDP over the ACK with G729 first and G711 second (just like before). This time it uses G729 since that's what the responder requested. In this case Side B requested the SDP, and Side A answered the SDP, so Side B starts the RTP.

The side requesting the SDP always sends it's RTP first because it's the first side that receives the full SIP dialog. The side answering the SDP doesn't really know that the other side received it's SDP response until it start receiving the RTP (talking about SIP over UDP, since UDP is connectionless, there's no SYN/ACK for the messages, even though SIP over TCP works the same way, that's really just a hold over from SIP over UDP. Realistically, that reasoning is irrelevant in SIP over TCP since the responder knows the sender received the SDP response because of SYN/ACK).

That all said, I feel like I'm not answering your question. Just to be clear, in your case, Side A would be client 1 (UAC), and Side B would be FreePBX (UAS). If client 1 is calling client 2, then on the client 2 side, the roles would be reversed. FreePBX would be Side A (the UAC) and client 2 would be Side B (the UAS).

UAC = User Agent Client i.e., the side making the request UAS = User Agent Server i.e., the side responding to the request

Any SIP device can be a UAC or UAS, it just matters if it originated the request, or responding to a request.

I hope this makes sense.

/r/VOIP Thread