Changeset 2724 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- May 29, 2009 1:04:03 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2650 r2724 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 } … … 3688 3700 } 3689 3701 3690 pjsua_call_xfer_replaces(call, dst_call, 0, &msg_data); 3702 pjsua_call_xfer_replaces(call, dst_call, 3703 PJSUA_XFER_NO_REQUIRE_REPLACES, 3704 &msg_data); 3691 3705 } 3692 3706 break; … … 4719 4733 for (i=0; i<app_config.cfg.max_calls; ++i) { 4720 4734 enum { MAX_RETRY = 10 }; 4735 pj_sock_t sock[2]; 4736 pjmedia_sock_info si; 4721 4737 unsigned j; 4722 4738 … … 4725 4741 4726 4742 for (j=0; j<MAX_RETRY; ++j) { 4727 status = pjmedia_transport_udp_create3(pjsua_get_pjmedia_endpt(), 4728 pj_AF_INET6(), 4729 NULL, 4730 &app_config.rtp_cfg.bound_addr, 4731 port, 4732 0, &tp[i].transport); 4733 4743 unsigned k; 4744 4745 for (k=0; k<2; ++k) { 4746 pj_sockaddr bound_addr; 4747 4748 status = pj_sock_socket(pj_AF_INET6(), pj_SOCK_DGRAM(), 0, &sock[k]); 4749 if (status != PJ_SUCCESS) 4750 break; 4751 4752 status = pj_sockaddr_init(pj_AF_INET6(), &bound_addr, 4753 &app_config.rtp_cfg.bound_addr, 4754 (unsigned short)(port+k)); 4755 if (status != PJ_SUCCESS) 4756 break; 4757 4758 status = pj_sock_bind(sock[k], &bound_addr, 4759 pj_sockaddr_get_len(&bound_addr)); 4760 if (status != PJ_SUCCESS) 4761 break; 4762 } 4763 if (status != PJ_SUCCESS) { 4764 if (k==1) 4765 pj_sock_close(sock[0]); 4766 4767 if (port != 0) 4768 port += 10; 4769 else 4770 break; 4771 4772 continue; 4773 } 4774 4775 pj_bzero(&si, sizeof(si)); 4776 si.rtp_sock = sock[0]; 4777 si.rtcp_sock = sock[1]; 4778 4779 pj_sockaddr_init(pj_AF_INET6(), &si.rtp_addr_name, 4780 &app_config.rtp_cfg.public_addr, 4781 (unsigned short)(port)); 4782 pj_sockaddr_init(pj_AF_INET6(), &si.rtcp_addr_name, 4783 &app_config.rtp_cfg.public_addr, 4784 (unsigned short)(port+1)); 4785 4786 status = pjmedia_transport_udp_attach(pjsua_get_pjmedia_endpt(), 4787 NULL, 4788 &si, 4789 0, 4790 &tp[i].transport); 4734 4791 if (port != 0) 4735 4792 port += 10;
Note: See TracChangeset
for help on using the changeset viewer.