Ignore:
Timestamp:
Mar 29, 2007 9:54:21 PM (17 years ago)
Author:
bennylp
Message:

Added ICE-CONTROLLING and ICE-CONTROLLED STUN attribute types

File:
1 edited

Legend:

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

    r1113 r1114  
    5757}; 
    5858 
     59static const char *role_names[] =  
     60{ 
     61    "Controlled", 
     62    "Controlling" 
     63}; 
     64 
    5965#define CHECK_NAME_LEN          128 
    6066#define LOG4(expr)              PJ_LOG(4,expr) 
     
    197203    ice->pool = pool; 
    198204    ice->role = role; 
     205    ice->tie_breaker.u32.hi = pj_rand(); 
     206    ice->tie_breaker.u32.lo = pj_rand(); 
    199207 
    200208    pj_ansi_snprintf(ice->obj_name, sizeof(ice->obj_name), 
     
    238246    LOG4((ice->obj_name,  
    239247         "ICE session created, comp_cnt=%d, role is %s agent", 
    240          comp_cnt, 
    241          (ice->role==PJ_ICE_SESS_ROLE_CONTROLLING ?  
    242             "controlling":"controlled"))); 
     248         comp_cnt, role_names[ice->role])); 
    243249 
    244250    return PJ_SUCCESS; 
     
    290296    PJ_ASSERT_RETURN(ice, PJ_EINVAL); 
    291297    destroy_ice(ice, PJ_SUCCESS); 
     298    return PJ_SUCCESS; 
     299} 
     300 
     301 
     302/* 
     303 * Change session role.  
     304 */ 
     305PJ_DEF(pj_status_t) pj_ice_sess_change_role(pj_ice_sess *ice, 
     306                                            pj_ice_sess_role new_role) 
     307{ 
     308    PJ_ASSERT_RETURN(ice, PJ_EINVAL); 
     309 
     310    if (new_role != ice->role) { 
     311        ice->role = new_role; 
     312        LOG4((ice->obj_name, "Role changed to %s", role_names[new_role])); 
     313    } 
     314 
    292315    return PJ_SUCCESS; 
    293316} 
Note: See TracChangeset for help on using the changeset viewer.