]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6702 #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 29 Jul 2014 17:16:56 +0000 (22:16 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 29 Jul 2014 17:17:02 +0000 (22:17 +0500)
html5/verto/demo/verto.js
src/mod/endpoints/mod_verto/mod_verto.c
src/switch_core_media.c

index 2099824f13245cbe00cf27b263a9765dae0288b7..a7c39295df3488462b74d65a23dfb20e9282915e 100644 (file)
@@ -456,6 +456,7 @@ function init() {
 
 $(document).ready(function() {
     var hash = window.location.hash.substring(1);    
+    var a = [];
 
     if (hash && hash.indexOf("page-") == -1) {
        window.location.hash = "";
@@ -463,6 +464,10 @@ $(document).ready(function() {
        autocall = true;
     }
 
+    if (hash && (a = hash.split("&"))) {
+       window.location.hash = a[0];
+    }
+
     init();
 
 });
index c7f41286906a4eda48eb8731401e4e8a7b6c2f37..d2a5b5fdadc9facc2b3a4e55dc2f7925dc43fb90 100644 (file)
@@ -1083,6 +1083,11 @@ static void detach_calls(jsock_t *jsock)
                        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++;
@@ -2478,6 +2483,14 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
        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);
index 26987402df2cafbe121e21045e489a449dd80a76..b04df85757e070ff5eaa4d12e7ced6b26587c58e 100644 (file)
@@ -2882,7 +2882,7 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, 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));