From 6f2858cbd3f464d8bd47d87fbe1788cc93ad3202 Mon Sep 17 00:00:00 2001 From: Miklos Tirpak Date: Thu, 22 May 2008 16:15:07 +0000 Subject: [PATCH] @msg.body.sdp select call is introduced, that returns the sdp part of the message body. --- select_core.c | 14 ++++++++++++++ select_core.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/select_core.c b/select_core.c index 731c87c75f..7774f7f124 100644 --- a/select_core.c +++ b/select_core.c @@ -57,6 +57,8 @@ #include "parser/parse_expires.h" #include "parser/parse_refer_to.h" #include "parser/parse_rpid.h" +#include "parser/parse_content.h" +#include "parser/parse_body.h" #include "dset.h" #include "sr_module.h" @@ -494,6 +496,18 @@ int select_msg_body(str* res, select_t* s, struct sip_msg* msg) return 0; } +int select_msg_body_sdp(str* res, select_t* sel, struct sip_msg* msg) +{ + /* try to get the body part with application/sdp */ + if ((res->s = get_body_part(msg, + TYPE_APPLICATION, SUBTYPE_SDP, + &res->len)) + ) + return 0; + else + return -1; +} + int select_msg_header(str* res, select_t* s, struct sip_msg* msg) { /* get all headers */ diff --git a/select_core.h b/select_core.h index d1365ed61a..05d302809e 100644 --- a/select_core.h +++ b/select_core.h @@ -129,6 +129,7 @@ SELECT_F(select_msg_len) SELECT_F(select_msg_id) SELECT_F(select_msg_id_hex) SELECT_F(select_msg_body) +SELECT_F(select_msg_body_sdp) SELECT_F(select_msg_header) SELECT_F(select_anyheader) SELECT_F(select_anyheader_params) @@ -316,6 +317,7 @@ static select_row_t select_core[] = { { select_anyheader_params, SEL_PARAM_STR, STR_STATIC_INIT("params"), select_any_params, CONSUME_NEXT_STR}, { select_msg, SEL_PARAM_STR, STR_STATIC_INIT("body"), select_msg_body, 0}, { select_msg, SEL_PARAM_STR, STR_STATIC_INIT("content"), select_msg_body, 0}, + { select_msg_body, SEL_PARAM_STR, STR_STATIC_INIT("sdp"), select_msg_body_sdp, 0}, { select_msg, SEL_PARAM_STR, STR_STATIC_INIT("request"), select_msg_request, 0}, { select_msg, SEL_PARAM_STR, STR_STATIC_INIT("req"), select_msg_request, 0}, { select_msg_request, SEL_PARAM_STR, STR_STATIC_INIT("method"), select_msg_request_method, 0}, -- 2.20.1