From 08640cc9411ca092e6456304bcce41f81b3bd3ce Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 29 May 2009 13:04:03 +0000 Subject: Integration of Sipit24 branch, many tickets involved: - #793: AMR encoder should regard 'mode-set' param specified by remote decoder. - #831: Automatically switch to TCP transport when sending large request - #832: Support for outbound proxy setting without using Route header - #849: Modify conference audio switch behavior in connecting ports. - #850: Remove 'Require=replaces' param in 'Refer-To' header (in call transfer with replaces). - #851: Support for regular nomination in ICE - #852: --ip-addr support for IPv6 for media transport in pjsua - #854: Adding SOFTWARE attribute in all outgoing requests may cause compatibility problem with older STUN server (thanks Alexei Kuznetsov for the report) - #855: Bug in digit map frequencies for DTMF digits (thanks FCCH for the report) - #856: Put back the ICE candidate priority values according to the default values in the draft-mmusic-ice - #857: Support for ICE keep-alive with Binding indication - #858: Do not authenticate STUN 438 response - #859: AMR-WB format param in the SDP is not negotiated correctly. - #867: Return error instead of asserting when PJSUA-LIB fails to open log file git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2724 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip-apps/src/pjsua/pjsua_app.c | 89 ++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 16 deletions(-) (limited to 'pjsip-apps/src/pjsua') diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c index dd81f9e9..8be930f7 100644 --- a/pjsip-apps/src/pjsua/pjsua_app.c +++ b/pjsip-apps/src/pjsua/pjsua_app.c @@ -264,7 +264,8 @@ static void usage(void) puts (""); puts ("Media Transport Options:"); puts (" --use-ice Enable ICE (default:no)"); - puts (" --ice-no-host Disable ICE host candidates (default: no)"); + puts (" --ice-regular Use ICE regular nomination (default: aggressive)"); + puts (" --ice-max-hosts=N Set maximum number of ICE host candidates"); puts (" --ice-no-rtcp Disable RTCP component in ICE (default: no)"); puts (" --rtp-port=N Base port to try for RTP (default=4000)"); puts (" --rx-drop-pct=PCT Drop PCT percent of RX RTP (for pkt lost sim, default: 0)"); @@ -476,8 +477,8 @@ static pj_status_t parse_args(int argc, char *argv[], OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, OPT_AUTO_ANSWER, OPT_AUTO_PLAY, OPT_AUTO_PLAY_HANGUP, OPT_AUTO_LOOP, OPT_AUTO_CONF, OPT_CLOCK_RATE, OPT_SND_CLOCK_RATE, OPT_STEREO, - OPT_USE_ICE, OPT_USE_SRTP, OPT_SRTP_SECURE, - OPT_USE_TURN, OPT_ICE_NO_HOST, OPT_ICE_NO_RTCP, OPT_TURN_SRV, + OPT_USE_ICE, OPT_ICE_REGULAR, OPT_USE_SRTP, OPT_SRTP_SECURE, + OPT_USE_TURN, OPT_ICE_MAX_HOSTS, OPT_ICE_NO_RTCP, OPT_TURN_SRV, OPT_TURN_TCP, OPT_TURN_USER, OPT_TURN_PASSWD, OPT_PLAY_FILE, OPT_PLAY_TONE, OPT_RTP_PORT, OPT_ADD_CODEC, OPT_ILBC_MODE, OPT_REC_FILE, OPT_AUTO_REC, @@ -553,8 +554,9 @@ static pj_status_t parse_args(int argc, char *argv[], { "rtp-port", 1, 0, OPT_RTP_PORT}, { "use-ice", 0, 0, OPT_USE_ICE}, + { "ice-regular",0, 0, OPT_ICE_REGULAR}, { "use-turn", 0, 0, OPT_USE_TURN}, - { "ice-no-host",0, 0, OPT_ICE_NO_HOST}, + { "ice-max-hosts",1, 0, OPT_ICE_MAX_HOSTS}, { "ice-no-rtcp",0, 0, OPT_ICE_NO_RTCP}, { "turn-srv", 1, 0, OPT_TURN_SRV}, { "turn-tcp", 0, 0, OPT_TURN_TCP}, @@ -992,12 +994,16 @@ static pj_status_t parse_args(int argc, char *argv[], cfg->media_cfg.enable_ice = PJ_TRUE; break; + case OPT_ICE_REGULAR: + cfg->media_cfg.ice_opt.aggressive = PJ_FALSE; + break; + case OPT_USE_TURN: cfg->media_cfg.enable_turn = PJ_TRUE; break; - case OPT_ICE_NO_HOST: - cfg->media_cfg.ice_no_host_cands = PJ_TRUE; + case OPT_ICE_MAX_HOSTS: + cfg->media_cfg.ice_max_host_cands = my_atoi(pj_optarg); break; case OPT_ICE_NO_RTCP: @@ -1644,11 +1650,17 @@ static int write_settings(const struct app_config *config, if (config->media_cfg.enable_ice) pj_strcat2(&cfg, "--use-ice\n"); + if (config->media_cfg.ice_opt.aggressive == PJ_FALSE) + pj_strcat2(&cfg, "--ice-regular\n"); + if (config->media_cfg.enable_turn) pj_strcat2(&cfg, "--use-turn\n"); - if (config->media_cfg.ice_no_host_cands) - pj_strcat2(&cfg, "--ice-no-host\n"); + if (config->media_cfg.ice_max_host_cands >= 0) { + pj_ansi_sprintf(line, "--ice_max_host_cands %d\n", + config->media_cfg.ice_max_host_cands); + pj_strcat2(&cfg, line); + } if (config->media_cfg.ice_no_rtcp) pj_strcat2(&cfg, "--ice-no-rtcp\n"); @@ -1885,7 +1897,7 @@ static int write_settings(const struct app_config *config, pj_strcat2(&cfg, "--use-compact-form\n"); } - if (config->cfg.force_lr) { + if (!config->cfg.force_lr) { pj_strcat2(&cfg, "--no-force-lr\n"); } @@ -3687,7 +3699,9 @@ void console_app_main(const pj_str_t *uri_to_call) pj_list_push_back(&msg_data.hdr_list, &refer_sub); } - pjsua_call_xfer_replaces(call, dst_call, 0, &msg_data); + pjsua_call_xfer_replaces(call, dst_call, + PJSUA_XFER_NO_REQUIRE_REPLACES, + &msg_data); } break; @@ -4718,19 +4732,62 @@ static pj_status_t create_ipv6_media_transports(void) for (i=0; i