diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-05-23 07:12:23 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-05-23 07:12:23 +0000 |
commit | 56c7bd079294662092a6570b68781b0f562b0bb6 (patch) | |
tree | e08823ea1b5b1d412ef2c37c8363037f1660d35b /pjnath | |
parent | ff0ad1551351f97da64fcbc68e096d830995262c (diff) |
Fixed ticket #288: ICE role error on re-INVITE and ICE auth error when sending 487 (Role Conflict) response
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1291 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/src/pjnath/ice_session.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c index 246e4564..6e5d40f6 100644 --- a/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c @@ -444,9 +444,7 @@ static pj_status_t stun_auth_get_cred(const pj_stun_msg *msg, PJ_UNUSED_ARG(pool); realm->slen = nonce->slen = 0; - if (PJ_STUN_IS_SUCCESS_RESPONSE(msg->hdr.type) || - PJ_STUN_IS_ERROR_RESPONSE(msg->hdr.type)) - { + if (PJ_STUN_IS_RESPONSE(msg->hdr.type)) { /* Outgoing responses need to have the same credential as * incoming requests. */ @@ -1915,6 +1913,19 @@ static pj_status_t on_stun_rx_request(pj_stun_session *sess, pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_ICE_CONTROLLED, 0); } + /* Handle the case when request comes before answer is received. + * We need to put credential in the response, and since we haven't + * got the response, copy the username from the request. + */ + if (ice->rcand_cnt == 0) { + pj_stun_string_attr *uname_attr; + + uname_attr = (pj_stun_string_attr*) + pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_USERNAME, 0); + pj_assert(uname_attr != NULL); + pj_strdup(ice->pool, &ice->rx_uname, &uname_attr->value); + } + /* 7.2.1.1. Detecting and Repairing Role Conflicts */ if (ice->role == PJ_ICE_SESS_ROLE_CONTROLLING && @@ -1960,19 +1971,6 @@ static pj_status_t on_stun_rx_request(pj_stun_session *sess, } } - /* Handle the case when request comes before answer is received. - * We need to put credential in the response, and since we haven't - * got the response, copy the username from the request. - */ - if (ice->rcand_cnt == 0) { - pj_stun_string_attr *uname_attr; - - uname_attr = (pj_stun_string_attr*) - pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_USERNAME, 0); - pj_assert(uname_attr != NULL); - pj_strdup(ice->pool, &ice->rx_uname, &uname_attr->value); - } - /* * First send response to this request */ |