Changeset 1114 for pjproject/trunk/pjnath/src/pjnath/ice_session.c
- Timestamp:
- Mar 29, 2007 9:54:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_session.c
r1113 r1114 57 57 }; 58 58 59 static const char *role_names[] = 60 { 61 "Controlled", 62 "Controlling" 63 }; 64 59 65 #define CHECK_NAME_LEN 128 60 66 #define LOG4(expr) PJ_LOG(4,expr) … … 197 203 ice->pool = pool; 198 204 ice->role = role; 205 ice->tie_breaker.u32.hi = pj_rand(); 206 ice->tie_breaker.u32.lo = pj_rand(); 199 207 200 208 pj_ansi_snprintf(ice->obj_name, sizeof(ice->obj_name), … … 238 246 LOG4((ice->obj_name, 239 247 "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])); 243 249 244 250 return PJ_SUCCESS; … … 290 296 PJ_ASSERT_RETURN(ice, PJ_EINVAL); 291 297 destroy_ice(ice, PJ_SUCCESS); 298 return PJ_SUCCESS; 299 } 300 301 302 /* 303 * Change session role. 304 */ 305 PJ_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 292 315 return PJ_SUCCESS; 293 316 }
Note: See TracChangeset
for help on using the changeset viewer.