On 12/11/15 15:08, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:

I think still having the ability to parse is good, because it makes sure
that the sdp is valid and it is quite common that later it will be
parsed anyhow (e.g., for rtp proxying).
based on my reading of rtpengine_offer/answer, they do not parse the
body and that is the whole point of this exercise.

-- juha

ps. while reading rtpengine_offer/answer code, i found this:

	if (!msg->content_type)
	{
		LM_WARN("the header Content-TYPE is absent!"
			"let's assume the content is text/plain ;-)\n");
		return 1;
	}

my impression is that if content-type header is missing, the default is
application/sdp.
Haven't looked at rtpengine module, but rtpproxy module is using the sdp parser and that is still very common out there (including the default kamailio.cfg). I still see the need of a way to assert that sdp body is correct and I use it to be sure the entire invite is correct, along with checks from sanity module.

Also, there is another function that checks the type of the body:

has_body("application/sdp")

Not sure if that works for multi-part body.

Cheers,
Daniel
-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat