]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add graceful zrtp failure
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 2 Sep 2009 18:44:33 +0000 (18:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 2 Sep 2009 18:44:33 +0000 (18:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14745 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_rtp.c

index e7df3fd6ca51ed8980bd6ab57d60970c9a7b6b95..58931c109f3ee2e907467448780a7c8856a4f53c 100644 (file)
@@ -600,12 +600,16 @@ SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool)
                
                zrtp_log_set_log_engine(zrtp_logger);
                zrtp_log_set_level(4);
-               if (zrtp_status_ok != zrtp_init(&zrtp_config, &zrtp_global)) {
-                       abort();
+               if (zrtp_status_ok == zrtp_init(&zrtp_config, &zrtp_global)) {
+               
+                       memcpy(zid, zid_string, 12);
+                       switch_scheduler_add_task(switch_epoch_time_now(NULL) + 900, zrtp_cache_save_callback, "zrtp_cache_save", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
+               } else {
+                       switch_core_set_variable("zrtp_enabled", NULL);
+                       zrtp_on = 0;
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "ZRTP init failed!\n");
                }
                
-               memcpy(zid, zid_string, 12);
-               switch_scheduler_add_task(switch_epoch_time_now(NULL) + 900, zrtp_cache_save_callback, "zrtp_cache_save", "core", 0, NULL, SSHF_NONE | SSHF_NO_DEL);
        }
 #endif
        srtp_init();