On 20/01/2023 10.10, [EXT] Krzysztof Drewicz wrote:
I think that i need more in depth understanding how this works - i need to use rtpengine_ofer - before TLS w/ sRTP hits my kamailio script ? and then, rtpengine_manage towards the no-SRTP endpoint, and then - finally rtpengine_answer - ? So - 6 times - rtpengine_X ? (one for incoming leg, 2nd for - outgoing)
You just need one invocation each: one for the offer, one for the answer. (Assuming single offer/answer exchange and no branches.)
You can use rtpengine_manage() for either of them if you want to let the module figure out whether the message is an offer or an answer. But you will want to use different flags for the two cases, mostly depending on where the message is going to.
If the message is going to a plain RTP (non-SRTP, non-ICE, etc) client, use "RTP/AVP ICE=remove" etc. If the message is going to an SRTP, ICE-enabled client, use "RTP/SAVPF ICE=force" etc.
For the "direction=" flags you want to pay attention both to where the message is coming from (first "direction") and where it is going to (second "direction").
If you want to manually distinguish between offers and answers instead of using rtpengine_manage(), in general you only need to give these flags for the offer. In that case you can then leave the flags for the answer (mostly - there are some exceptions) blank.
Cheers