Module: kamailio Branch: master Commit: c2f0b7b6e41e334c8e0695feae3b5e6d4e8a74dc URL: https://github.com/kamailio/kamailio/commit/c2f0b7b6e41e334c8e0695feae3b5e6d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2020-02-12T22:15:24+01:00
sdpops: exported sdp with transport variants to kemi
- GH #2194
---
Modified: src/modules/sdpops/sdpops_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/c2f0b7b6e41e334c8e0695feae3b5e6d... Patch: https://github.com/kamailio/kamailio/commit/c2f0b7b6e41e334c8e0695feae3b5e6d...
---
diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c index 1492ec0832..bebe01ba5c 100644 --- a/src/modules/sdpops/sdpops_mod.c +++ b/src/modules/sdpops/sdpops_mod.c @@ -1323,6 +1323,26 @@ static int w_sdp_with_transport_like(sip_msg_t* msg, char* transport, char *bar) return 1; }
+/** + * + */ +static int ki_sdp_with_transport(sip_msg_t* msg, str* transport) +{ + if(sdp_with_transport(msg, transport, 0)<=0) + return -1; + return 1; +} + +/** + * + */ +static int ki_sdp_with_transport_like(sip_msg_t* msg, str* transport) +{ + if(sdp_with_transport(msg, transport, 1)<=0) + return -1; + return 1; +} + /** * @brief remove streams matching the m=media port 'transport' * @return -1 - error; 0 - not found; >=1 - found @@ -2230,6 +2250,16 @@ static sr_kemi_t sr_kemi_sdpops_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("sdpops"), str_init("sdp_with_transport"), + SR_KEMIP_INT, ki_sdp_with_transport, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("sdpops"), str_init("sdp_with_transport_like"), + SR_KEMIP_INT, ki_sdp_with_transport_like, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { str_init("sdpops"), str_init("sdp_get_line_startswith"), SR_KEMIP_INT, ki_sdp_get_line_startswith, { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,