Ignore:
Timestamp:
Oct 14, 2009 1:13:18 PM (15 years ago)
Author:
bennylp
Message:

Ticket #881: send UPDATE or re-INVITE after ICE negotiation, if the default candidate has changed

  • done
  • added pj_ice_strans_state (to be used for informational purposes for now)
  • added pjmedia ICE transport specific info, and display it in call dump output
  • misc fixes (changed pjmedia_transport_info.spec_info_cnt from int to unsigned)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r2724 r2945  
    174174    pj_lock_t               *init_lock; /**< Initialization mutex.      */ 
    175175 
     176    pj_ice_strans_state      state;     /**< Session state.             */ 
    176177    pj_ice_sess             *ice;       /**< ICE session.               */ 
    177178    pj_time_val              start_time;/**< Time when ICE was started  */ 
     
    488489    ice_st->comp = (pj_ice_strans_comp**)  
    489490                   pj_pool_calloc(pool, comp_cnt, sizeof(pj_ice_strans_comp*)); 
     491 
     492    /* Move state to candidate gathering */ 
     493    ice_st->state = PJ_ICE_STRANS_STATE_INIT; 
    490494 
    491495    /* Acquire initialization mutex to prevent callback to be  
     
    562566} 
    563567 
     568/* Get ICE session state. */ 
     569PJ_DEF(pj_ice_strans_state) pj_ice_strans_get_state(pj_ice_strans *ice_st) 
     570{ 
     571    return ice_st->state; 
     572} 
     573 
     574/* State string */ 
     575PJ_DEF(const char*) pj_ice_strans_state_name(pj_ice_strans_state state) 
     576{ 
     577    const char *names[] = { 
     578        "Null", 
     579        "Candidate Gathering", 
     580        "Candidate Gathering Complete", 
     581        "Session Initialized", 
     582        "Negotiation In Progress", 
     583        "Negotiation Success", 
     584        "Negotiation Failed" 
     585    }; 
     586 
     587    PJ_ASSERT_RETURN(state <= PJ_ICE_STRANS_STATE_FAILED, "???"); 
     588    return names[state]; 
     589} 
     590 
    564591/* Notification about failure */ 
    565592static void sess_fail(pj_ice_strans *ice_st, pj_ice_strans_op op, 
     
    604631    /* All candidates have been gathered */ 
    605632    ice_st->cb_called = PJ_TRUE; 
     633    ice_st->state = PJ_ICE_STRANS_STATE_READY; 
    606634    if (ice_st->cb.on_ice_complete) 
    607635        (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_INIT,  
     
    783811    } 
    784812 
     813    /* ICE session is ready for negotiation */ 
     814    ice_st->state = PJ_ICE_STRANS_STATE_SESS_READY; 
     815 
    785816    return PJ_SUCCESS; 
    786817 
     
    9831014    } 
    9841015 
     1016    ice_st->state = PJ_ICE_STRANS_STATE_NEGO; 
    9851017    return status; 
    9861018} 
     
    10121044    } 
    10131045 
     1046    ice_st->state = PJ_ICE_STRANS_STATE_INIT; 
    10141047    return PJ_SUCCESS; 
    10151048} 
     
    11701203        } 
    11711204 
     1205        ice_st->state = (status==PJ_SUCCESS) ? PJ_ICE_STRANS_STATE_RUNNING : 
     1206                                               PJ_ICE_STRANS_STATE_FAILED; 
     1207 
    11721208        (*ice_st->cb.on_ice_complete)(ice_st, PJ_ICE_STRANS_OP_NEGOTIATION,  
    11731209                                      status); 
Note: See TracChangeset for help on using the changeset viewer.