[sr-dev] heavy implementation of sdp_content()

Juha Heinanen jh at tutpro.com
Wed Sep 16 18:48:55 CEST 2015


i was studying implementation of sdpops/sdp_content() function and
noticed that it is heavy, because it parses the whole sdp:

static int w_sdp_content(sip_msg_t* msg, char* foo, char *bar)
{
	if(parse_sdp(msg)==0 && msg->body!=NULL)
		return 1;
	return -1;
}

sdp_with_ice(), for example, just searches a string from the body.

how about this:

- sdp_content() succeeds if content-type is application/sdp and
  content-length > 0.

- sdp_content() succeeds if content-type is multipart/mixed and body
  has line that includes string "application/sdp".

- otherwise sdp_content() fails.

-- juha



More information about the sr-dev mailing list