Search code examples
androidsipvoiprtp

When establishing a call using SIP, is it the caller or the callee who establishes the RTP stream?


The IETF documentation on SIP is quite dense, but I couldn't find anything related to the order of operations in establishing the RTP connection once the OKs and ACKs are out of the way.

Also, are the ports suppose to be open before the final SIP messages are sent, or after?

For reference, I'm using a Yealink phone as my calling device and am developing an Android app to receive these calls.

Sorry if this has been asked before, I couldn't find anything helpful though... I would greatly appreciate any help!


Solution

  • The RTP stream is usually sent using UDP packets. So no actual connection is made, the packets are just sent to the specified IP address and port.

    As soon as the User Agent Client has sent the INVITE request containing the SDP offer it must be prepared to receive RTP packets on the IP address and port in the SDP offer. See RFC3264.

    Once the offerer has sent the offer, it MUST be prepared to receive media for any recvonly streams described by that offer. It MUST be prepared to send and receive media for any sendrecv streams in the offer, and send media for any sendonly streams in the offer (of course, it cannot actually send until the peer provides an answer with the needed address and port information).