Fix issue 254
This commit is contained in:
parent
855117af4d
commit
ea4c1f1faa
|
@ -1226,7 +1226,7 @@ int tmedia_session_mgr_set_ro(tmedia_session_mgr_t* self, const tsdp_message_t*
|
|||
}
|
||||
|
||||
// hold/resume
|
||||
is_ro_hold_resume_changed |= !tsk_striequals(tsdp_header_M_get_holdresume_att(M0), tsdp_header_M_get_holdresume_att(M1));
|
||||
is_ro_hold_resume_changed |= (M1 && !tsk_striequals(tsdp_header_M_get_holdresume_att(M0), tsdp_header_M_get_holdresume_att(M1)));
|
||||
|
||||
// media lines
|
||||
if(!is_ro_media_lines_changed){
|
||||
|
|
|
@ -645,7 +645,7 @@ int tnet_ice_ctx_recv_stun_message(tnet_ice_ctx_t* self, const void* data, tsk_s
|
|||
{
|
||||
tnet_stun_message_t* message;
|
||||
int ret = 0;
|
||||
const tnet_ice_pair_t* pair;
|
||||
const tnet_ice_pair_t* pair = tsk_null;
|
||||
if(!self || !role_conflict || !data || !size || local_fd < 0 || !remote_addr){
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
|
@ -662,14 +662,17 @@ int tnet_ice_ctx_recv_stun_message(tnet_ice_ctx_t* self, const void* data, tsk_s
|
|||
}
|
||||
|
||||
if(!self->is_active){
|
||||
TSK_DEBUG_INFO("ICE context not active");
|
||||
TSK_DEBUG_INFO("ICE context not active yet");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((message = tnet_stun_message_deserialize(data, size))){
|
||||
if(message->type == stun_binding_request){
|
||||
pair = tnet_ice_pairs_find_by_fd_and_addr(self->candidates_pairs, local_fd, remote_addr);
|
||||
if(!pair && !self->have_nominated_symetric){ // pair not found and we're still negotiating
|
||||
tsk_bool_t is_local_conncheck_started = !TSK_LIST_IS_EMPTY(self->candidates_pairs); // if empty means local conncheck haven't started
|
||||
if(is_local_conncheck_started) {
|
||||
pair = tnet_ice_pairs_find_by_fd_and_addr(self->candidates_pairs, local_fd, remote_addr);
|
||||
}
|
||||
if(!pair && !self->have_nominated_symetric && is_local_conncheck_started){ // pair not found and we're still negotiating
|
||||
// rfc 5245 - 7.1.3.2.1. Discovering Peer Reflexive Candidates
|
||||
tnet_ice_pair_t* pair_peer = tnet_ice_pair_prflx_create(self->candidates_pairs, local_fd, remote_addr);
|
||||
if(pair_peer){
|
||||
|
@ -724,8 +727,13 @@ int tnet_ice_ctx_recv_stun_message(tnet_ice_ctx_t* self, const void* data, tsk_s
|
|||
}
|
||||
TSK_FREE(resp_phrase);
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_ERROR("Cannot find ICE pair with local fd = %d", local_fd);
|
||||
else { // if(pair == null)
|
||||
if(!is_local_conncheck_started) {
|
||||
TSK_DEBUG_INFO("ICE local conncheck haven't started yet");
|
||||
}
|
||||
else {
|
||||
TSK_DEBUG_ERROR("Cannot find ICE pair with local fd = %d", local_fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(TNET_STUN_MESSAGE_IS_RESPONSE(message)){
|
||||
|
|
|
@ -613,7 +613,7 @@ int trtp_rtcp_session_process_rtp_in(trtp_rtcp_session_t* self, const trtp_rtp_p
|
|||
}
|
||||
|
||||
if(!self->started){
|
||||
TSK_DEBUG_ERROR("Not started");
|
||||
TSK_DEBUG_INFO("RTCP session not started");
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ typedef struct tsip_dialog_invite
|
|||
tsk_fsm_action_id last_action_id;
|
||||
tsip_action_t* last_action;
|
||||
tsip_message_t* last_message;
|
||||
int32_t last_sdp_ro_ver;
|
||||
} ice;
|
||||
|
||||
/* Session Timers */
|
||||
|
|
|
@ -1703,6 +1703,7 @@ static tsk_object_t* tsip_dialog_invite_ctor(tsk_object_t * self, va_list * app)
|
|||
#else
|
||||
dialog->ice.is_jingle = tsk_false;
|
||||
#endif
|
||||
dialog->ice.last_sdp_ro_ver = -1;
|
||||
dialog->use_rtcp = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcp;
|
||||
dialog->use_rtcpmux = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcpmux;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "tinysdp/parsers/tsdp_parser_message.h"
|
||||
#include "tinysdp/tsdp_message.h"
|
||||
#include "tinysdp/headers/tsdp_header_S.h"
|
||||
#include "tinysdp/headers/tsdp_header_O.h"
|
||||
|
||||
#include "ice/tnet_ice_ctx.h"
|
||||
|
||||
|
@ -313,6 +314,7 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
|
|||
const tsdp_header_M_t* M;
|
||||
tsk_size_t index;
|
||||
const tsdp_header_A_t *A;
|
||||
const tsdp_header_O_t *O;
|
||||
const char* sess_ufrag = tsk_null;
|
||||
const char* sess_pwd = tsk_null;
|
||||
int ret = 0, i;
|
||||
|
@ -326,6 +328,15 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
|
|||
return 0;
|
||||
}
|
||||
|
||||
// make sure this is different SDP
|
||||
if((O = (const tsdp_header_O_t*)tsdp_message_get_header(sdp_ro, tsdp_htype_O))){
|
||||
if(self->ice.last_sdp_ro_ver == (int32_t)O->sess_version){
|
||||
TSK_DEBUG_INFO("ICE: ignore processing SDP RO because version haven't changed");
|
||||
return 0;
|
||||
}
|
||||
self->ice.last_sdp_ro_ver = (int32_t)O->sess_version;
|
||||
}
|
||||
|
||||
// session level attributes
|
||||
|
||||
if((A = tsdp_message_get_headerA(sdp_ro, "ice-ufrag"))){
|
||||
|
@ -396,6 +407,10 @@ static int x0500_Current_2_Current_X_oINVITE(va_list *app)
|
|||
self->is_client = tsk_true;
|
||||
tsip_dialog_invite_ice_save_action(self, _fsm_action_oINVITE, action, message);
|
||||
|
||||
// Cancel ICE silently (without callback)
|
||||
// If callback is raised then, this functin will be called again (because it's the last/saved action)
|
||||
ret = tsip_dialog_invite_ice_cancel_ctx(self, tsk_true);
|
||||
|
||||
// create ICE context
|
||||
if((ret = tsip_dialog_invite_ice_create_ctx(self, media_type))){
|
||||
TSK_DEBUG_ERROR("tsip_dialog_invite_ice_create_ctx() failed");
|
||||
|
|
Loading…
Reference in New Issue