Module: kamailio
Branch: master
Commit: 3e2803602873f3151b568a3f1a0a998aa16634f2
URL:
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-29T09:56:41+02:00
sdpops: exported sdp_print() to kemi framework
---
Modified: src/modules/sdpops/sdpops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998…
Patch:
https://github.com/kamailio/kamailio/commit/3e2803602873f3151b568a3f1a0a998…
---
diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 3987f9ac0b..8b28a35ddb 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -1554,29 +1554,35 @@ static int w_sdp_with_codecs_by_name(sip_msg_t* msg, char* codecs,
char *bar)
/**
*
*/
-static int w_sdp_print(sip_msg_t* msg, char* level, char *bar)
+static int ki_sdp_print(sip_msg_t* msg, int llevel)
{
sdp_info_t *sdp = NULL;
- int llevel = L_DBG;
if(parse_sdp(msg) < 0) {
LM_ERR("Unable to parse sdp\n");
return -1;
}
- if(fixup_get_ivalue(msg, (gparam_p)level, &llevel)!=0)
- {
+ print_sdp(sdp, llevel);
+ return 1;
+}
+
+
+/**
+ *
+ */
+static int w_sdp_print(sip_msg_t* msg, char* level, char *bar)
+{
+ int llevel = L_DBG;
+
+ if(fixup_get_ivalue(msg, (gparam_p)level, &llevel)!=0) {
LM_ERR("unable to get the debug level value\n");
return -1;
}
- sdp = (sdp_info_t*)msg->body;
-
- print_sdp(sdp, llevel);
- return 1;
+ return ki_sdp_print(msg, llevel);
}
-
/**
*
*/
@@ -2022,6 +2028,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("sdp_print"),
+ SR_KEMIP_INT, ki_sdp_print,
+ { SR_KEMIP_INT, 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 } }
};