Browse code

core: made sems aware of rfc5764 media types UDP/TLS/RTP/SAVP and UDP/TLS/RTP/SAVPF

Juha Heinanen authored on 20/11/2014 08:10:35
Showing 2 changed files
... ...
@@ -103,6 +103,8 @@ inline string transport_p_2_str(int tp)
103 103
   case TP_UDP: return "udp";
104 104
   case TP_RTPSAVP: return "RTP/SAVP";
105 105
   case TP_RTPSAVPF: return "RTP/SAVPF";
106
+  case TP_UDPTLSRTPSAVP: return "UDP/TLS/RTP/SAVP";
107
+  case TP_UDPTLSRTPSAVPF: return "UDP/TLS/RTP/SAVPF";
106 108
   case TP_UDPTL: return "udptl";
107 109
   default: return "<unknown media type>";
108 110
   }
... ...
@@ -358,7 +360,7 @@ void AmSdp::print(string& body) const
358 358
 
359 359
       string options;
360 360
 
361
-      if (media_it->transport == TP_RTPAVP || media_it->transport == TP_RTPSAVP || media_it->transport == TP_RTPSAVPF) {
361
+      if (media_it->transport == TP_RTPAVP || media_it->transport == TP_RTPSAVP || media_it->transport == TP_RTPSAVPF || media_it->transport == TP_UDPTLSRTPSAVP || media_it->transport == TP_UDPTLSRTPSAVPF) {
362 362
 	for(std::vector<SdpPayload>::const_iterator pl_it = media_it->payloads.begin();
363 363
 	    pl_it != media_it->payloads.end(); pl_it++) {
364 364
 
... ...
@@ -889,7 +891,7 @@ static void parse_sdp_media(AmSdp* sdp_msg, char* s)
889 889
       }
890 890
     case FMT:
891 891
       {
892
-	if (m.transport == TP_RTPAVP || m.transport == TP_RTPSAVP || m.transport == TP_RTPSAVPF) {
892
+	if (m.transport == TP_RTPAVP || m.transport == TP_RTPSAVP || m.transport == TP_RTPSAVPF || m.transport == TP_UDPTLSRTPSAVP || m.transport == TP_UDPTLSRTPSAVPF) {
893 893
 	  if (contains(media_line, line_end, ' ')) {
894 894
 	    next = parse_until(media_line, ' ');
895 895
 	    string value;
... ...
@@ -1471,6 +1473,10 @@ static TransProt transport_type(string transport)
1471 1471
     return TP_RTPSAVP;
1472 1472
   else if(transport_uc == "RTP/SAVPF")
1473 1473
     return TP_RTPSAVPF;
1474
+  else if(transport_uc == "UDP/TLS/RTP/SAVP")
1475
+    return TP_UDPTLSRTPSAVP;
1476
+  else if(transport_uc == "UDP/TLS/RTP/SAVPF")
1477
+    return TP_UDPTLSRTPSAVPF;
1474 1478
   else if(transport_uc == "UDPTL")
1475 1479
     return TP_UDPTL;
1476 1480
   else 
... ...
@@ -55,7 +55,7 @@ enum AddressType { AT_NONE=0, AT_V4, AT_V6 };
55 55
 /** media type */
56 56
 enum MediaType { MT_NONE=0, MT_AUDIO, MT_VIDEO, MT_APPLICATION, MT_TEXT, MT_MESSAGE, MT_IMAGE };
57 57
 /** transport protocol */
58
-enum TransProt { TP_NONE=0, TP_RTPAVP, TP_UDP, TP_RTPSAVP, TP_UDPTL, TP_RTPSAVPF };
58
+enum TransProt { TP_NONE=0, TP_RTPAVP, TP_UDP, TP_RTPSAVP, TP_UDPTL, TP_RTPSAVPF, TP_UDPTLSRTPSAVP, TP_UDPTLSRTPSAVPF };
59 59
 
60 60
 /** \brief c=... line in SDP*/
61 61
 struct SdpConnection