Hi Jean,
Can you further explain your question, the steps you mentioend are already handled by kamailio's module rtpproxy. Now, you mentioned change the SDP in kamailio before rtpproxy function is called....I wonder how the device would feel about it.
For example UA sent and INVITE/SDP saying I'm listening on port 54321 ; you modify it to 12345 in kamailio and then call manage_rtpproxy() function. After 200OK RTPproxy will try to send RTPs to 12345 port but nothing may be possibly there ?!
Kindly explain the whole scenario.
BR,
Sammy