Hi Marc,
I applied the patch but on the textops module - it is more appropriate for its functionality. also I made a small change: checking the mime type is configurable - you can disable it or you can choose what mine to be checked against has_sdp_body() => has_body([mime])
See http://openser.org/docs/modules/1.1.x/textops.html#AEN440
thanks and regards, bogdan
Marc Haisenko wrote:
Hi folks, as follow-up to the discussion with force_rtp_proxy and SDP-less INVITES I now provide a patch to add a function "has_sdp_body()" which does what the name suggests: it returns true if the SIP message contains a body of type "application/sdp".
I've seen that in the development version force_rtp_proxy already has a "s" flag to switch lookup/register... I've also written a patch to do so and only just noticed you guys already fixed that :-) (unfortunately I can't use Sourceforge's CVS viewer for some reason so I only know there's a "s" flag from the docs)
The patch is against OpenSER 1.0.1
So together with the "s" flag and this method we now can correctly handle the INVITE/SDP + OK/SDP + ACK as well as the INVITE + OK/SDP + ACK/SDP cases:
route block:
if (method == INVITE) { if (has_sdp_body ()) { force_rtp_proxy (); } else { setflag (1); } } else if ((method == ACK) && (has_sdp_body ())) { force_rtp_proxy ("s"); }
onreply block:
if ((method == OK) && (has_sdp_body ()) { if (isflagset (1)) { force_rtp_proxy ("s"); } else { force_rtp_proxy (); } }
We tested this (with our own force_rtp_proxy "s" patch) and it seems work. C'ya, Marc