Module: kamailio Branch: master Commit: ff209e978e732def77285e8045d7f3d0a561fde9 URL: https://github.com/kamailio/kamailio/commit/ff209e978e732def77285e8045d7f3d0...
Author: Richard Fuchs rfuchs@sipwise.com Committer: GitHub noreply@github.com Date: 2018-02-28T09:55:18-05:00
Merge pull request #1460 from jerzyptak/rtpengine-add-dtls-transports
rtpengine: added support for DTLS transports
---
Modified: src/modules/rtpengine/doc/rtpengine_admin.xml Modified: src/modules/rtpengine/rtpengine.c
---
Diff: https://github.com/kamailio/kamailio/commit/ff209e978e732def77285e8045d7f3d0... Patch: https://github.com/kamailio/kamailio/commit/ff209e978e732def77285e8045d7f3d0...
---
diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml b/src/modules/rtpengine/doc/rtpengine_admin.xml index af0c147d50..141b7572e2 100644 --- a/src/modules/rtpengine/doc/rtpengine_admin.xml +++ b/src/modules/rtpengine/doc/rtpengine_admin.xml @@ -2207,7 +2207,7 @@ rtpengine_offer(); &sdp; substitutions (c=, m=, etc) are unaffected by this flag. </para></listitem> <listitem><para> - <emphasis>RTP, SRTP, AVP, AVPF</emphasis> - These flags control the &rtp; + <emphasis>RTP, SRTP, DTLS, AVP, AVPF</emphasis> - These flags control the &rtp; transport protocol that should be used towards the recipient of the &sdp;. If none of them are specified, the protocol given in the &sdp; is left untouched. Otherwise, the <quote>SRTP</quote> flag indicates that @@ -2217,8 +2217,8 @@ rtpengine_offer(); should be used. See also the next set of flags below. </para></listitem> <listitem><para> - <emphasis>RTP/AVP, RTP/SAVP, RTP/AVPF, RTP/SAVPF</emphasis> - these serve as - an alternative, more explicit way to select between the different &rtp; protocols + <emphasis>RTP/AVP, RTP/SAVP, UDP/TLS/RTP/SAVP, RTP/AVPF, RTP/SAVPF, UDP/TLS/RTP/SAVPF</emphasis> - these + serve as an alternative, more explicit way to select between the different &rtp; protocols and profiles supported by the &rtp; proxy. For example, giving the flag <quote>RTP/SAVPF</quote> has the same effect as giving the two flags <quote>SRTP AVPF</quote>. diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index 9fd827b987..927558f437 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -1888,6 +1888,8 @@ static const char *transports[] = { [0x01] = "RTP/SAVP", [0x02] = "RTP/AVPF", [0x03] = "RTP/SAVPF", + [0x04] = "UDP/TLS/RTP/SAVP", + [0x06] = "UDP/TLS/RTP/SAVPF", };
static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enum rtpe_operation *op, @@ -1963,6 +1965,8 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu ng_flags->transport |= 0x101; else if (str_eq(&key, "AVPF")) ng_flags->transport |= 0x102; + else if (str_eq(&key, "DTLS")) + ng_flags->transport |= 0x104; else goto generic; goto next; @@ -2065,6 +2069,23 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct sip_msg *msg, enu goto next; } break; + + case 16: + if (str_eq(&key, "UDP/TLS/RTP/SAVP")) + ng_flags->transport = 0x104; + else + goto generic; + goto next; + break; + + case 17: + if (str_eq(&key, "UDP/TLS/RTP/SAVPF")) + ng_flags->transport = 0x106; + else + goto generic; + goto next; + break; + }
generic: @@ -2165,7 +2186,7 @@ static bencode_item_t *rtpp_function_call(bencode_buffer_t *bencbuf, struct sip_ bencode_dictionary_add(ng_flags.dict, "replace", ng_flags.replace); if ((ng_flags.transport & 0x100)) bencode_dictionary_add_string(ng_flags.dict, "transport-protocol", - transports[ng_flags.transport & 0x003]); + transports[ng_flags.transport & 0x007]); if (ng_flags.rtcp_mux && ng_flags.rtcp_mux->child) bencode_dictionary_add(ng_flags.dict, "rtcp-mux", ng_flags.rtcp_mux);