Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.
2 changes: 1 addition & 1 deletion release/SIPml-api.js

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions src/tinyMEDIA/src/tmedia_session_jsep.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ tmedia_session_jsep.prototype.__hold = function () {
// tsk_utils_log_warn('already on hold');
return;
}
this.my_mutex = false;

this.b_lo_held = true;

this.o_sdp_ro = null;
Expand All @@ -388,6 +390,8 @@ tmedia_session_jsep.prototype.__resume = function () {
// tsk_utils_log_warn('not on hold');
return;
}
this.my_mutex = false;

this.b_lo_held = false;

this.o_sdp_lo = null;
Expand Down Expand Up @@ -432,6 +436,9 @@ tmedia_session_jsep01.onGetUserMediaSuccess = function (o_stream, _This) {
return;
}

if(This.my_mutex){tsk_utils_log_warn("onGetUserMediaSuccess already executed!"); return;}
This.my_mutex=true;

if (o_stream) {
// save stream other next calls
if (o_stream.getAudioTracks().length > 0 && o_stream.getVideoTracks().length == 0) {
Expand Down Expand Up @@ -583,6 +590,14 @@ tmedia_session_jsep01.onIceCandidate = function (o_event, _This) {

tsk_utils_log_info("onIceCandidate = " + iceState);

if (!tmedia_session_jsep01.hack_timer) {
tmedia_session_jsep01.hack_timer = setTimeout(function() {
//console.info('Hack timer!');
tmedia_session_jsep01.onIceGatheringCompleted(This);
tmedia_session_jsep01.hack_timer = null;
},2000);
};

if (iceState === "complete" || (o_event && !o_event.candidate)) {
tsk_utils_log_info("ICE GATHERING COMPLETED!");
tmedia_session_jsep01.onIceGatheringCompleted(This);
Expand Down
16 changes: 14 additions & 2 deletions src/tinySIP/src/dialogs/tsip_dialog_invite__server.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,22 @@ function s0000_Ringing_2_Terminated_X_iCANCEL(ao_args){
}

/* Send Request Cancelled */
i_ret = o_dialog.send_error(o_dialog.o_last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");
i_ret = o_dialog.send_error(o_dialog.o_last_iInvite, 487, "Request Cancelled", "SIP; cause=487; text=\"Request Cancelled\"");


var found_completed_elsewhere = false;
for (var i in o_request.ao_headers) {
if (o_request.ao_headers[i].s_value && o_request.ao_headers[i].s_value.indexOf('Call completed elsewhere') != -1) {
found_completed_elsewhere = true;
};
};

/* set last error (or info) */
o_dialog.set_last_error(487, "Request Cancelled");
if (! found_completed_elsewhere) {
o_dialog.set_last_error(487, "Request Cancelled");
} else {
o_dialog.set_last_error(487, "Call completed elsewhere");
};

/* alert the user */
o_dialog.signal_invite(tsip_event_invite_type_e.I_REQUEST, tsip_event_code_e.DIALOG_REQUEST_INCOMING, "Incoming Request", o_request);
Expand Down
3 changes: 2 additions & 1 deletion src/tinySIP/src/tsip_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ tsip_session.prototype.__set = function (ao_params) {
if ((o_message = o_curr.ao_values[0])) {
if (o_message.o_hdr_From && o_message.o_hdr_From.o_uri) {
this.o_uri_from = o_message.o_hdr_From.o_uri.clone(false, false);
this.o_uri_from.s_display_name = o_message.o_hdr_From.s_display_name;
}
if (o_message.o_hdr_To && o_message.o_hdr_To.o_uri) {
this.o_uri_to = o_message.o_hdr_To.o_uri.clone(false, false);
Expand Down Expand Up @@ -364,4 +365,4 @@ if(!window.__b_release_mode){
'src/tinySIP/src/api/tsip_api_register.js',
'src/tinySIP/src/api/tsip_api_subscribe.js'
);
}
}