Ticket #467: ticket467.patch

File ticket467.patch, 2.5 KB (added by nanang, 16 years ago)
  • pjmedia/src/pjmedia/transport_srtp.c

     
    11711171            } 
    11721172            goto BYPASS_SRTP; 
    11731173        } else if (srtp->setting.use == PJMEDIA_SRTP_OPTIONAL) { 
    1174             if (pj_stricmp(&m_rem->desc.transport, &m_loc->desc.transport)) { 
    1175                 DEACTIVATE_MEDIA(pool, m_loc); 
    1176                 return PJMEDIA_SDP_EINPROTO; 
    1177             } 
     1174            // Regardless the answer's transport type (RTP/AVP or RTP/SAVP), 
     1175            // the answer must be processed through in optional mode. 
     1176            // Please note that at this point transport type is ensured to be  
     1177            // RTP/AVP or RTP/SAVP, see transport_media_create() 
     1178            //if (pj_stricmp(&m_rem->desc.transport, &m_loc->desc.transport)) { 
     1179                //DEACTIVATE_MEDIA(pool, m_loc); 
     1180                //return PJMEDIA_SDP_EINPROTO; 
     1181            //} 
    11781182        } else if (srtp->setting.use == PJMEDIA_SRTP_MANDATORY) { 
    11791183            if (pj_stricmp(&m_rem->desc.transport, &ID_RTP_SAVP)) { 
    11801184                DEACTIVATE_MEDIA(pool, m_loc); 
  • pjmedia/src/pjmedia/sdp_neg.c

     
    478478        return PJMEDIA_SDPNEG_EINVANSMEDIA; 
    479479    } 
    480480 
     481#if !defined(PJMEDIA_HAS_SRTP) || (PJMEDIA_HAS_SRTP == 0) 
     482    /* When SRTP enabled, checking transport is handled by transprot SRTP */ 
    481483 
    482     /* Chec that transport in the answer match our offer. */ 
    483  
     484    /* Check that transport in the answer match our offer. */ 
    484485    if (pj_strcmp(&answer->desc.transport,  
    485486                  &offer->desc.transport)!=0)  
    486487    { 
     
    488489        return PJMEDIA_SDPNEG_EINVANSTP; 
    489490    } 
    490491 
     492#endif 
     493 
    491494    /* Check if remote has rejected our offer */ 
    492495     
    493496    if (answer->desc.port == 0) { 
  • pjmedia/src/pjmedia/session.c

     
    190190 
    191191    /* Transport protocol */ 
    192192 
     193#if !defined(PJMEDIA_HAS_SRTP) || (PJMEDIA_HAS_SRTP == 0) 
     194    /* When SRTP enabled, checking transport is handled by transprot SRTP */ 
     195 
    193196    /* Transport type must be equal */ 
    194197    if (pj_stricmp(&rem_m->desc.transport,  
    195198                   &local_m->desc.transport) != 0)  
     
    197200        si->type = PJMEDIA_TYPE_UNKNOWN; 
    198201        return PJMEDIA_SDPNEG_EINVANSTP; 
    199202    } 
     203#endif 
    200204 
    201205    if (pj_stricmp(&local_m->desc.transport, &ID_RTP_AVP) == 0) { 
    202206