diff --git a/Makefile.am b/Makefile.am index 2104db9b75..ddcf2fca06 100644 --- a/Makefile.am +++ b/Makefile.am @@ -470,11 +470,17 @@ libs/speex/libspeex/libspeexdsp.la: libs/speex/.update @cd libs/speex && $(MAKE) @$(TOUCH_TARGET) -libs/sqlite/libsqlite3.la: libs/sqlite libs/sqlite/.update +libs/sqlite/libsqlite3.la: libs/sqlite libs/sqlite/Makefile libs/sqlite/.update touch src/include/switch.h @cd libs/sqlite && $(MAKE) CFLAGS="$(SWITCH_AM_CFLAGS)" @$(TOUCH_TARGET) +libs/sqlite/Makefile: libs/sqlite/configure.ac + cd libs/sqlite && autoconf + cd libs/sqlite && ./config.status --recheck + cd libs/sqlite && ./config.status + @$(TOUCH_TARGET) + libs/pcre/libpcre.la: libs/pcre libs/pcre/.update touch src/include/switch.h @cd libs/pcre && $(MAKE) diff --git a/configure.in b/configure.in index 6f7c2eea68..6dbdfb7759 100644 --- a/configure.in +++ b/configure.in @@ -3,10 +3,10 @@ # Must change all of the below together # For a release, set revision for that tagged release as well and uncomment -AC_INIT([freeswitch], [1.2.5.2], BUG-REPORT-ADDRESS) +AC_INIT([freeswitch], [1.2.5.3], BUG-REPORT-ADDRESS) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [2]) -AC_SUBST(SWITCH_VERSION_MICRO, [5.2]) +AC_SUBST(SWITCH_VERSION_MICRO, [5.3]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) diff --git a/docs/ChangeLog b/docs/ChangeLog index f5e330d00e..6921a3133c 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -1,3 +1,7 @@ +freeswitch (1.2.5.2) + Maintenance release/bug fixes +freeswitch (1.2.5.1) + Maintenance release/bug fixes freeswitch (1.2.5) mod_lua: Enable mod_lua to use native pgsql dbh support (r:2cea7f0f) mod_sofia: Add att_xfer_destination_number variable to indicate the original destination number of the attended transfer leg on REFER for semi-attended transfer scenarios. (r:893cd7be) diff --git a/libs/sqlite/configure.ac b/libs/sqlite/configure.ac index 75d6f512d1..3522235852 100644 --- a/libs/sqlite/configure.ac +++ b/libs/sqlite/configure.ac @@ -634,6 +634,7 @@ else LIBS="" AC_SEARCH_LIBS(tgetent, [readline ncurses curses termcap]) AC_CHECK_LIB([readline], [readline]) + AC_CHECK_LIB([dl], [dlopen]) TARGET_READLINE_LIBS="$LIBS" fi AC_SUBST(TARGET_READLINE_LIBS) diff --git a/scripts/ci/src_tarball.sh b/scripts/ci/src_tarball.sh index 1c79f2fca1..4e64d68e77 100755 --- a/scripts/ci/src_tarball.sh +++ b/scripts/ci/src_tarball.sh @@ -8,8 +8,12 @@ sdir="." check_pwd check_input_ver_build $@ eval $(parse_version "$1") +if [ -n "$grev" ]; then + dst_name="freeswitch-$cmajor.$cminor.$cmicro.$grev" +else + dst_name="freeswitch-$cmajor.$cminor.$cmicro" +fi -dst_name="freeswitch-$cmajor.$cminor.$cmicro" dst_dir="${tmp_dir}/jenkins.$$/$dst_name" if [ -d "$dst_dir" ]; then diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 8970803f44..c05c02ed85 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -759,8 +759,12 @@ static switch_status_t fifo_execute_sql_queued(char **sqlp, switch_bool_t sql_al if (switch_stristr("insert", sql)) { index = 0; } - - switch_sql_queue_manager_push(globals.qm, sql, index, !sql_already_dynamic); + + if (block) { + switch_sql_queue_manager_push_confirm(globals.qm, sql, index, !sql_already_dynamic); + } else { + switch_sql_queue_manager_push(globals.qm, sql, index, !sql_already_dynamic); + } if (sql_already_dynamic) { *sqlp = NULL; @@ -2248,7 +2252,7 @@ static void fifo_caller_add(fifo_node_t *node, switch_core_session_t *session) switch_str_nil(switch_channel_get_variable(channel, "caller_id_number")), switch_epoch_time_now(NULL)); - fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE); + fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE); } static void fifo_caller_del(const char *uuid) @@ -2261,7 +2265,7 @@ static void fifo_caller_del(const char *uuid) sql = switch_mprintf("delete from fifo_callers"); } - fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE); + fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE); } @@ -3998,6 +4002,8 @@ static switch_status_t load_config(int reload, int del_all) return SWITCH_STATUS_TERM; } + globals.dbname = "fifo"; + if ((settings = switch_xml_child(cfg, "settings"))) { for (param = switch_xml_child(settings, "param"); param; param = param->next) { char *var = NULL; @@ -4030,23 +4036,6 @@ static switch_status_t load_config(int reload, int del_all) } } - if (zstr(globals.odbc_dsn)) { - globals.dbname = "fifo"; - } - - switch_sql_queue_manager_init_name("fifo", - &globals.qm, - 2, - globals.odbc_dsn ? globals.odbc_dsn : globals.dbname, - SWITCH_MAX_TRANS, - globals.pre_trans_execute, - globals.post_trans_execute, - globals.inner_pre_trans_execute, - globals.inner_post_trans_execute); - - switch_sql_queue_manager_start(globals.qm); - - if (!(dbh = fifo_get_db_handle())) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot open DB!\n"); @@ -4054,6 +4043,20 @@ static switch_status_t load_config(int reload, int del_all) } if (!reload) { + switch_sql_queue_manager_init_name("fifo", + &globals.qm, + 2, + !zstr(globals.odbc_dsn) ? globals.odbc_dsn : globals.dbname, + SWITCH_MAX_TRANS, + globals.pre_trans_execute, + globals.post_trans_execute, + globals.inner_pre_trans_execute, + globals.inner_post_trans_execute); + + switch_sql_queue_manager_start(globals.qm); + + + switch_cache_db_test_reactive(dbh, "delete from fifo_outbound where static = 1 or taking_calls < 0 or stop_time < 0", "drop table fifo_outbound", outbound_sql); switch_cache_db_test_reactive(dbh, "delete from fifo_bridge", "drop table fifo_bridge", bridge_sql); @@ -4499,6 +4502,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_fifo_load) return status; } + /* connect my internal structure to the blank pointer passed to me */ *module_interface = switch_loadable_module_create_module_interface(pool, modname); SWITCH_ADD_APP(app_interface, "fifo", "Park with FIFO", FIFO_DESC, fifo_function, FIFO_USAGE, SAF_NONE); @@ -4529,6 +4533,8 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_fifo_shutdown) fifo_node_t *node, *this_node; switch_mutex_t *mutex = globals.mutex; + switch_sql_queue_manager_destroy(&globals.qm); + switch_event_unbind(&globals.node); switch_event_free_subclass(FIFO_EVENT); diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 845c342f63..275e2f47ff 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -2565,7 +2565,12 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char } - fetch_cache_data(context, url, &headers, context->cache_file); + if ((status = fetch_cache_data(context, url, &headers, context->cache_file)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error checking file cache (check permissions)\n"); + goto end; + } + + metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", url, switch_event_get_header_nil(headers, "last-modified"), diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 2878968ddf..da0cbdeb02 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -83,7 +83,8 @@ typedef enum { TFLAG_TRANSPORT_ACCEPT = (1 << 22), TFLAG_READY = (1 << 23), TFLAG_NAT_MAP = (1 << 24), - TFLAG_SECURE = (1 << 25) + TFLAG_SECURE = (1 << 25), + TFLAG_VIDEO_RTP_READY = (1 << 7) } TFLAGS; typedef enum { @@ -240,7 +241,7 @@ struct private_object { switch_mutex_t *flag_mutex; int read_count; - + switch_time_t audio_ready; }; @@ -1345,10 +1346,6 @@ static int activate_video_rtp(struct private_object *tech_pvt) switch_rtp_destroy(&tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session); } - - - - } else { if (switch_core_codec_init(&tech_pvt->transports[LDL_TPORT_VIDEO_RTP].read_codec, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_name, @@ -1460,6 +1457,7 @@ static int activate_video_rtp(struct private_object *tech_pvt) tech_pvt->transports[LDL_TPORT_VIDEO_RTP].local_user, NULL);//tech_pvt->transports[LDL_TPORT_VIDEO_RTP].remote_pass); switch_channel_set_flag(channel, CF_VIDEO); + switch_set_flag(tech_pvt, TFLAG_VIDEO_RTP_READY); //switch_rtp_set_default_payload(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num); //switch_rtp_set_recv_pt(tech_pvt->transports[LDL_TPORT_VIDEO_RTP].rtp_session, tech_pvt->transports[LDL_TPORT_VIDEO_RTP].codec_num); @@ -1491,11 +1489,15 @@ static int activate_rtp(struct private_object *tech_pvt) int r = 0; if (tech_pvt->transports[LDL_TPORT_RTP].ready) { - r += activate_audio_rtp(tech_pvt); + if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND) || tech_pvt->transports[LDL_TPORT_RTCP].accepted) { + r += activate_audio_rtp(tech_pvt); + } } if (tech_pvt->transports[LDL_TPORT_VIDEO_RTP].ready) { - r += activate_video_rtp(tech_pvt); + if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND) || tech_pvt->transports[LDL_TPORT_VIDEO_RTCP].accepted) { + r += activate_video_rtp(tech_pvt); + } } return r; @@ -1631,6 +1633,7 @@ static int do_candidates(struct private_object *tech_pvt, int force) if ((tech_pvt->transports[LDL_TPORT_RTP].ready && tech_pvt->transports[LDL_TPORT_RTCP].ready)) { switch_set_flag_locked(tech_pvt, TFLAG_TRANSPORT); switch_set_flag_locked(tech_pvt, TFLAG_RTP_READY); + tech_pvt->audio_ready = switch_micro_time_now(); } @@ -1793,7 +1796,7 @@ static switch_status_t negotiate_media(switch_core_session_t *session) struct private_object *tech_pvt = NULL; switch_time_t started; switch_time_t now; - unsigned int elapsed; + unsigned int elapsed, audio_elapsed; tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); @@ -1815,12 +1818,20 @@ static switch_status_t negotiate_media(switch_core_session_t *session) while (!(switch_test_flag(tech_pvt, TFLAG_CODEC_READY) && switch_test_flag(tech_pvt, TFLAG_RTP_READY) && + (switch_test_flag(tech_pvt, TFLAG_OUTBOUND) || switch_test_flag(tech_pvt, TFLAG_VIDEO_RTP_READY)) && switch_test_flag(tech_pvt, TFLAG_ANSWER) && switch_test_flag(tech_pvt, TFLAG_TRANSPORT_ACCEPT) && //tech_pvt->read_count && tech_pvt->transports[LDL_TPORT_RTP].remote_ip && tech_pvt->transports[LDL_TPORT_RTP].remote_port && switch_test_flag(tech_pvt, TFLAG_TRANSPORT))) { now = switch_micro_time_now(); elapsed = (unsigned int) ((now - started) / 1000); + if (switch_test_flag(tech_pvt, TFLAG_RTP_READY) && !switch_test_flag(tech_pvt, TFLAG_VIDEO_RTP_READY)) { + audio_elapsed = (unsigned int) ((now - tech_pvt->audio_ready) / 1000); + if (audio_elapsed > 1000) { + switch_set_flag(tech_pvt, TFLAG_VIDEO_RTP_READY); + } + } + if (switch_channel_down(channel) || switch_test_flag(tech_pvt, TFLAG_BYE)) { goto out; } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c74a61cfd2..161d245ea5 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1354,7 +1354,7 @@ static void our_sofia_event_callback(nua_event_t event, switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Request-Target-Extension", ref_to_user); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Request-Target-Domain", ref_to_host); if (switch_true(full_url)) { - switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "full-url", "true"); + switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "full_url", "true"); } if (sip->sip_call_id && sip->sip_call_id->i_id) { @@ -1582,7 +1582,6 @@ void sofia_process_dispatch_event(sofia_dispatch_event_t **dep) nua_t *nua = de->nua; sofia_profile_t *profile = de->profile; sofia_private_t *sofia_private = nua_handle_magic(de->nh); - switch_core_session_t *session = de->session; *dep = NULL; our_sofia_event_callback(de->data->e_event, de->data->e_status, de->data->e_phrase, de->nua, de->profile, @@ -1597,10 +1596,6 @@ void sofia_process_dispatch_event(sofia_dispatch_event_t **dep) nua_handle_unref(nh); nua_stack_unref(nua); - - if (session) { - switch_ivr_parse_all_signal_data(session); - } } @@ -2428,7 +2423,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void if (!profile->nua) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Creating SIP UA for profile: %s\n" "The likely causes for this are:\n" "1) Another application is already listening on the specified address.\n" - "2) The IP the profile is attempting to bind to is not local to this system.", profile->name); + "2) The IP the profile is attempting to bind to is not local to this system.\n", profile->name); sofia_profile_start_failure(profile, profile->name); sofia_glue_del_profile(profile); goto end; diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index efdce9449e..d24b3182c1 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -707,9 +707,9 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch if (ov_fmtp) { pass_fmtp = ov_fmtp; - } else { - pass_fmtp = switch_channel_get_variable(tech_pvt->channel, "sip_video_fmtp"); - } + }// else { // seems to break eyebeam at least... + //pass_fmtp = switch_channel_get_variable(tech_pvt->channel, "sip_video_fmtp"); + //} } if (pass_fmtp) { diff --git a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c index 8a2b30d5e9..4fe0eb6725 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c @@ -119,7 +119,10 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) switch_app_log_t *app_log; bson cdr; int is_b; + int callflow_idx = 0; + switch_hold_record_t *hold_record = switch_channel_get_hold_record(channel), *hr; char *tmp; + char idx_buffer[4]; if (globals.shutdown) { return SWITCH_STATUS_SUCCESS; @@ -170,26 +173,52 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) /* App log */ if ((app_log = switch_core_session_get_app_log(session))) { + int idx = 0; switch_app_log_t *ap; - bson_append_start_object(&cdr, "app_log"); + bson_append_start_array(&cdr, "app_log"); + for (ap = app_log; ap; ap = ap->next) { - bson_append_start_object(&cdr, "application"); + switch_snprintf(idx_buffer, sizeof(idx_buffer), "%d", idx); + bson_append_start_object(&cdr, idx_buffer); bson_append_string(&cdr, "app_name", ap->app); bson_append_string(&cdr, "app_data", switch_str_nil(ap->arg)); bson_append_long(&cdr, "app_stamp", ap->stamp); bson_append_finish_object(&cdr); /* application */ + idx++; } - bson_append_finish_object(&cdr); /* app_log */ + bson_append_finish_array(&cdr); /* app_log */ + } + + /* Hold */ + if (hold_record) { + int idx = 0; + bson_append_start_array(&cdr, "hold_record"); + for (hr = hold_record; hr ; hr = hr->next) { + switch_snprintf(idx_buffer, sizeof(idx_buffer), "%d", idx); + bson_append_start_object(&cdr, idx_buffer); + bson_append_long(&cdr, "on", hr->on); + bson_append_long(&cdr, "off", hr->off); + if (hr->uuid) { + bson_append_string(&cdr, "bridged_to", hr->uuid); + } + bson_append_finish_object(&cdr); + idx++; + } + bson_append_finish_array(&cdr); } /* Callflow */ caller_profile = switch_channel_get_caller_profile(channel); + /* Start callflow array */ + bson_append_start_array(&cdr, "callflow"); + while (caller_profile) { - bson_append_start_object(&cdr, "callflow"); + snprintf(idx_buffer, sizeof(idx_buffer), "%d", callflow_idx); + bson_append_start_object(&cdr, idx_buffer); if (!zstr(caller_profile->dialplan)) { bson_append_string(&cdr, "dialplan", caller_profile->dialplan); @@ -262,37 +291,49 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) set_bson_profile_data(&cdr, caller_profile); if (caller_profile->origination_caller_profile) { + int idx = 0; switch_caller_profile_t *cp = NULL; - bson_append_start_object(&cdr, "origination"); + /* Start origination array */ + bson_append_start_array(&cdr, "origination"); for (cp = caller_profile->origination_caller_profile; cp; cp = cp->next) { - bson_append_start_object(&cdr, "origination_caller_profile"); + snprintf(idx_buffer, sizeof(idx_buffer), "%d", idx); + bson_append_start_object(&cdr, idx_buffer); set_bson_profile_data(&cdr, cp); bson_append_finish_object(&cdr); + idx++; } bson_append_finish_object(&cdr); /* origination */ } if (caller_profile->originator_caller_profile) { + int idx = 0; switch_caller_profile_t *cp = NULL; - bson_append_start_object(&cdr, "originator"); + /* Start originator array */ + bson_append_start_array(&cdr, "originator"); for (cp = caller_profile->originator_caller_profile; cp; cp = cp->next) { - bson_append_start_object(&cdr, "originator_caller_profile"); + snprintf(idx_buffer, sizeof(idx_buffer), "%d", idx); + bson_append_start_object(&cdr, idx_buffer); set_bson_profile_data(&cdr, cp); bson_append_finish_object(&cdr); + idx++; } bson_append_finish_object(&cdr); /* originator */ } if (caller_profile->originatee_caller_profile) { + int idx = 0; switch_caller_profile_t *cp = NULL; - bson_append_start_object(&cdr, "originatee"); + /* Start originatee array */ + bson_append_start_array(&cdr, "originatee"); for (cp = caller_profile->originatee_caller_profile; cp; cp = cp->next) { - bson_append_start_object(&cdr, "originatee_caller_profile"); + snprintf(idx_buffer, sizeof(idx_buffer), "%d", idx); + bson_append_start_object(&cdr, idx_buffer); set_bson_profile_data(&cdr, cp); bson_append_finish_object(&cdr); + idx++; } bson_append_finish_object(&cdr); /* originatee */ } @@ -320,8 +361,11 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) bson_append_finish_object(&cdr); /* callflow */ caller_profile = caller_profile->next; + callflow_idx++; /* increment callflow_idx */ } + bson_append_finish_array(&cdr); + bson_finish(&cdr); switch_mutex_lock(globals.mongo_mutex); diff --git a/src/switch_core_media_bug.c b/src/switch_core_media_bug.c index b0d9e8d4f9..7beb048155 100644 --- a/src/switch_core_media_bug.c +++ b/src/switch_core_media_bug.c @@ -183,18 +183,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b bytes = read_impl.decoded_bytes_per_packet; -#ifdef TESTINGONLY - if (0 && bug->session->recur_buffer_len) { - frame->datalen = bug->session->recur_buffer_len; - frame->samples = bug->session->recur_buffer_len / sizeof(int16_t); - frame->rate = read_impl.actual_samples_per_second; - frame->codec = NULL; - memcpy(frame->data, bug->session->recur_buffer, bug->session->recur_buffer_len); - return SWITCH_STATUS_SUCCESS; - } -#endif - - if (frame->buflen < bytes) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_ERROR, "%s frame buffer too small!\n", switch_channel_get_name(bug->session->channel)); @@ -232,15 +220,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b } if (!bug->record_frame_size) { - if (do_read && do_write) { - switch_size_t frame_size; - switch_codec_implementation_t read_impl = { 0 }; - switch_codec_implementation_t other_read_impl = { 0 }; - switch_core_session_t *other_session; - - switch_core_session_get_read_impl(bug->session, &read_impl); - frame_size = read_impl.decoded_bytes_per_packet; + switch_size_t frame_size; + switch_codec_implementation_t read_impl = { 0 }; + //switch_codec_implementation_t other_read_impl = { 0 }; + //switch_core_session_t *other_session; + switch_core_session_get_read_impl(bug->session, &read_impl); + frame_size = read_impl.decoded_bytes_per_packet; + bug->record_frame_size = frame_size; +#if 0 + if (do_read && do_write) { if (switch_core_session_get_partner(bug->session, &other_session) == SWITCH_STATUS_SUCCESS) { switch_core_session_get_read_impl(other_session, &other_read_impl); switch_core_session_rwunlock(other_session); @@ -258,6 +247,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b bug->record_frame_size = frame_size; } +#endif } diff --git a/src/switch_core_session.c b/src/switch_core_session.c index c2fb0ea8d6..74dae6e68a 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -1688,6 +1688,12 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread_pool_manager(switch_t check_queue(); } + + while(session_manager.running) { + switch_queue_trypush(session_manager.thread_queue, NULL); + switch_yield(20000); + } + return NULL; } diff --git a/src/switch_ivr.c b/src/switch_ivr.c index dd5055351c..6aa5166634 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -640,6 +640,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *se switch_channel_set_flag(channel, CF_BREAK); } + switch_channel_audio_sync(channel); } } else if (cmd_hash == CMD_UNICAST) { char *local_ip = switch_event_get_header(event, "local-ip"); @@ -1771,6 +1772,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_ switch_channel_set_caller_profile(channel, new_profile); switch_channel_set_state(channel, CS_ROUTING); + switch_channel_audio_sync(channel); msg.message_id = SWITCH_MESSAGE_INDICATE_TRANSFER; msg.from = __FILE__; diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index b8b04cdbd0..52cc7c6693 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -1232,8 +1232,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_ses switch_channel_set_flag_recursive(caller_channel, CF_BRIDGE_ORIGINATOR); switch_channel_clear_flag(peer_channel, CF_BRIDGE_ORIGINATOR); - //switch_channel_audio_sync(caller_channel); - //switch_channel_audio_sync(peer_channel); + switch_channel_audio_sync(caller_channel); + switch_channel_audio_sync(peer_channel); b_leg->session = peer_session; switch_copy_string(b_leg->b_uuid, switch_core_session_get_uuid(session), sizeof(b_leg->b_uuid)); diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 52d903c79d..dc281b5885 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -3707,11 +3707,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_cond_next(); } - //switch_channel_audio_sync(bchan); + switch_channel_audio_sync(bchan); - //if (caller_channel) { - // switch_channel_audio_sync(caller_channel); - //} + if (caller_channel) { + switch_channel_audio_sync(caller_channel); + } } if (oglobals.session) { diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 8726beabe8..951edb70b7 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -2072,7 +2072,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host, rtp_session->ready = 2; rtp_session->rx_host = switch_core_strdup(rtp_session->pool, rx_host); rtp_session->rx_port = rx_port; - //switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); + switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_FLUSH); } else { switch_rtp_release_port(rx_host, rx_port); } @@ -2763,7 +2763,8 @@ SWITCH_DECLARE(void) rtp_flush_read_buffer(switch_rtp_t *rtp_session, switch_rtp if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA) && !switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) { - + switch_set_flag(rtp_session, SWITCH_RTP_FLAG_FLUSH); + switch (flush) { case SWITCH_RTP_FLUSH_STICK: switch_set_flag_locked(rtp_session, SWITCH_RTP_FLAG_STICKY_FLUSH); @@ -2818,6 +2819,7 @@ static void do_flush(switch_rtp_t *rtp_session) if (switch_rtp_ready(rtp_session)) { bytes = sizeof(rtp_msg_t); switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock_input, 0, (void *) &rtp_session->recv_msg, &bytes); + if (bytes) { int do_cng = 0; @@ -3277,6 +3279,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ "%s Auto-Flush catching up %d packets (%d)ms.\n", switch_core_session_get_name(session), rtp_session->sync_packets, (rtp_session->ms_per_packet * rtp_session->sync_packets) / 1000); + switch_core_timer_sync(&rtp_session->timer); + rtp_session->hot_hits = 0; } else { switch_core_timer_next(&rtp_session->timer);