[Devel] [PATCH] has_sdp_body

Marc Haisenko haisenko at comdasys.com
Thu Mar 16 10:45:05 CET 2006


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
-- 
Marc Haisenko
Comdasys AG

Rüdesheimer Straße 7
D-80686 München
Tel:   +49 (0)89 - 548 43 33 0
Fax:   +49 (0)89 - 548 43 33 29
e-mail: haisenko at comdasys.com
http://www.comdasys.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openser-akira-has_sdp_body.patch
Type: text/x-diff
Size: 3975 bytes
Desc: not available
Url : http://openser.org/pipermail/devel/attachments/20060316/39cb493e/openser-akira-has_sdp_body-0001.bin


More information about the Devel mailing list