- Timestamp:
- May 18, 2009 5:49:37 AM (16 years ago)
- Location:
- pjproject/branches/projects/sipit24
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/sipit24/pjnath/include/pjnath/ice_strans.h
r2705 r2707 198 198 199 199 /** 200 * This contains various STUN session options. Once the ICE stream 201 * transport is created, application may also change the options 202 * with #pj_ice_strans_set_options(). 203 */ 204 pj_ice_sess_options opt; 205 206 /** 200 207 * STUN and local transport settings. This specifies the 201 208 * settings for local UDP socket, which will be resolved -
pjproject/branches/projects/sipit24/pjnath/src/pjnath/ice_session.c
r2705 r2707 438 438 PJ_ASSERT_RETURN(ice && opt, PJ_EINVAL); 439 439 pj_memcpy(&ice->opt, opt, sizeof(*opt)); 440 LOG5((ice->obj_name, "ICE nomination type set to %s", 441 (ice->opt.aggressive ? "aggressive" : "regular"))); 440 442 return PJ_SUCCESS; 441 443 } … … 1410 1412 * flag set. 1411 1413 */ 1412 LOG 5((ice->obj_name,1414 LOG4((ice->obj_name, 1413 1415 "All checks have completed, starting nominated checks now")); 1414 1416 start_nominated_check(ice); … … 1440 1442 } 1441 1443 1442 LOG 5((ice->obj_name,1444 LOG4((ice->obj_name, 1443 1445 "Scheduling nominated check in %d ms", 1444 1446 ice->opt.nominated_check_delay)); -
pjproject/branches/projects/sipit24/pjnath/src/pjnath/ice_strans.c
r2705 r2707 159 159 pj_ice_strans_cb cb; /**< Application callback. */ 160 160 pj_lock_t *init_lock; /**< Initialization mutex. */ 161 pj_ice_sess_options opt; /**< ICE session options */162 161 163 162 pj_ice_sess *ice; /**< ICE session. */ … … 198 197 pj_stun_sock_cfg_default(&cfg->stun.cfg); 199 198 pj_turn_alloc_param_default(&cfg->turn.alloc_param); 199 200 pj_ice_sess_options_default(&cfg->opt); 200 201 201 202 cfg->af = pj_AF_INET(); … … 449 450 ice_st->obj_name = pool->obj_name; 450 451 ice_st->user_data = user_data; 451 452 pj_ice_sess_options_default(&ice_st->opt);453 452 454 453 PJ_LOG(4,(ice_st->obj_name, … … 661 660 { 662 661 PJ_ASSERT_RETURN(ice_st && opt, PJ_EINVAL); 663 pj_memcpy(opt, &ice_st-> opt, sizeof(*opt));662 pj_memcpy(opt, &ice_st->cfg.opt, sizeof(*opt)); 664 663 return PJ_SUCCESS; 665 664 } … … 672 671 { 673 672 PJ_ASSERT_RETURN(ice_st && opt, PJ_EINVAL); 674 pj_memcpy(&ice_st-> opt, opt, sizeof(*opt));673 pj_memcpy(&ice_st->cfg.opt, opt, sizeof(*opt)); 675 674 if (ice_st->ice) 676 pj_ice_sess_set_options(ice_st->ice, &ice_st-> opt);675 pj_ice_sess_set_options(ice_st->ice, &ice_st->cfg.opt); 677 676 return PJ_SUCCESS; 678 677 } … … 715 714 716 715 /* Set options */ 717 pj_ice_sess_set_options(ice_st->ice, &ice_st-> opt);716 pj_ice_sess_set_options(ice_st->ice, &ice_st->cfg.opt); 718 717 719 718 /* If default candidate for components are SRFLX one, upload a custom -
pjproject/branches/projects/sipit24/pjsip-apps/src/pjsua/pjsua_app.c
r2706 r2707 265 265 puts ("Media Transport Options:"); 266 266 puts (" --use-ice Enable ICE (default:no)"); 267 puts (" --ice-no-host Disable ICE host candidates (default: no)"); 267 puts (" --ice-regular Use ICE regular nomination (default: aggressive)"); 268 puts (" --ice-max-hosts=N Set maximum number of ICE host candidates"); 268 269 puts (" --ice-no-rtcp Disable RTCP component in ICE (default: no)"); 269 270 puts (" --rtp-port=N Base port to try for RTP (default=4000)"); … … 477 478 OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, 478 479 OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, 479 OPT_USE_ICE, OPT_ USE_SRTP, OPT_SRTP_SECURE,480 OPT_USE_TURN, OPT_ICE_ NO_HOST, OPT_ICE_NO_RTCP, OPT_TURN_SRV,480 OPT_USE_ICE, OPT_ICE_REGULAR, OPT_USE_SRTP, OPT_SRTP_SECURE, 481 OPT_USE_TURN, OPT_ICE_MAX_HOSTS, OPT_ICE_NO_RTCP, OPT_TURN_SRV, 481 482 OPT_TURN_TCP, OPT_TURN_USER, OPT_TURN_PASSWD, 482 483 OPT_PLAY_FILE, OPT_PLAY_TONE, OPT_RTP_PORT, OPT_ADD_CODEC, … … 554 555 555 556 { "use-ice", 0, 0, OPT_USE_ICE}, 557 { "ice-regular",0, 0, OPT_ICE_REGULAR}, 556 558 { "use-turn", 0, 0, OPT_USE_TURN}, 557 { "ice- no-host",0, 0, OPT_ICE_NO_HOST},559 { "ice-max-hosts",1, 0, OPT_ICE_MAX_HOSTS}, 558 560 { "ice-no-rtcp",0, 0, OPT_ICE_NO_RTCP}, 559 561 { "turn-srv", 1, 0, OPT_TURN_SRV}, … … 993 995 break; 994 996 997 case OPT_ICE_REGULAR: 998 cfg->media_cfg.ice_opt.aggressive = PJ_FALSE; 999 break; 1000 995 1001 case OPT_USE_TURN: 996 1002 cfg->media_cfg.enable_turn = PJ_TRUE; 997 1003 break; 998 1004 999 case OPT_ICE_ NO_HOST:1000 cfg->media_cfg.ice_ no_host_cands = PJ_TRUE;1005 case OPT_ICE_MAX_HOSTS: 1006 cfg->media_cfg.ice_max_host_cands = my_atoi(pj_optarg); 1001 1007 break; 1002 1008 … … 1645 1651 pj_strcat2(&cfg, "--use-ice\n"); 1646 1652 1653 if (config->media_cfg.ice_opt.aggressive == PJ_FALSE) 1654 pj_strcat2(&cfg, "--ice-regular\n"); 1655 1647 1656 if (config->media_cfg.enable_turn) 1648 1657 pj_strcat2(&cfg, "--use-turn\n"); 1649 1658 1650 if (config->media_cfg.ice_no_host_cands) 1651 pj_strcat2(&cfg, "--ice-no-host\n"); 1659 if (config->media_cfg.ice_max_host_cands >= 0) { 1660 pj_ansi_sprintf(line, "--ice_max_host_cands %d\n", 1661 config->media_cfg.ice_max_host_cands); 1662 pj_strcat2(&cfg, line); 1663 } 1652 1664 1653 1665 if (config->media_cfg.ice_no_rtcp) … … 1886 1898 } 1887 1899 1888 if ( config->cfg.force_lr) {1900 if (!config->cfg.force_lr) { 1889 1901 pj_strcat2(&cfg, "--no-force-lr\n"); 1890 1902 } -
pjproject/branches/projects/sipit24/pjsip-apps/src/samples/debug.c
r2506 r2707 29 29 * #include "playfile.c" 30 30 */ 31 #include " auddemo.c"31 #include "icedemo.c" 32 32 -
pjproject/branches/projects/sipit24/pjsip-apps/src/samples/icedemo.c
r2705 r2707 312 312 icedemo.ice_cfg.stun.max_host_cands = icedemo.opt.max_host; 313 313 314 /* Nomination strategy */ 315 if (icedemo.opt.regular) 316 icedemo.ice_cfg.opt.aggressive = PJ_FALSE; 317 else 318 icedemo.ice_cfg.opt.aggressive = PJ_TRUE; 319 314 320 /* Configure STUN/srflx candidate resolution */ 315 321 if (icedemo.opt.stun_srv.slen) { … … 377 383 { 378 384 pj_ice_strans_cb icecb; 379 pj_ice_sess_options opt;380 385 pj_status_t status; 381 386 … … 402 407 else 403 408 PJ_LOG(3,(THIS_FILE, "ICE instance successfully created")); 404 405 status = pj_ice_strans_get_options(icedemo.icest, &opt);406 pj_assert(status == PJ_SUCCESS);407 408 if (icedemo.opt.regular)409 opt.aggressive = PJ_FALSE;410 else411 opt.aggressive = PJ_TRUE;412 413 status = pj_ice_strans_set_options(icedemo.icest, &opt);414 pj_assert(status == PJ_SUCCESS);415 409 } 416 410 -
pjproject/branches/projects/sipit24/pjsip/include/pjsua-lib/pjsua.h
r2686 r2707 4261 4261 4262 4262 /** 4263 * Disable ICE host candidates. 4264 */ 4265 pj_bool_t ice_no_host_cands; 4263 * Set the maximum number of host candidates. 4264 * 4265 * Default: -1 (maximum not set) 4266 */ 4267 int ice_max_host_cands; 4268 4269 /** 4270 * ICE session options. 4271 */ 4272 pj_ice_sess_options ice_opt; 4266 4273 4267 4274 /** -
pjproject/branches/projects/sipit24/pjsip/src/pjsua-lib/pjsua_core.c
r2686 r2707 182 182 cfg->jb_init = cfg->jb_min_pre = cfg->jb_max_pre = cfg->jb_max = -1; 183 183 cfg->snd_auto_close_time = 1; 184 185 cfg->ice_max_host_cands = -1; 186 pj_ice_sess_options_default(&cfg->ice_opt); 184 187 185 188 cfg->turn_conn_type = PJ_TURN_TP_UDP; -
pjproject/branches/projects/sipit24/pjsip/src/pjsua-lib/pjsua_media.c
r2705 r2707 811 811 ice_cfg.stun.port = pj_sockaddr_get_port(&pjsua_var.stun_srv); 812 812 } 813 if (pjsua_var.media_cfg.ice_ no_host_cands)814 ice_cfg.stun.max_host_cands = 0;813 if (pjsua_var.media_cfg.ice_max_host_cands >= 0) 814 ice_cfg.stun.max_host_cands = pjsua_var.media_cfg.ice_max_host_cands; 815 815 816 816 /* Configure TURN settings */
Note: See TracChangeset
for help on using the changeset viewer.