Changeset 207 for pjproject


Ignore:
Timestamp:
Feb 21, 2006 11:41:33 PM (19 years ago)
Author:
bennylp
Message:

Added has_local_answer(), and more relaxed negotiation

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

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

    r188 r207  
    533533 
    534534/** 
     535 * Call this function when the negotiator is in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO 
     536 * state to see if it was local who is answering the offer (instead of 
     537 * remote). 
     538 * 
     539 * @param neg           The negotiator. 
     540 * 
     541 * @return              PJ_TRUE if it is local is answering an offer, PJ_FALSE 
     542 *                      if remote has answered local offer. 
     543 */ 
     544PJ_DECL(pj_bool_t) pjmedia_sdp_neg_has_local_answer(pjmedia_sdp_neg *neg); 
     545 
     546 
     547/** 
    535548 * Negotiate local and remote answer. Before calling this function, the 
    536549 * SDP negotiator must be in PJMEDIA_SDP_NEG_STATE_WAIT_NEGO state. 
  • pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c

    r188 r207  
    329329    return PJ_SUCCESS; 
    330330} 
     331 
     332PJ_DEF(pj_bool_t) pjmedia_sdp_neg_has_local_answer(pjmedia_sdp_neg *neg) 
     333{ 
     334    pj_assert(neg && neg->state==PJMEDIA_SDP_NEG_STATE_WAIT_NEGO); 
     335    return !neg->has_remote_answer; 
     336} 
     337 
    331338 
    332339/* Swap string. */ 
     
    694701 
    695702    /* See if all types of offer can be matched. */ 
     703#if 0 
    696704    if ((offer_has_codec && !found_matching_codec) || 
    697705        (offer_has_telephone_event && !found_matching_telephone_event) || 
     
    701709        return PJ_FALSE; 
    702710    } 
     711#else 
     712    PJ_TODO(FULL_MATCHING_WITH_TELEPHONE_EVENTS); 
     713    if (!found_matching_codec && 
     714        !found_matching_telephone_event && 
     715        !found_matching_other) 
     716    { 
     717        /* Some of the payload in the offer has no matching local sdp */ 
     718        return PJ_FALSE; 
     719    } 
     720#endif 
    703721 
    704722    /* Seems like everything is in order. 
     
    839857 
    840858    return has_active ? PJ_SUCCESS : PJMEDIA_SDPNEG_ENOMEDIA; 
     859    //return PJ_SUCCESS; 
    841860} 
    842861 
Note: See TracChangeset for help on using the changeset viewer.