Index: pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5755)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_sdes.c	(revision 5820)
@@ -274,4 +274,5 @@
 {
     struct transport_srtp *srtp = (struct transport_srtp*)tp->user_data;
+    pj_uint32_t rem_proto = 0;
 
     PJ_UNUSED_ARG(options);
@@ -281,6 +282,10 @@
     if (!srtp->offerer_side) {
 	pjmedia_sdp_media *m = sdp_remote->media[media_index];
-	if (pj_stricmp(&m->desc.transport, &ID_RTP_AVP)  != 0 &&
-	    pj_stricmp(&m->desc.transport, &ID_RTP_SAVP) != 0)
+
+	/* Get transport protocol and drop any RTCP-FB flag */
+	rem_proto = pjmedia_sdp_transport_get_proto(&m->desc.transport);
+	PJMEDIA_TP_PROTO_TRIM_FLAG(rem_proto, PJMEDIA_TP_PROFILE_RTCP_FB);
+	if (rem_proto != PJMEDIA_TP_PROTO_RTP_AVP &&
+	    rem_proto != PJMEDIA_TP_PROTO_RTP_SAVP)
 	{
 	    return PJMEDIA_SRTP_ESDPINTRANSPORT;
@@ -292,10 +297,8 @@
 	/* As offerer: do nothing. */
     } else {
-	pjmedia_sdp_media *m_rem = sdp_remote->media[media_index];
-
 	/* Validate remote media transport based on SRTP usage option. */
 	switch (srtp->setting.use) {
 	    case PJMEDIA_SRTP_DISABLED:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
+		if (rem_proto == PJMEDIA_TP_PROTO_RTP_SAVP)
 		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
 		break;
@@ -303,5 +306,5 @@
 		break;
 	    case PJMEDIA_SRTP_MANDATORY:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
+		if (rem_proto != PJMEDIA_TP_PROTO_RTP_SAVP)
 		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
 		break;
@@ -334,6 +337,11 @@
     {
 	pjmedia_sdp_media *m = sdp_remote? m_rem : m_loc;
-	if (pj_stricmp(&m->desc.transport, &ID_RTP_AVP)  != 0 &&
-	    pj_stricmp(&m->desc.transport, &ID_RTP_SAVP) != 0)
+	pj_uint32_t proto = 0;
+
+	/* Get transport protocol and drop any RTCP-FB flag */
+	proto = pjmedia_sdp_transport_get_proto(&m->desc.transport);
+	PJMEDIA_TP_PROTO_TRIM_FLAG(proto, PJMEDIA_TP_PROFILE_RTCP_FB);
+	if (proto != PJMEDIA_TP_PROTO_RTP_AVP &&
+	    proto != PJMEDIA_TP_PROTO_RTP_SAVP)
 	{
 	    return PJMEDIA_SRTP_ESDPINTRANSPORT;
@@ -409,6 +417,11 @@
     } else {
 	/* Answerer side */
+	pj_uint32_t rem_proto = 0;
 
 	pj_assert(sdp_remote && m_rem);
+
+	/* Get transport protocol and drop any RTCP-FB flag */
+	rem_proto = pjmedia_sdp_transport_get_proto(&m_rem->desc.transport);
+	PJMEDIA_TP_PROTO_TRIM_FLAG(rem_proto, PJMEDIA_TP_PROFILE_RTCP_FB);
 
 	/* Generate transport */
@@ -416,5 +429,5 @@
 	    case PJMEDIA_SRTP_DISABLED:
 		/* Should never reach here */
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
+		if (rem_proto == PJMEDIA_TP_PROTO_RTP_SAVP)
 		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
 		return PJ_SUCCESS;
@@ -422,5 +435,5 @@
 		break;
 	    case PJMEDIA_SRTP_MANDATORY:
-		if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
+		if (rem_proto != PJMEDIA_TP_PROTO_RTP_SAVP)
 		    return PJMEDIA_SRTP_ESDPINTRANSPORT;
 		break;
@@ -496,5 +509,5 @@
 		     */
 		    if ((!has_crypto_attr || matched_idx == -1) &&
-			pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP) == 0)
+			rem_proto == PJMEDIA_TP_PROTO_RTP_AVP)
 		    {
 			return PJ_SUCCESS;
@@ -610,14 +623,22 @@
 
     /* Verify media transport, it has to be RTP/AVP or RTP/SAVP */
-    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP)  != 0 &&
-	pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) != 0)
     {
-	return PJMEDIA_SRTP_ESDPINTRANSPORT;
-    }
-
-    if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP) == 0)
-	srtp->peer_use = PJMEDIA_SRTP_MANDATORY;
-    else
-	srtp->peer_use = PJMEDIA_SRTP_OPTIONAL;
+	pj_uint32_t rem_proto;
+
+	/* Get transport protocol and drop any RTCP-FB flag */
+	rem_proto = pjmedia_sdp_transport_get_proto(&m_rem->desc.transport);
+	PJMEDIA_TP_PROTO_TRIM_FLAG(rem_proto, PJMEDIA_TP_PROFILE_RTCP_FB);
+	if (rem_proto != PJMEDIA_TP_PROTO_RTP_AVP &&
+	    rem_proto != PJMEDIA_TP_PROTO_RTP_SAVP)
+	{
+	    return PJMEDIA_SRTP_ESDPINTRANSPORT;
+	}
+
+	/* Also check if peer signal SRTP as mandatory */
+	if (rem_proto == PJMEDIA_TP_PROTO_RTP_SAVP)
+	    srtp->peer_use = PJMEDIA_SRTP_MANDATORY;
+	else
+	    srtp->peer_use = PJMEDIA_SRTP_OPTIONAL;
+    }
 
     /* For answerer side, this function will just have to start SRTP as
@@ -647,5 +668,5 @@
 	fill_local_crypto(srtp->pool, m_loc, loc_crypto, &loc_cryto_cnt);
     } else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) {
-	if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP)) {
+	if (srtp->peer_use != PJMEDIA_SRTP_MANDATORY) {
 	    DEACTIVATE_MEDIA(pool, m_loc);
 	    return PJMEDIA_SDP_EINPROTO;
