Changeset 4367


Ignore:
Timestamp:
Feb 21, 2013 8:49:19 PM (12 years ago)
Author:
nanang
Message:

Close #1625: Introduced new API pjmedia_sdp_validate2() for allowing SDP media without c= line when port is zero, currently it is only applied in validating remote SDP.

Location:
pjproject/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/sdp.h

    r3945 r4367  
    687687 
    688688/** 
     689 * Perform semantic validation for the specified SDP session descriptor. 
     690 * This function perform validation beyond just syntactic verification, 
     691 * such as to verify the value of network type and address type, check 
     692 * the connection line, and verify that \a rtpmap attribute is present 
     693 * when dynamic payload type is used. 
     694 * 
     695 * @param sdp       The SDP session descriptor to validate. 
     696 * @param strict    Flag whether the check should be strict, i.e: allow 
     697 *                  media without connection line when port is zero. 
     698 * 
     699 * @return          PJ_SUCCESS on success. 
     700 */ 
     701PJ_DECL(pj_status_t) pjmedia_sdp_validate2(const pjmedia_sdp_session *sdp, 
     702                                           pj_bool_t strict); 
     703 
     704 
     705/** 
    689706 * Clone SDP session descriptor. 
    690707 * 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp.c

    r3945 r4367  
    14241424PJ_DEF(pj_status_t) pjmedia_sdp_validate(const pjmedia_sdp_session *sdp) 
    14251425{ 
     1426    return pjmedia_sdp_validate2(sdp, PJ_TRUE); 
     1427} 
     1428 
     1429 
     1430/* Validate SDP session descriptor. */ 
     1431PJ_DEF(pj_status_t) pjmedia_sdp_validate2(const pjmedia_sdp_session *sdp, 
     1432                                          pj_bool_t strict) 
     1433{ 
    14261434    unsigned i; 
    14271435    const pj_str_t STR_RTPMAP = { "rtpmap", 6 }; 
     
    14721480        if (m->conn == NULL) { 
    14731481            if (sdp->conn == NULL) 
    1474                 return PJMEDIA_SDP_EMISSINGCONN; 
     1482                if (strict || m->desc.port != 0) 
     1483                    return PJMEDIA_SDP_EMISSINGCONN; 
    14751484        } 
    14761485 
     
    15061515} 
    15071516 
     1517 
    15081518PJ_DEF(pj_status_t) pjmedia_sdp_transport_cmp( const pj_str_t *t1, 
    15091519                                               const pj_str_t *t2) 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c

    r3980 r4367  
    139139 
    140140    /* Validate remote offer and initial answer */ 
    141     status = pjmedia_sdp_validate(remote); 
     141    status = pjmedia_sdp_validate2(remote, PJ_FALSE); 
    142142    if (status != PJ_SUCCESS) 
    143143        return status; 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r4351 r4367  
    830830                                   &sdp_info->sdp); 
    831831        if (status == PJ_SUCCESS) 
    832             status = pjmedia_sdp_validate(sdp_info->sdp); 
     832            status = pjmedia_sdp_validate2(sdp_info->sdp, PJ_FALSE); 
    833833 
    834834        if (status != PJ_SUCCESS) { 
Note: See TracChangeset for help on using the changeset viewer.