Hi,
I've recently run into an issue with SEMS and RTP/AVPF. When such a profile
is indicated in the SDP body of an incoming message, SEMS substitute it, in
the outgoing message, with the string <unknown media type>. This because
there is no RTP/AVPF support into AmSdp.cpp and AmSdp.h.
So, following the example of Juha Heinanen fix for the analogous case of
RTP/SAVPF (commit d8f4137cb217ea7e74d60f8d2f0cf65dbb367e5c),I propose the
attached patch.

Best regards,

Federico Cabiddu
diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp
index dd2ff5f..3420455 100644
--- a/core/AmSdp.cpp
+++ b/core/AmSdp.cpp
@@ -100,6 +100,7 @@ inline string transport_p_2_str(int tp)
 {
   switch(tp){
   case TP_RTPAVP: return "RTP/AVP";
+  case TP_RTPAVPF: return "RTP/AVPF";
   case TP_UDP: return "udp";
   case TP_RTPSAVP: return "RTP/SAVP";
   case TP_RTPSAVPF: return "RTP/SAVPF";
@@ -360,7 +361,7 @@ void AmSdp::print(string& body) const
 
       string options;
 
-      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) {
+      if (media_it->transport == TP_RTPAVP || media_it->transport == 
TP_RTPAVPF || media_it->transport == TP_RTPSAVP || media_it->transport == 
TP_RTPSAVPF || media_it->transport == TP_UDPTLSRTPSAVP || media_it->transport 
== TP_UDPTLSRTPSAVPF) {
        for(std::vector<SdpPayload>::const_iterator pl_it = 
media_it->payloads.begin();
            pl_it != media_it->payloads.end(); pl_it++) {
 
@@ -891,7 +892,7 @@ static void parse_sdp_media(AmSdp* sdp_msg, char* s)
       }
     case FMT:
       {
-       if (m.transport == TP_RTPAVP || m.transport == TP_RTPSAVP || 
m.transport == TP_RTPSAVPF || m.transport == TP_UDPTLSRTPSAVP || m.transport == 
TP_UDPTLSRTPSAVPF) {
+       if (m.transport == TP_RTPAVP || m.transport  == TP_RTPAVPF || 
m.transport == TP_RTPSAVP || m.transport == TP_RTPSAVPF || m.transport == 
TP_UDPTLSRTPSAVP || m.transport == TP_UDPTLSRTPSAVPF) {
          if (contains(media_line, line_end, ' ')) {
            next = parse_until(media_line, ' ');
            string value;
@@ -1467,6 +1468,8 @@ static TransProt transport_type(string transport)
 
   if(transport_uc == "RTP/AVP")
     return TP_RTPAVP;
+  else if(transport_uc == "RTP/AVPF")
+    return TP_RTPAVPF;
   else if(transport_uc == "UDP")
     return TP_UDP;
   else if(transport_uc == "RTP/SAVP")
diff --git a/core/AmSdp.h b/core/AmSdp.h
index 23302fc..1207f2c 100644
--- a/core/AmSdp.h
+++ b/core/AmSdp.h
@@ -55,7 +55,7 @@ enum AddressType { AT_NONE=0, AT_V4, AT_V6 };
 /** media type */
 enum MediaType { MT_NONE=0, MT_AUDIO, MT_VIDEO, MT_APPLICATION, MT_TEXT, 
MT_MESSAGE, MT_IMAGE };
 /** transport protocol */
-enum TransProt { TP_NONE=0, TP_RTPAVP, TP_UDP, TP_RTPSAVP, TP_UDPTL, 
TP_RTPSAVPF, TP_UDPTLSRTPSAVP, TP_UDPTLSRTPSAVPF };
+enum TransProt { TP_NONE=0, TP_RTPAVP, TP_RTPAVPF, TP_UDP, TP_RTPSAVP, 
TP_UDPTL, TP_RTPSAVPF, TP_UDPTLSRTPSAVP, TP_UDPTLSRTPSAVPF };
 
 /** \brief c=... line in SDP*/
 struct SdpConnection
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to