Ignore:
Timestamp:
Sep 25, 2006 1:40:12 PM (15 years ago)
Author:
bennylp
Message:

Tests with other user agents revealed some bugs which
have been fixed below:

  • some UAs sends "telephone-event/8000/1" instead of "telephone-event/8000", which caused SDP negotiation to fail. Fixed in sdp_neg.c.
  • codec name was (incorrectly) compared case-sensitively, causing negotiation to fail. Fixed in sdp_neg.c.
  • Also improved error reporting in SDP negotiation by introducing few more error codes.
  • Added Warning header in Not Acceptable response sent by pjsip_inv_session when SDP negotiation fails.
  • PJSUA-LIB will try to negotiate both SDPs before sending 100 response.
  • Fixed bug in iLBC codec when setting the mode to 30.

Also:

  • Echo cancellation by default is disabled now since it doesn't seem to work. Further investigation needed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c

    r734 r738  
    534534                         * count match  
    535535                         */ 
    536                         if (!pj_strcmp(&or.enc_name, &ar.enc_name) && 
     536                        if (!pj_stricmp(&or.enc_name, &ar.enc_name) && 
    537537                            or.clock_rate == ar.clock_rate && 
    538                             pj_strcmp(&or.param, &ar.param)==0) 
     538                            (pj_stricmp(&or.param, &ar.param)==0 || 
     539                             ar.param.slen==1 && *ar.param.ptr=='1')) 
    539540                        { 
    540541                            /* Match! */ 
     
    629630 
    630631/* Try to match offer with answer. */ 
    631 static pj_bool_t match_offer(pj_pool_t *pool, 
    632                              const pjmedia_sdp_media *offer, 
    633                              const pjmedia_sdp_media *local, 
    634                              pjmedia_sdp_media **p_answer) 
     632static pj_status_t match_offer(pj_pool_t *pool, 
     633                               const pjmedia_sdp_media *offer, 
     634                               const pjmedia_sdp_media *local, 
     635                               pjmedia_sdp_media **p_answer) 
    635636{ 
    636637    unsigned i; 
     
    698699                if (!a) { 
    699700                    pj_assert(!"Bug! Offer should have been validated"); 
    700                     return PJ_FALSE; 
     701                    return PJMEDIA_SDP_EMISSINGRTPMAP; 
    701702                } 
    702703                pjmedia_sdp_attr_get_rtpmap(a, &or); 
     
    727728                         * channel count  match  
    728729                         */ 
    729                         if (!pj_strcmp(&or.enc_name, &lr.enc_name) && 
     730                        if (!pj_stricmp(&or.enc_name, &lr.enc_name) && 
    730731                            or.clock_rate == lr.clock_rate && 
    731                             pj_strcmp(&or.param, &lr.param)==0)  
     732                            (pj_strcmp(&or.param, &lr.param)==0 || 
     733                             or.param.slen==1 && *or.param.ptr=='1'))  
    732734                        { 
    733735                            /* Match! */ 
     
    767769    /* See if all types of offer can be matched. */ 
    768770#if 1 
    769     if ((offer_has_codec && !found_matching_codec) || 
    770         (offer_has_telephone_event && !found_matching_telephone_event) || 
    771         (offer_has_other && !found_matching_other)) 
    772     { 
    773         /* Some of the payload in the offer has no matching local sdp */ 
    774         return PJ_FALSE; 
     771    if (offer_has_codec && !found_matching_codec) { 
     772        return PJMEDIA_SDPNEG_NOANSCODEC; 
     773    } 
     774 
     775    if (offer_has_telephone_event && !found_matching_telephone_event) { 
     776        return PJMEDIA_SDPNEG_NOANSTELEVENT; 
     777    } 
     778 
     779    if (offer_has_other && !found_matching_other) { 
     780        return PJMEDIA_SDPNEG_NOANSUNKNOWN; 
    775781    } 
    776782#else 
     
    828834 
    829835    *p_answer = answer; 
    830     return PJ_TRUE; 
     836    return PJ_SUCCESS; 
    831837} 
    832838 
     
    837843                                  pjmedia_sdp_session **p_answer) 
    838844{ 
    839     pj_status_t status; 
     845    pj_status_t status = PJMEDIA_SDPNEG_ENOMEDIA; 
    840846    pj_bool_t has_active = PJ_FALSE; 
    841847    pjmedia_sdp_session *answer; 
     
    880886            { 
    881887                /* See if it has matching codec. */ 
    882                 pj_bool_t match; 
    883  
    884                 match = match_offer(pool, om, im, &am); 
    885                 if (match) { 
     888                status = match_offer(pool, om, im, &am); 
     889                if (status == PJ_SUCCESS) { 
    886890                    /* Mark media as used. */ 
    887891                    media_used[j] = 1; 
     
    926930    *p_answer = answer; 
    927931 
    928     return has_active ? PJ_SUCCESS : PJMEDIA_SDPNEG_ENOMEDIA; 
    929     //return PJ_SUCCESS; 
     932    return has_active ? PJ_SUCCESS : status; 
    930933} 
    931934 
Note: See TracChangeset for help on using the changeset viewer.