Module: kamailio
Branch: master
Commit: 8f4c8583e5087f0e4c9c8e179d13e41c34b9eda5
URL:
https://github.com/kamailio/kamailio/commit/8f4c8583e5087f0e4c9c8e179d13e41…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-05-15T08:33:19+02:00
sdpops: sdp_get() and sdp_transport() exported to kemi
---
Modified: src/modules/sdpops/sdpops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8f4c8583e5087f0e4c9c8e179d13e41…
Patch:
https://github.com/kamailio/kamailio/commit/8f4c8583e5087f0e4c9c8e179d13e41…
---
diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 6cc511d..03c3a35 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -51,13 +51,13 @@ static int w_sdp_with_media(sip_msg_t* msg, char* media, char *bar);
static int w_sdp_with_active_media(sip_msg_t* msg, char* media, char *bar);
static int w_sdp_with_transport(sip_msg_t* msg, char* transport, char *bar);
static int w_sdp_with_transport_like(sip_msg_t* msg, char* transport, char *bar);
-static int w_sdp_transport(sip_msg_t* msg, char *bar);
+static int w_sdp_transport(sip_msg_t* msg, char *avp, char *p2);
static int w_sdp_with_codecs_by_id(sip_msg_t* msg, char* codec, char *bar);
static int w_sdp_with_codecs_by_name(sip_msg_t* msg, char* codec, char *bar);
static int w_sdp_remove_media(sip_msg_t* msg, char* media, char *bar);
static int w_sdp_remove_transport(sip_msg_t* msg, char* transport, char *bar);
static int w_sdp_print(sip_msg_t* msg, char* level, char *bar);
-static int w_sdp_get(sip_msg_t* msg, char *bar);
+static int w_sdp_get(sip_msg_t* msg, char *avp, char *p2);
static int w_sdp_content(sip_msg_t* msg, char* foo, char *bar);
static int w_sdp_content_sloppy(sip_msg_t* msg, char* foo, char *bar);
static int w_sdp_with_ice(sip_msg_t* msg, char* foo, char *bar);
@@ -1165,7 +1165,7 @@ static int sdp_with_transport(sip_msg_t *msg, str *transport, int
like)
* @brief assigns common media transport (if any) of 'm' lines to pv argument
* @return -1 - error; 0 - not found; 1 - found
*/
-static int w_sdp_transport(sip_msg_t* msg, char *avp)
+static int sdp_transport_helper(sip_msg_t* msg, char *avp)
{
int_str avp_val;
int_str avp_name;
@@ -1240,6 +1240,15 @@ static int w_sdp_transport(sip_msg_t* msg, char *avp)
return 1;
}
+static int w_sdp_transport(sip_msg_t* msg, char *avp, char *p2)
+{
+ return sdp_transport_helper(msg, avp);
+}
+
+static int ki_sdp_transport(sip_msg_t* msg, str *avp)
+{
+ return sdp_transport_helper(msg, avp->s);
+}
/**
*
@@ -1571,7 +1580,7 @@ static int w_sdp_print(sip_msg_t* msg, char* level, char *bar)
/**
*
*/
-static int w_sdp_get(sip_msg_t* msg, char *avp)
+static int sdp_get_helper(sip_msg_t* msg, char *avp)
{
sdp_info_t *sdp = NULL;
int_str avp_val;
@@ -1627,6 +1636,19 @@ static int w_sdp_get(sip_msg_t* msg, char *avp)
/**
*
*/
+static int w_sdp_get(sip_msg_t* msg, char *avp, char *p2)
+{
+ return sdp_get_helper(msg, avp);
+}
+
+static int ki_sdp_get(sip_msg_t* msg, str *avp)
+{
+ return sdp_get_helper(msg, avp->s);
+}
+
+/**
+ *
+ */
static int w_sdp_content(sip_msg_t* msg, char* foo, char *bar)
{
if(parse_sdp(msg)==0 && msg->body!=NULL)
@@ -1960,6 +1982,11 @@ static sr_kemi_t sr_kemi_sdpops_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("sdpops"), str_init("remove_line_by_prefix"),
+ SR_KEMIP_INT, sdp_remove_line_by_prefix,
+ { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ str_init("sdpops"), str_init("remove_media"),
SR_KEMIP_INT, sdp_remove_media,
{ SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
@@ -1975,6 +2002,21 @@ static sr_kemi_t sr_kemi_sdpops_exports[] = {
{ SR_KEMIP_INT, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+ { str_init("sdpops"), str_init("sdp_with_ice"),
+ SR_KEMIP_INT, sdp_with_ice,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sdpops"), str_init("sdp_get"),
+ SR_KEMIP_INT, ki_sdp_get,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
+ { str_init("sdpops"), str_init("sdp_transport"),
+ SR_KEMIP_INT, ki_sdp_transport,
+ { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};