Although pjsip does not support application-specific RTCP packets directly, there is a way to capture all received RTCP packets and act upon those that are application-specific.
The first step is to create a Media Transport Adapter which sits between the stream and the network transport (UDP). You can create and attach one of these in the on_create_media_transport
callback.
Next, in your implementation of the attach
callback, call pjmedia_transport_attach()
passing your own callback functions for RTP and RTCP receiving, saving the original callbacks requested in the callback arguments. Exact details can be found in the transport_adapter_sample.c
(see function transport_attach
).
Finally, your implementation of the RTCP callback (transport_rtcp_cb
in transport_adapter_sample.c
) can do whatever it wants with the received RTCP packet before passing it on to the original callback.