- Timestamp:
- Mar 27, 2007 11:00:38 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/transport_ice.h
r1104 r1108 67 67 PJ_DECL(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp, 68 68 pj_pool_t *pool, 69 pjmedia_sdp_session *rem_sdp); 69 pjmedia_sdp_session *rem_sdp, 70 unsigned media_index); 70 71 PJ_DECL(pj_status_t) pjmedia_ice_stop_ice(pjmedia_transport *tp); 71 72 -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1106 r1108 401 401 PJ_DEF(pj_status_t) pjmedia_ice_start_ice(pjmedia_transport *tp, 402 402 pj_pool_t *pool, 403 pjmedia_sdp_session *rem_sdp) 403 pjmedia_sdp_session *rem_sdp, 404 unsigned media_index) 404 405 { 405 406 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 407 408 unsigned i, cand_cnt; 408 409 pj_ice_cand cand[PJ_ICE_MAX_CAND]; 410 pjmedia_sdp_media *sdp_med; 409 411 pj_str_t uname, pass; 410 412 pj_status_t status; 411 413 412 /* Find ice-ufrag attribute */ 414 PJ_ASSERT_RETURN(tp && pool && rem_sdp, PJ_EINVAL); 415 PJ_ASSERT_RETURN(media_index < rem_sdp->media_count, PJ_EINVAL); 416 417 sdp_med = rem_sdp->media[media_index]; 418 419 /* Find ice-ufrag attribute in session descriptor */ 413 420 attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr, 414 421 "ice-ufrag", NULL); 415 422 if (attr == NULL) { 416 set_no_ice(tp_ice); 417 return PJ_SUCCESS; 423 /* Find in media descriptor */ 424 attr = pjmedia_sdp_attr_find2(sdp_med->attr_count, sdp_med->attr, 425 "ice-ufrag", NULL); 426 if (attr == NULL) { 427 set_no_ice(tp_ice); 428 return PJ_SUCCESS; 429 } 418 430 } 419 431 uname = attr->value; 420 432 421 /* Find ice-pwd attribute */433 /* Find ice-pwd attribute in session descriptor */ 422 434 attr = pjmedia_sdp_attr_find2(rem_sdp->attr_count, rem_sdp->attr, 423 435 "ice-pwd", NULL); 424 436 if (attr == NULL) { 425 set_no_ice(tp_ice); 426 return PJ_SUCCESS; 437 /* Not found, find in media descriptor */ 438 attr = pjmedia_sdp_attr_find2(sdp_med->attr_count, sdp_med->attr, 439 "ice-pwd", NULL); 440 if (attr == NULL) { 441 set_no_ice(tp_ice); 442 return PJ_SUCCESS; 443 } 427 444 } 428 445 pass = attr->value; … … 430 447 /* Get all candidates */ 431 448 cand_cnt = 0; 432 for (i=0; i< rem_sdp->media[0]->attr_count; ++i) {449 for (i=0; i<sdp_med->attr_count; ++i) { 433 450 pjmedia_sdp_attr *attr; 434 451 435 attr = rem_sdp->media[0]->attr[i];452 attr = sdp_med->attr[i]; 436 453 if (pj_strcmp2(&attr->name, "candidate")!=0) 437 454 continue; -
pjproject/trunk/pjnath/src/pjnath-test/ice_test.c
r1106 r1108 460 460 pj_stun_config_init(&stun_cfg, mem, 0, ioqueue, timer_heap); 461 461 462 //pj_log_set_level(4); 462 #if 1 463 pj_log_set_level(5); 464 #endif 465 466 goto test; 463 467 464 468 /* Basic create/destroy */ … … 488 492 489 493 /* Direct communication with two components */ 494 test: 490 495 rc = perform_ice_test("With two components (RTP and RTCP)", PJ_TRUE, 2, PJ_TRUE, D1, D2, 0, NULL, 0, NULL); 491 496 if (rc != 0) 492 497 goto on_return; 498 499 goto on_return; 493 500 494 501 /* Direct communication with mismatch number of components */ … … 502 509 503 510 on_return: 504 //pj_log_set_level(3);511 pj_log_set_level(3); 505 512 pj_ioqueue_destroy(stun_cfg.ioqueue); 506 513 pj_pool_release(pool); -
pjproject/trunk/pjnath/src/pjnath-test/test.c
r1106 r1108 50 50 mem = &caching_pool.factory; 51 51 52 #if 0 52 53 pj_log_set_level(3); 53 54 pj_log_set_decor(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_TIME | 54 55 PJ_LOG_HAS_MICRO_SEC); 56 #endif 55 57 56 58 rc = pj_init(); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1106 r1108 823 823 if (pjsua_var.media_cfg.enable_ice) { 824 824 status = pjmedia_ice_start_ice(call->med_tp, call->inv->pool, 825 remote_sdp );825 remote_sdp, 0); 826 826 if (status != PJ_SUCCESS) 827 827 return status;
Note: See TracChangeset
for help on using the changeset viewer.