Skip to content

Commit

Permalink
Backport msg_has_sdp from rtpproxy module
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information
lemenkov committed Dec 19, 2013
1 parent f07ff53 commit 114c973
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/rtpproxy-ng/rtpproxy.c
Expand Up @@ -471,6 +471,35 @@ struct module_exports exports = {
child_init
};

int msg_has_sdp(struct sip_msg *msg)
{
str body;
struct part *p;
struct multi_body *m;

if(parse_headers(msg, HDR_CONTENTLENGTH_F,0) < 0) {
LM_ERR("cannot parse cseq header");
return 0;
}

body.len = get_content_length(msg);
if (!body.len)
return 0;

m = get_all_bodies(msg);
if (!m) {
LM_DBG("cannot parse body\n");
return 0;
}

for (p = m->first; p; p = p->next) {
if (p->content_type == ((TYPE_APPLICATION << 16) + SUBTYPE_SDP))
return 1;
}

return 0;
}


static int rtpproxy_set_store(modparam_t type, void * val){

Expand Down

0 comments on commit 114c973

Please sign in to comment.