$(document).ready(function() {
var hash = window.location.hash.substring(1);
+ var a = [];
if (hash && hash.indexOf("page-") == -1) {
window.location.hash = "";
autocall = true;
}
+ if (hash && (a = hash.split("&"))) {
+ window.location.hash = a[0];
+ }
+
init();
});
if (!switch_channel_up_nosig(tech_pvt->channel)) {
continue;
}
+
+ if (!switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED)) {
+ switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ continue;
+ }
tech_pvt->detach_time = switch_epoch_time_now(NULL);
globals.detached++;
tech_pvt = switch_core_session_get_private_class(session, SWITCH_PVT_SECONDARY);
tech_pvt->r_sdp = switch_core_session_strdup(session, sdp);
+
+ if (!switch_channel_test_flag(tech_pvt->channel, CF_ANSWERED)) {
+ switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+ cJSON_AddItemToObject(obj, "message", cJSON_CreateString("Cannot attach to a call that has not been answered."));
+ err = 1; goto cleanup;
+ }
+
+
switch_channel_set_variable(tech_pvt->channel, SWITCH_R_SDP_VARIABLE, tech_pvt->r_sdp);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Remote SDP %s:\n%s\n",
switch_channel_get_name(tech_pvt->channel), tech_pvt->r_sdp);
}
}
- if (engine->ice_in.cands[engine->ice_in.chosen[1]][1].ready) {
+ if (engine->rtp_session && engine->ice_in.cands[engine->ice_in.chosen[1]][1].ready) {
if (engine->rtcp_mux > 0 && !strcmp(engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_addr, engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_addr)
&& engine->ice_in.cands[engine->ice_in.chosen[1]][1].con_port == engine->ice_in.cands[engine->ice_in.chosen[0]][0].con_port) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_INFO, "Skipping %s RTCP ICE (Same as RTP)\n", type2str(type));