summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-08-07 09:55:52 +0000
committerBenny Prijono <bennylp@teluu.com>2008-08-07 09:55:52 +0000
commitb2a88bf19bf545fbe4da1de0bb40f0e2469dcb46 (patch)
treec3b7bdf4b6e46e9efd876f97365f15d27d764995
parentf0bdf37277b4b7ab3ae03fbc4ddd452269196a1a (diff)
Ticket #586: Added ICE negotiations test to test the scenario when two agents have different number of components
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2196 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c15
-rw-r--r--pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_1_2.py12
-rw-r--r--pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_2_1.py12
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h7
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c2
5 files changed, 44 insertions, 4 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 175b4d7d..7552822e 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -249,7 +249,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");
+ puts (" --ice-no-host Disable ICE host candidates (default: no)");
+ 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)");
puts (" --tx-drop-pct=PCT Drop PCT percent of TX RTP (for pkt lost sim, default: 0)");
@@ -456,8 +457,8 @@ static pj_status_t parse_args(int argc, char *argv[],
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_TURN_SRV, OPT_TURN_TCP,
- OPT_TURN_USER, OPT_TURN_PASSWD,
+ OPT_USE_TURN, OPT_ICE_NO_HOST, 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,
OPT_COMPLEXITY, OPT_QUALITY, OPT_PTIME, OPT_NO_VAD,
@@ -529,6 +530,7 @@ static pj_status_t parse_args(int argc, char *argv[],
{ "use-ice", 0, 0, OPT_USE_ICE},
{ "use-turn", 0, 0, OPT_USE_TURN},
{ "ice-no-host",0, 0, OPT_ICE_NO_HOST},
+ { "ice-no-rtcp",0, 0, OPT_ICE_NO_RTCP},
{ "turn-srv", 1, 0, OPT_TURN_SRV},
{ "turn-tcp", 0, 0, OPT_TURN_TCP},
{ "turn-user", 1, 0, OPT_TURN_USER},
@@ -947,6 +949,10 @@ static pj_status_t parse_args(int argc, char *argv[],
cfg->media_cfg.ice_no_host_cands = PJ_TRUE;
break;
+ case OPT_ICE_NO_RTCP:
+ cfg->media_cfg.ice_no_rtcp = PJ_TRUE;
+ break;
+
case OPT_TURN_SRV:
cfg->media_cfg.turn_server = pj_str(pj_optarg);
break;
@@ -1555,6 +1561,9 @@ static int write_settings(const struct app_config *config,
if (config->media_cfg.ice_no_host_cands)
pj_strcat2(&cfg, "--ice-no-host\n");
+ if (config->media_cfg.ice_no_rtcp)
+ pj_strcat2(&cfg, "--ice-no-rtcp\n");
+
if (config->media_cfg.turn_server.slen) {
pj_ansi_sprintf(line, "--turn-srv %.*s\n",
(int)config->media_cfg.turn_server.slen,
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_1_2.py b/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_1_2.py
new file mode 100644
index 00000000..7580b204
--- /dev/null
+++ b/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_1_2.py
@@ -0,0 +1,12 @@
+# $Id$
+#
+from inc_cfg import *
+
+# Different number of ICE components
+test_param = TestParam(
+ "Callee=use ICE, caller=use ICE",
+ [
+ InstanceParam("callee", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp", enable_buffer=True),
+ InstanceParam("caller", "--null-audio --use-ice --max-calls=1", enable_buffer=True)
+ ]
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_2_1.py b/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_2_1.py
new file mode 100644
index 00000000..a0ddaf78
--- /dev/null
+++ b/pjsip-apps/src/test-pjsua/scripts-call/305_ice_comp_2_1.py
@@ -0,0 +1,12 @@
+# $Id$
+#
+from inc_cfg import *
+
+# Different number of ICE components
+test_param = TestParam(
+ "Callee=use ICE, caller=use ICE",
+ [
+ InstanceParam("callee", "--null-audio --use-ice --max-calls=1", enable_buffer=True),
+ InstanceParam("caller", "--null-audio --use-ice --max-calls=1 --ice-no-rtcp", enable_buffer=True)
+ ]
+ )
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 0d6322ea..4989ef07 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -4101,6 +4101,13 @@ struct pjsua_media_config
pj_bool_t ice_no_host_cands;
/**
+ * Disable RTCP component.
+ *
+ * Default: no
+ */
+ pj_bool_t ice_no_rtcp;
+
+ /**
* Enable TURN relay candidate in ICE.
*/
pj_bool_t enable_turn;
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 7bb2f2a4..13d3ab7d 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -758,7 +758,7 @@ static pj_status_t create_ice_media_transports(void)
pjsua_var.calls[i].med_tp_ready = PJ_EPENDING;
comp_cnt = 1;
- if (PJMEDIA_ADVERTISE_RTCP)
+ if (PJMEDIA_ADVERTISE_RTCP && !pjsua_var.media_cfg.ice_no_rtcp)
++comp_cnt;
status = pjmedia_ice_create(pjsua_var.med_endpt, name, comp_cnt,