summaryrefslogtreecommitdiff
path: root/pjnath
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-06-26 10:10:24 +0000
committerBenny Prijono <bennylp@teluu.com>2007-06-26 10:10:24 +0000
commita28755aa6e146a74d305fb2ff2a7e20241fc13fc (patch)
treecf3ab946b6fa4eab0fc1fbdd7c698a64f52dc050 /pjnath
parent473fe50a16e1109196bfa4affa159e65a8598c08 (diff)
Ticket #344: ICE negotiation failed when remote doesn't support RTCP
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1392 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r--pjnath/src/pjnath/ice_session.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index c63e6cd4..8bce5a82 100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -1195,6 +1195,7 @@ pj_ice_sess_create_check_list(pj_ice_sess *ice,
pj_str_t username;
timer_data *td;
unsigned i, j;
+ unsigned highest_comp = 0;
pj_status_t status;
PJ_ASSERT_RETURN(ice && rem_ufrag && rem_passwd && rcand_cnt && rcand,
@@ -1232,6 +1233,9 @@ pj_ice_sess_create_check_list(pj_ice_sess *ice,
continue;
}
+ if (rcand[i].comp_id > highest_comp)
+ highest_comp = rcand[i].comp_id;
+
pj_memcpy(cn, &rcand[i], sizeof(pj_ice_sess_cand));
pj_strdup(ice->pool, &cn->foundation, &rcand[i].foundation);
ice->rcand_cnt++;
@@ -1282,6 +1286,11 @@ pj_ice_sess_create_check_list(pj_ice_sess *ice,
return status;
}
+ /* Disable our components which don't have matching component */
+ if (ice->comp_cnt==2 && highest_comp==1) {
+ ice->comp_cnt = 1;
+ }
+
/* Init timer entry in the checklist. Initially the timer ID is FALSE
* because timer is not running.
*/
@@ -2254,8 +2263,15 @@ PJ_DEF(pj_status_t) pj_ice_sess_send_data(pj_ice_sess *ice,
pj_status_t status = PJ_SUCCESS;
pj_ice_sess_comp *comp;
- PJ_ASSERT_RETURN(ice && comp_id && comp_id <= ice->comp_cnt, PJ_EINVAL);
+ PJ_ASSERT_RETURN(ice && comp_id, PJ_EINVAL);
+ /* It is possible that comp_cnt is less than comp_id, when remote
+ * doesn't support all the components that we have.
+ */
+ if (comp_id > ice->comp_cnt) {
+ return PJNATH_EICEINCOMPID;
+ }
+
pj_mutex_lock(ice->mutex);
comp = find_comp(ice, comp_id);