From fc5557b949a2493877c768dcc8c2fe1f3346ce73 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Wed, 20 Nov 2013 07:36:20 -0600 Subject: [PATCH 01/51] FS-5986 --resolve fix download reference to windows libcelt --- libs/win32/celt/libcelt.2012.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/win32/celt/libcelt.2012.vcxproj b/libs/win32/celt/libcelt.2012.vcxproj index 3661a6f4f2..5653c61be6 100644 --- a/libs/win32/celt/libcelt.2012.vcxproj +++ b/libs/win32/celt/libcelt.2012.vcxproj @@ -142,7 +142,7 @@ - + {fff82f9b-6a2b-4be3-95d8-dc5a4fc71e19} false From 8c035205028ebd1e2807f3cf26f47e397b0e0ddf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Nov 2013 22:00:29 +0500 Subject: [PATCH 02/51] FS-5959 --- src/switch_core_media.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 426334466a..b3d4e76eff 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -544,9 +544,17 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) { - exists = (!strcasecmp(name, pmap->iananame) && (!pmap->rate || rate == pmap->rate) && (pmap->ptime || pmap->ptime == ptime)); + exists = (!strcasecmp(name, pmap->iananame) && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime)); if (exists) { + + if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) { + if (strcmp(pmap->rm_fmtp, fmtp)) { + exists = 0; + continue; + } + } + break; } } @@ -3487,7 +3495,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s matches[m_idx].imp = imp; matches[m_idx].map = map; - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Video Codec Compare [%s:%d] is saved as a match\n", + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Video Codec Compare [%s:%d] +++ is saved as a match\n", imp->iananame, imp->ianacode); m_idx++; } From 51464b7b8cbac4f4d2399342a65fe31f539270e7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Nov 2013 23:49:18 +0500 Subject: [PATCH 03/51] FS-5959 always do rtp_mirror_fmtp behaviour --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index b3d4e76eff..5a0bff64db 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -6319,7 +6319,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess if (ov_fmtp) { pass_fmtp = ov_fmtp; - } else if (switch_true(switch_channel_get_variable_dup(session->channel, "rtp_mirror_fmtp", SWITCH_FALSE, -1))) { + } else { //if (switch_true(switch_channel_get_variable_dup(session->channel, "rtp_mirror_fmtp", SWITCH_FALSE, -1))) { // seems to break eyebeam at least... pass_fmtp = switch_channel_get_variable(session->channel, "rtp_video_fmtp"); } From 2f1c82ff363bd42cfa646b7b61f059f20cf6b68c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Nov 2013 23:49:44 +0500 Subject: [PATCH 04/51] FS-5959 set floor when turning on video mid call in conference --- src/mod/applications/mod_conference/mod_conference.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 03fd1cdfc1..1564b1898d 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -3650,6 +3650,7 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v switch_set_flag_locked(member, MFLAG_ACK_VIDEO); switch_channel_clear_flag(channel, CF_VIDEO_ECHO); switch_core_session_refresh_video(member->session); + conference_set_video_floor_holder(member->conference, member, SWITCH_FALSE); } /* if we have caller digits, feed them to the parser to find an action */ From 634d936a027664b6e0d1cb46f71e0070f5f5a9bc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 20 Nov 2013 23:50:15 +0500 Subject: [PATCH 05/51] kill socket in esl_disconnect to prevent blocking --- libs/esl/src/esl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 7a29844ab4..67b82fbe6d 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1123,6 +1123,12 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle) return ESL_FAIL; } + if (handle->sock != ESL_SOCK_INVALID) { + closesocket(handle->sock); + handle->sock = ESL_SOCK_INVALID; + status = ESL_SUCCESS; + } + if (mutex) { esl_mutex_lock(mutex); } @@ -1145,12 +1151,6 @@ ESL_DECLARE(esl_status_t) esl_disconnect(esl_handle_t *handle) esl_event_safe_destroy(&handle->last_ievent); esl_event_safe_destroy(&handle->info_event); - if (handle->sock != ESL_SOCK_INVALID) { - closesocket(handle->sock); - handle->sock = ESL_SOCK_INVALID; - status = ESL_SUCCESS; - } - if (mutex) { esl_mutex_unlock(mutex); esl_mutex_lock(mutex); From 20038230d47552f928664ae211804eeb7045ba04 Mon Sep 17 00:00:00 2001 From: William King Date: Wed, 20 Nov 2013 11:12:48 -0800 Subject: [PATCH 06/51] This was in the wrong section. Should be setting it on the auth_invite, not the auth_registration. --- src/mod/xml_int/mod_xml_radius/mod_xml_radius.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c index af3bb638f8..6695e21382 100644 --- a/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c +++ b/src/mod/xml_int/mod_xml_radius/mod_xml_radius.c @@ -666,6 +666,10 @@ switch_xml_t mod_xml_radius_auth_invite(switch_event_t *params) { switch_xml_set_attr_d(usr, "id", switch_event_get_header(params, "user")); + var = switch_xml_add_child_d(vars, "variable", param_idx++); + switch_xml_set_attr_d(var, "name", "radius_auth_result"); + switch_xml_set_attr_d(var, "value", "0"); + service_vp = recv; while (service_vp != NULL) { rc_avpair_tostr(new_handle, service_vp, name, 512, value, 512); @@ -774,10 +778,6 @@ switch_xml_t mod_xml_radius_auth_reg(switch_event_t *params) { switch_xml_set_attr_d(usr, "id", switch_event_get_header(params, "user")); - var = switch_xml_add_child_d(vars, "variable", param_idx++); - switch_xml_set_attr_d(var, "name", "radius_auth_result"); - switch_xml_set_attr_d(var, "value", "0"); - service_vp = recv; while (service_vp != NULL) { rc_avpair_tostr(new_handle, service_vp, name, 512, value, 512); From ccaa3ae7326e752212fc9c52576859c2dc8d2c23 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 21 Nov 2013 01:38:16 +0500 Subject: [PATCH 07/51] FS-5959 --- src/include/switch_types.h | 2 ++ src/mod/endpoints/mod_sofia/mod_sofia.c | 12 ++++---- src/switch_core_media.c | 37 ++++++++++++++++++++++--- src/switch_rtp.c | 15 ++++++---- 4 files changed, 50 insertions(+), 16 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 8d042eae11..0567fd2455 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -668,6 +668,8 @@ typedef enum { SWITCH_RTP_FLAG_KILL_JB, SWITCH_RTP_FLAG_VIDEO_BREAK, SWITCH_RTP_FLAG_PAUSE, + SWITCH_RTP_FLAG_FIR, + SWITCH_RTP_FLAG_PLI, SWITCH_RTP_FLAG_INVALID } switch_rtp_flag_t; diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index dc6351799d..5e27ccc864 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -1245,19 +1245,19 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ: { - const char *pl = ""; - time_t now = switch_epoch_time_now(NULL); + const char *pl = "\n\n\n\n\n\n\n\n"; + //time_t now = switch_epoch_time_now(NULL); - if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 5) { - - tech_pvt->last_vid_info = now; + //if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 5) { + + // tech_pvt->last_vid_info = now; if (!zstr(msg->string_arg)) { pl = msg->string_arg; } nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END()); - } + //} } break; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 5a0bff64db..fdb4043f54 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -144,6 +144,10 @@ typedef struct switch_rtp_engine_s { uint8_t reset_codec; uint8_t codec_negotiated; + + uint8_t fir; + uint8_t pli; + } switch_rtp_engine_t; @@ -3435,8 +3439,19 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s for (attr = m->m_attributes; attr; attr = attr->a_next) { if (!strcasecmp(attr->a_name, "framerate") && attr->a_value) { //framerate = atoi(attr->a_value); - } - if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value && !strcmp(attr->a_value, "1")) { + } else if (!strcasecmp(attr->a_name, "rtcp-fb")) { + if (!zstr(attr->a_value)) { + if (switch_stristr("fir", attr->a_value)) { + v_engine->fir++; + } + + if (switch_stristr("pli", attr->a_value)) { + v_engine->pli++; + } + + smh->mparams->rtcp_video_interval_msec = "10000"; + } + } else if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value && !strcmp(attr->a_value, "1")) { switch_channel_set_variable(session->channel, "rtp_remote_video_rtcp_port", attr->a_value); v_engine->remote_rtcp_port = (switch_port_t)atoi(attr->a_value); } else if (!got_video_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) { @@ -5095,6 +5110,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi if (switch_rtp_ready(v_engine->rtp_session)) { const char *ssrc; + if (v_engine->fir) { + switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_FIR); + } + + if (v_engine->pli) { + switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PLI); + } + switch_rtp_set_payload_map(v_engine->rtp_session, &v_engine->payload_map); start_video_thread(session); @@ -6436,6 +6459,12 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess } } + + if (v_engine->fir || v_engine->pli) { + switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), + "a=rtcp-fb:* %s%s\n", v_engine->fir ? "fir " : "", v_engine->pli ? "pli" : ""); + } + //switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", v_engine->ssrc); if (v_engine->ice_out.cands[0][0].ready) { @@ -6465,11 +6494,11 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=AS:%d\n", bw); } - if (vp8) { + if (vp8 && switch_channel_test_flag(session->channel, CF_WEBRTC)) { switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtcp-fb:%d ccm fir\n", vp8); } - + if (red) { switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtcp-fb:%d nack\n", vp8); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index aa296c95da..fab4ddba8a 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1459,7 +1459,7 @@ static void send_fir(switch_rtp_t *rtp_session) } -#if 0 + static void send_pli(switch_rtp_t *rtp_session) { @@ -1542,7 +1542,7 @@ static void send_pli(switch_rtp_t *rtp_session) return; } -#endif + static int check_rtcp_and_ice(switch_rtp_t *rtp_session) { @@ -1557,8 +1557,11 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session) } if (rtp_session->fir_countdown == FIR_COUNTDOWN || rtp_session->fir_countdown == 1) { - send_fir(rtp_session); - //send_pli(rtp_session); + if (rtp_session->flags[SWITCH_RTP_FLAG_PLI]) { + send_pli(rtp_session); + } else { + send_fir(rtp_session); + } } rtp_session->fir_countdown--; @@ -3460,9 +3463,9 @@ SWITCH_DECLARE(void) switch_rtp_flush(switch_rtp_t *rtp_session) SWITCH_DECLARE(void) switch_rtp_video_refresh(switch_rtp_t *rtp_session) { - if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && rtp_session->ice.ice_user) { + if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && + (rtp_session->ice.ice_user || rtp_session->flags[SWITCH_RTP_FLAG_FIR] || rtp_session->flags[SWITCH_RTP_FLAG_PLI])) { if (!rtp_session->fir_countdown) { - //send_fir(rtp_session); rtp_session->fir_countdown = FIR_COUNTDOWN; } } From 29c38decab33e6a7c326e4ea432375595674a0b7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 21 Nov 2013 01:41:28 +0500 Subject: [PATCH 08/51] add execute_on_avmd_beep --- src/mod/applications/mod_avmd/mod_avmd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index 5d76a28c2e..15f954b326 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -539,6 +539,8 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame) /*! If variance is less than threshold then we have detection */ if(v < VARIANCE_THRESHOLD){ + switch_channel_execute_on(switch_core_session_get_channel(session), "execute_on_avmd_beep"); + /*! Throw an event to FreeSWITCH */ status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, AVMD_EVENT_BEEP); if(status != SWITCH_STATUS_SUCCESS) { From 3fe701d2415f527f11075242b09c7938aeca02de Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Wed, 20 Nov 2013 14:55:34 -0600 Subject: [PATCH 09/51] fix recursive build error --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index a3e942a036..f10899ca8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,10 +6,10 @@ NAME = freeswitch AM_LIBAPR_CFLAGS := $(shell ./libs/apr/apr-1-config --cflags) AM_LIBAPR_CPPFLAGS := $(shell ./libs/apr/apr-1-config --cppflags --includes) AM_LIBAPR_LDFLAGS := $(shell ./libs/apr/apr-1-config --ldflags) -AM_LIBAPR_LIBS := $(subst $(CURDIR)/,,$(shell ./libs/apr/apr-1-config \--link-libtool \--libs)) +AM_LIBAPR_LIBS := $(subst $(switch_srcdir)/,,$(shell ./libs/apr/apr-1-config \--link-libtool \--libs)) AM_LIBAPU_CPPFLAGS := $(shell ./libs/apr-util/apu-1-config --includes) AM_LIBAPU_LDFLAGS := $(shell ./libs/apr-util/apu-1-config --ldflags) -AM_LIBAPU_LIBS := $(subst $(CURDIR)/,,$(shell ./libs/apr-util/apu-1-config \--link-libtool \--libs)) +AM_LIBAPU_LIBS := $(subst $(switch_srcdir)/,,$(shell ./libs/apr-util/apu-1-config \--link-libtool \--libs)) AM_CFLAGS = $(SWITCH_AM_CFLAGS) $(SWITCH_ANSI_CFLAGS) AM_CPPFLAGS = $(SWITCH_AM_CXXFLAGS) -Ilibs/sofia-sip/libsofia-sip-ua/sdp -Ilibs/sofia-sip/libsofia-sip-ua/su From c07a6b6b9e4a75433dd17b3008d87d2ec41bcd70 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 04:52:11 +0500 Subject: [PATCH 10/51] add polycom support to multicast paging, broadcast all formats at once to support most every popular phone at once --- src/include/switch_apr.h | 1 + src/mod/applications/mod_esf/mod_esf.c | 367 +++++++++++++++++++++---- src/switch_apr.c | 6 + src/switch_rtp.c | 35 +++ 4 files changed, 360 insertions(+), 49 deletions(-) diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index 923d60d985..3cb478a7cf 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -1304,6 +1304,7 @@ SWITCH_DECLARE(switch_status_t) switch_mcast_join(switch_socket_t *sock, switch_ SWITCH_DECLARE(switch_status_t) switch_mcast_hops(switch_socket_t *sock, uint8_t ttl); SWITCH_DECLARE(switch_status_t) switch_mcast_loopback(switch_socket_t *sock, uint8_t opt); +SWITCH_DECLARE(switch_status_t) switch_mcast_interface(switch_socket_t *sock, switch_sockaddr_t *iface); /** @} */ diff --git a/src/mod/applications/mod_esf/mod_esf.c b/src/mod/applications/mod_esf/mod_esf.c index f6a9191877..d8abbb5bcd 100644 --- a/src/mod/applications/mod_esf/mod_esf.c +++ b/src/mod/applications/mod_esf/mod_esf.c @@ -35,6 +35,45 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load); SWITCH_MODULE_DEFINITION(mod_esf, mod_esf_load, NULL, NULL); + + +#ifdef _MSC_VER +#pragma pack(push, r1, 1) +#else +#pragma pack(1) +#endif + + +struct polycom_packet { + switch_byte_t op; + switch_byte_t channel; + uint32_t serno; + uint8_t cid_len; + unsigned char cid[13]; +}; + +typedef struct polycom_packet polycom_packet_t; + +typedef struct { + switch_byte_t codec; + switch_byte_t flags; + uint32_t seq; +} polycom_audio_header_t; + + +typedef struct polycom_alert_packet { + polycom_packet_t header; + polycom_audio_header_t audio_header; + uint8_t data[]; +} polycom_alert_packet_t; + + +#ifdef _MSC_VER +#pragma pack(pop, r1) +#else +#pragma pack() +#endif + struct ls_control_packet { uint32_t unique_id; uint32_t command; @@ -52,35 +91,82 @@ typedef enum { typedef enum { SEND_TYPE_UNKNOWN = 0, SEND_TYPE_RTP = 1, - SEND_TYPE_RAW = 2, - SEND_TYPE_NOMEDIA = 3 + SEND_TYPE_NOMEDIA = 2 } ls_how_t; +static uint32_t SERNO = 0; + +switch_mutex_t *MUTEX = NULL; + +uint32_t get_serno(void) +{ + uint32_t r = 0; + + switch_mutex_lock(MUTEX); + r = SERNO; + switch_mutex_unlock(MUTEX); + + return r; +} + + +void inc_serno(void) +{ + switch_mutex_lock(MUTEX); + SERNO++; + switch_mutex_unlock(MUTEX); + +} + +void dec_serno(void) +{ + switch_mutex_lock(MUTEX); + SERNO--; + switch_mutex_unlock(MUTEX); + +} + + SWITCH_STANDARD_APP(bcast_function) { switch_channel_t *channel = switch_core_session_get_channel(session); - switch_socket_t *socket; - switch_sockaddr_t *audio_addr = NULL, *control_packet_addr; + switch_socket_t *socket, *polycom_socket = NULL; + switch_sockaddr_t *audio_addr = NULL, *control_packet_addr = NULL, *polycom_addr = NULL, *local_addr = NULL; switch_frame_t *read_frame = NULL; switch_status_t status; switch_size_t bytes; ls_control_packet_t control_packet; + unsigned char polycom_buf[1024] = { 0 }; + unsigned char last_polycom_buf[1024] = { 0 }; + uint32_t last_polycom_len = 0; + polycom_packet_t *polycom_packet = (polycom_packet_t *) polycom_buf; + polycom_alert_packet_t *alert_packet = (polycom_alert_packet_t *) polycom_buf; switch_codec_t codec = { 0 }; + switch_codec_t write_codec = { 0 }; switch_rtp_flag_t flags[SWITCH_RTP_FLAG_INVALID] = {0}; const char *err; switch_rtp_t *rtp_session = NULL; - switch_port_t rtp_port; - char guess_ip[25]; + switch_port_t rtp_port = 0; ls_how_t ready = SEND_TYPE_UNKNOWN; - //int argc; char *mydata, *argv[5]; char *mcast_ip = "224.168.168.168"; switch_port_t mcast_port = 34567; switch_port_t mcast_control_port = 6061; char *mcast_port_str = "34567"; - const char *esf_broadcast_ip = NULL, *var; + char *polycom_ip = "224.0.1.116"; + const char *source_ip = NULL; + switch_port_t polycom_port = 5001; + const char *var; switch_codec_implementation_t read_impl = { 0 }; int mcast_ttl = 1; + const char *caller_id_name = NULL; + int x = 0; + uint32_t seq = 0; + const char *codec_name = "PCMU"; + int read_rate = 8000; + int need_transcode = 0; + + inc_serno(); switch_core_session_get_read_impl(session, &read_impl); @@ -115,6 +201,9 @@ SWITCH_STANDARD_APP(bcast_function) } } + switch_channel_set_variable_printf(channel, "multicast_ttl", "%d", mcast_ttl); + + if (switch_true(switch_channel_get_variable(channel, SWITCH_BYPASS_MEDIA_VARIABLE))) { switch_core_session_message_t msg = { 0 }; @@ -132,13 +221,27 @@ SWITCH_STANDARD_APP(bcast_function) switch_channel_answer(channel); } + if (!(source_ip = switch_channel_get_variable(channel, "esf_multicast_bind_ip"))) { + if (!(source_ip = switch_channel_get_variable(channel, "local_ip_v4"))) { + source_ip = "127.0.0.1"; + } + } + + /* everyone */ + + if (switch_sockaddr_info_get(&local_addr, source_ip, SWITCH_UNSPEC, + 0, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "address Error\n"); + goto fail; + } + if (switch_socket_create(&socket, AF_INET, SOCK_DGRAM, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error 1\n"); goto fail; } - if (switch_mcast_hops(socket, (uint8_t) mcast_ttl) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Mutlicast TTL set failed\n"); + if (switch_socket_opt_set(socket, SWITCH_SO_REUSEADDR, 1) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Option Error\n"); goto fail; } @@ -148,29 +251,121 @@ SWITCH_STANDARD_APP(bcast_function) goto fail; } + if (switch_socket_bind(socket, local_addr) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket bind Error\n"); + goto fail; + } + if (switch_mcast_interface(socket, local_addr) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket interface Error\n"); + goto fail; + } + + if (switch_mcast_join(socket, control_packet_addr, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Multicast Error\n"); + goto fail; + } + + + if (switch_mcast_hops(socket, (uint8_t) mcast_ttl) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Mutlicast TTL set failed\n"); + goto fail; + } + + /* polycom */ + + + if (switch_sockaddr_info_get(&polycom_addr, polycom_ip, SWITCH_UNSPEC, + polycom_port, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error 3\n"); + goto fail; + } + + if (switch_socket_create(&polycom_socket, AF_INET, SOCK_DGRAM, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error 1\n"); + goto fail; + } + + if (switch_socket_opt_set(polycom_socket, SWITCH_SO_REUSEADDR, 1) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Option Error\n"); + goto fail; + } + + if (switch_socket_bind(polycom_socket, local_addr) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket bind Error\n"); + goto fail; + } + + + if (switch_mcast_interface(polycom_socket, local_addr) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket interface Error\n"); + goto fail; + } + + if (switch_mcast_join(polycom_socket, polycom_addr, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Multicast Error\n"); + goto fail; + } + + + if (switch_mcast_hops(polycom_socket, (uint8_t) mcast_ttl) != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Mutlicast TTL set failed\n"); + goto fail; + } + + while (!ready) { status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); - if (read_frame && switch_test_flag(read_frame, SFF_CNG)) { - continue; - } if (!SWITCH_READ_ACCEPTABLE(status) || !read_frame) { goto fail; } - if (read_frame->packet && read_frame->packetlen && read_impl.ianacode == 0) { - ready = SEND_TYPE_RAW; - } else { - ready = SEND_TYPE_RTP; + + if (switch_test_flag(read_frame, SFF_CNG)) { + continue; + } + + + ready = SEND_TYPE_RTP; + } + + + alert_packet->audio_header.codec = 0x00; + alert_packet->audio_header.flags = 0; + + if ((var = switch_channel_get_variable(channel, "esf_multicast_write_codec"))) { + if (!strcasecmp(var, "PCMU")) { + codec_name = var; + } else if (!strcasecmp(var, "G722")) { + codec_name = var; + read_rate = 16000; + alert_packet->audio_header.codec = 0x09; } } + if (ready == SEND_TYPE_RTP) { - if (read_impl.ianacode != 0) { + if (strcasecmp(read_impl.iananame, codec_name)) { + need_transcode = 1; + if (switch_core_codec_init(&codec, "L16", NULL, + read_rate, + 20, + 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, + NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) { + switch_core_session_set_read_codec(session, &codec); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Codec Activation Success\n"); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Codec Activation Fail\n"); + goto fail; + } + + if (switch_core_codec_init(&write_codec, + codec_name, + NULL, 8000, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, @@ -182,39 +377,28 @@ SWITCH_STANDARD_APP(bcast_function) goto fail; } } + - if ((var = switch_channel_get_variable(channel, "esf_broadcast_ip"))) { - esf_broadcast_ip = switch_core_session_strdup(session, var); - } else { - switch_find_local_ip(guess_ip, sizeof(guess_ip), NULL, AF_INET); - esf_broadcast_ip = guess_ip; - } - - - if (!(rtp_port = switch_rtp_request_port(esf_broadcast_ip))) { + if (!(rtp_port = switch_rtp_request_port(source_ip))) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "RTP Port Error\n"); goto fail; } - rtp_session = switch_rtp_new(esf_broadcast_ip, + rtp_session = switch_rtp_new(source_ip, rtp_port, mcast_ip, mcast_port, - 0, + alert_packet->audio_header.codec, 160, 20000, flags, "soft", &err, switch_core_session_get_pool(session)); - + if (!switch_rtp_ready(rtp_session)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "RTP Error\n"); goto fail; } + } else if (ready == SEND_TYPE_NOMEDIA) { switch_yield(10000); - } else if (ready == SEND_TYPE_RAW) { - if (switch_sockaddr_info_get(&audio_addr, mcast_ip, SWITCH_UNSPEC, mcast_port, 0, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Socket Error 2\n"); - goto fail; - } } control_packet.unique_id = htonl((u_long) switch_epoch_time_now(NULL)); @@ -227,6 +411,38 @@ SWITCH_STANDARD_APP(bcast_function) bytes = 16; switch_socket_sendto(socket, control_packet_addr, 0, (void *) &control_packet, &bytes); + + if (!(caller_id_name = switch_channel_get_variable(channel, "caller_id_name"))) { + caller_id_name = "FreeSWITCH"; + } + + strncpy((char *)polycom_packet->cid, caller_id_name, sizeof(polycom_packet->cid)); + polycom_packet->cid_len = 13; + + polycom_packet->op = 0x0F; + polycom_packet->channel = 0x1a; + polycom_packet->serno = htonl(get_serno()); + + if ((var = switch_channel_get_variable(channel, "esf_multicast_channel"))) { + int channel_no = atoi(var); + + if (channel_no > 0 && channel_no < 255) { + polycom_packet->channel = (uint8_t) channel_no; + } + } + + for (x = 0; x < 32; x++) { + bytes = sizeof(polycom_packet_t); + switch_socket_sendto(socket, polycom_addr, 0, (void *) polycom_packet, &bytes); + //switch_yield(30000); + } + + polycom_packet->op = 0x10; + + if ((var = switch_channel_get_variable(channel, "esf_multicast_alert_sound"))) { + switch_ivr_displace_session(session, var, 0, "mr"); + } + while (switch_channel_ready(channel)) { status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); @@ -234,26 +450,57 @@ SWITCH_STANDARD_APP(bcast_function) if (!SWITCH_READ_ACCEPTABLE(status)) { break; } + if (switch_test_flag(read_frame, SFF_CNG)) { continue; } - if (ready == SEND_TYPE_RTP) { - short *dbuf; - unsigned char *ebuf; - uint32_t i; - unsigned char encoded_data[4192]; - dbuf = read_frame->data; - ebuf = encoded_data; - - for (i = 0; i < read_frame->datalen / sizeof(short); i++) { - ebuf[i] = linear_to_ulaw(dbuf[i]); + if (ready == SEND_TYPE_RTP) { + unsigned char *ebuf; + unsigned char encoded_data[4192]; + uint32_t encoded_datalen = sizeof(encoded_data); + + if (need_transcode) { + uint32_t rate = codec.implementation->actual_samples_per_second; + uint32_t flag = 0; + + ebuf = encoded_data; + + switch_core_codec_encode(&write_codec, + &codec, + read_frame->data, + read_frame->datalen, + read_impl.actual_samples_per_second, + ebuf, &encoded_datalen, &rate, &flag); + + read_frame->data = encoded_data; + read_frame->datalen = encoded_datalen; + + } else { + ebuf = read_frame->data; + encoded_datalen = read_frame->datalen; } - read_frame->data = encoded_data; - read_frame->datalen = read_frame->datalen / 2; + switch_rtp_write_frame(rtp_session, read_frame); - read_frame->data = dbuf; - read_frame->datalen = read_frame->datalen * 2; + + seq += 160; + + alert_packet->audio_header.seq = htonl(seq); + + if (last_polycom_len) { + memcpy(alert_packet->data, last_polycom_buf, last_polycom_len); + memcpy(alert_packet->data + last_polycom_len, ebuf, encoded_datalen); + } else { + memcpy(alert_packet->data, ebuf, encoded_datalen); + } + + bytes = sizeof(*alert_packet) + encoded_datalen + last_polycom_len; + + switch_socket_sendto(socket, polycom_addr, 0, (void *) polycom_buf, &bytes); + + last_polycom_len = encoded_datalen; + memcpy((void *)last_polycom_buf, (void *)ebuf, last_polycom_len); + } else { bytes = read_frame->packetlen; switch_socket_sendto(socket, audio_addr, 0, read_frame->packet, &bytes); @@ -267,6 +514,16 @@ SWITCH_STANDARD_APP(bcast_function) bytes = 8; switch_socket_sendto(socket, control_packet_addr, 0, (void *) &control_packet, &bytes); + + polycom_packet->op = 0xFF; + //switch_yield(50000); + + for (x = 0; x < 12; x++) { + bytes = sizeof(*polycom_packet); + switch_socket_sendto(socket, polycom_addr, 0, (void *) polycom_packet, &bytes); + //switch_yield(30000); + } + fail: switch_core_session_set_read_codec(session, NULL); @@ -281,6 +538,16 @@ SWITCH_STANDARD_APP(bcast_function) if (socket) { switch_socket_close(socket); } + + if (polycom_socket) { + switch_socket_close(polycom_socket); + } + + if (rtp_port) { + switch_rtp_release_port(source_ip, rtp_port); + } + + dec_serno(); return; } @@ -289,6 +556,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_esf_load) { switch_application_interface_t *app_interface; + switch_mutex_init(&MUTEX, SWITCH_MUTEX_NESTED, pool); + /* 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, "esf_page_group", NULL, NULL, bcast_function, NULL, SAF_NONE); diff --git a/src/switch_apr.c b/src/switch_apr.c index d7717290bd..9773e31b26 100644 --- a/src/switch_apr.c +++ b/src/switch_apr.c @@ -834,6 +834,12 @@ SWITCH_DECLARE(switch_status_t) switch_mcast_loopback(switch_socket_t *sock, uin return apr_mcast_loopback(sock, opt); } +SWITCH_DECLARE(switch_status_t) switch_mcast_interface(switch_socket_t *sock, switch_sockaddr_t *iface) +{ + return apr_mcast_interface(sock, iface); +} + + /* socket functions */ SWITCH_DECLARE(const char *) switch_get_addr(char *buf, switch_size_t len, switch_sockaddr_t *in) diff --git a/src/switch_rtp.c b/src/switch_rtp.c index fab4ddba8a..85a471ac16 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1999,6 +1999,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s { switch_socket_t *new_sock = NULL, *old_sock = NULL; switch_status_t status = SWITCH_STATUS_FALSE; + int j = 0; #ifndef WIN32 char o[5] = "TEST", i[5] = ""; switch_size_t len, ilen = 0; @@ -2057,6 +2058,40 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_s goto done; } + + if ((j = atoi(host)) && j > 223 && j < 240) { /* mcast */ + if (switch_mcast_interface(new_sock, rtp_session->local_addr) != SWITCH_STATUS_SUCCESS) { + *err = "Multicast Socket interface Error"; + goto done; + } + + if (switch_mcast_join(new_sock, rtp_session->local_addr, NULL, NULL) != SWITCH_STATUS_SUCCESS) { + *err = "Multicast Error"; + goto done; + } + + if (rtp_session->session) { + switch_channel_t *channel = switch_core_session_get_channel(rtp_session->session); + const char *var; + + if ((var = switch_channel_get_variable(channel, "multicast_ttl"))) { + int ttl = atoi(var); + + if (ttl > 0 && ttl < 256) { + if (switch_mcast_hops(new_sock, (uint8_t) ttl) != SWITCH_STATUS_SUCCESS) { + *err = "Mutlicast TTL set failed"; + goto done; + } + + } + } + + } + + } + + + #ifndef WIN32 len = sizeof(i); switch_socket_opt_set(new_sock, SWITCH_SO_NONBLOCK, TRUE); From ca8f121977b1eeb6f1707f9b50b1d2455cb3b55b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 04:53:34 +0500 Subject: [PATCH 11/51] fix regression from recent refactor that causes infinite loop on unexpected disconnect --- libs/esl/src/esl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 67b82fbe6d..e8ed39aa68 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -1231,8 +1231,9 @@ static esl_ssize_t handle_recv(esl_handle_t *handle, void *data, esl_size_t data if ((activity & ESL_POLL_ERROR)) { activity = -1; } else if ((activity & ESL_POLL_READ)) { - activity = recv(handle->sock, data, datalen, 0); - if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { + if (!(activity = recv(handle->sock, data, datalen, 0))) { + activity = -1; + } else if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { activity = 0; } } From b8dc07132ab5ebda769dd85353e04947a1c2f561 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 08:55:45 +0500 Subject: [PATCH 12/51] FS-5959 i hate this ticket --- src/switch_core_media.c | 33 ++++++++++++++++++++------------- src/switch_rtp.c | 3 ++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index fdb4043f54..c25c2e5ed1 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -535,6 +535,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se int exists = 0; switch_media_handle_t *smh; switch_rtp_engine_t *engine; + int local_pt = 0; switch_assert(session); @@ -549,12 +550,13 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) { exists = (!strcasecmp(name, pmap->iananame) && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime)); - + if (exists) { if (!zstr(fmtp) && !zstr(pmap->rm_fmtp)) { if (strcmp(pmap->rm_fmtp, fmtp)) { exists = 0; + local_pt = pmap->pt; continue; } } @@ -589,15 +591,18 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se pmap->rate = rate; } - if (!zstr(fmtp) && (!pmap->rm_fmtp || strcmp(pmap->rm_fmtp, fmtp))) { + if (!zstr(fmtp) && (zstr(pmap->rm_fmtp) || strcmp(pmap->rm_fmtp, fmtp))) { pmap->rm_fmtp = switch_core_strdup(session->pool, fmtp); } pmap->allocated = 1; - pmap->recv_pt = (switch_payload_t)pt; + + + pmap->recv_pt = (switch_payload_t) pt; + if (sdp_type == SDP_TYPE_REQUEST || !exists) { - pmap->pt = (switch_payload_t)pt; + pmap->pt = (switch_payload_t) (local_pt ? local_pt : pt); } if (negotiated) { @@ -3290,7 +3295,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s pmap->rm_encoding = switch_core_session_strdup(session, (char *) mmap->rm_encoding); pmap->iananame = switch_core_session_strdup(session, (char *) mimp->iananame); - pmap->pt = (switch_payload_t) mmap->rm_pt; + pmap->recv_pt = (switch_payload_t) mmap->rm_pt; pmap->rm_rate = mimp->samples_per_second; pmap->adv_rm_rate = mimp->samples_per_second; if (strcasecmp(mimp->iananame, "g722")) { @@ -3330,7 +3335,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s if (match) { char tmp[50]; - const char *mirror = switch_channel_get_variable(session->channel, "rtp_mirror_remote_audio_codec_payload"); + //const char *mirror = switch_channel_get_variable(session->channel, "rtp_mirror_remote_audio_codec_payload"); switch_snprintf(tmp, sizeof(tmp), "%d", a_engine->cur_payload_map->remote_sdp_port); @@ -3338,11 +3343,13 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s switch_channel_set_variable(session->channel, SWITCH_REMOTE_MEDIA_PORT_VARIABLE, tmp); +#if 0 if (!switch_true(mirror) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND && (!switch_channel_test_flag(session->channel, CF_REINVITE) || switch_media_handle_test_media_flag(smh, SCMF_RENEG_ON_REINVITE))) { switch_core_media_get_offered_pt(session, matches[0].imp, &a_engine->cur_payload_map->recv_pt); } +#endif switch_snprintf(tmp, sizeof(tmp), "%d", a_engine->cur_payload_map->recv_pt); switch_channel_set_variable(session->channel, "rtp_audio_recv_pt", tmp); @@ -3521,7 +3528,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s if (m_idx) { char tmp[50]; - const char *mirror = switch_channel_get_variable(session->channel, "rtp_mirror_remote_video_codec_payload"); + //const char *mirror = switch_channel_get_variable(session->channel, "rtp_mirror_remote_video_codec_payload"); int j = 0; if (greedy) { /* sort in favor of mine */ @@ -3541,7 +3548,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s matches[j].imp->samples_per_second, matches[j].imp->microseconds_per_packet / 1000, SWITCH_TRUE); - if (j == 0) { v_engine->cur_payload_map = pmap; } @@ -3550,7 +3556,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s map = matches[j].map; pmap->rm_encoding = switch_core_session_strdup(session, (char *) map->rm_encoding); - pmap->pt = (switch_payload_t) map->rm_pt; + pmap->recv_pt = (switch_payload_t) map->rm_pt; pmap->rm_rate = map->rm_rate; pmap->codec_ms = mimp->microseconds_per_packet / 1000; @@ -3562,11 +3568,12 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s pmap->agreed_pt = (switch_payload_t) map->rm_pt; - pmap->recv_pt = (switch_payload_t)map->rm_pt; +#if 0 if (j == 0 && (!switch_true(mirror) && switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_OUTBOUND)) { switch_core_media_get_offered_pt(session, mimp, &pmap->recv_pt); } +#endif } @@ -5117,7 +5124,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi if (v_engine->pli) { switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PLI); } - + switch_rtp_set_payload_map(v_engine->rtp_session, &v_engine->payload_map); start_video_thread(session); @@ -7900,7 +7907,7 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess map->rm_pt, map->rm_rate, ptime, - SWITCH_FALSE); + SWITCH_TRUE); } } } @@ -8287,7 +8294,7 @@ SWITCH_DECLARE (void) switch_core_media_recover_session(switch_core_session_t *s } if ((tmp = switch_channel_get_variable(session->channel, "rtp_video_recv_pt"))) { - v_engine->cur_payload_map->recv_pt = (switch_payload_t)atoi(tmp);; + v_engine->cur_payload_map->recv_pt = (switch_payload_t)atoi(tmp); } v_engine->cur_payload_map->rm_encoding = (char *) switch_channel_get_variable(session->channel, "rtp_use_video_codec_name"); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 85a471ac16..490137e08b 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -4121,6 +4121,7 @@ static int check_recv_payload(switch_rtp_t *rtp_session) if (!pmap->negotiated) { continue; } + if (rtp_session->recv_msg.header.pt == pmap->pt) { ok = 1; } @@ -6242,7 +6243,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra switch_mutex_lock(rtp_session->flag_mutex); for (pmap = *rtp_session->pmaps; pmap; pmap = pmap->next) { - if (pmap->hash == frame->pmap->hash && !strcmp(pmap->iananame, frame->pmap->iananame)) { + if (pmap->negotiated && pmap->hash == frame->pmap->hash) { payload = pmap->recv_pt; break; } From 9c72dc950e3b08c4b987e62a1a02358a319d599b Mon Sep 17 00:00:00 2001 From: Seven Du Date: Fri, 22 Nov 2013 14:23:18 +0800 Subject: [PATCH 13/51] add CF_MEDIA_PAUSE channel flag to allow waiting for IO before media codec is ready This could be used at endpoints where signalling and media negotiated separately like in H323 --- src/include/switch_types.h | 1 + src/switch_core_io.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 0567fd2455..cf6f4c247d 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1362,6 +1362,7 @@ typedef enum { CF_VIDEO_ECHO, CF_SLA_INTERCEPT, CF_VIDEO_BREAK, + CF_MEDIA_PAUSE, /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */ /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */ CF_FLAG_MAX diff --git a/src/switch_core_io.c b/src/switch_core_io.c index 13c15874f4..d571da41b0 100644 --- a/src/switch_core_io.c +++ b/src/switch_core_io.c @@ -26,6 +26,7 @@ * Anthony Minessale II * Michael Jerris * Paul D. Tinsley + * Seven Du * * * switch_core_io.c -- Main Core Library (Media I/O) @@ -45,6 +46,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor return SWITCH_STATUS_FALSE; } + if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) { + return SWITCH_STATUS_SUCCESS; + } + if (session->endpoint_interface->io_routines->write_video_frame) { if ((status = session->endpoint_interface->io_routines->write_video_frame(session, frame, flags, stream_id)) == SWITCH_STATUS_SUCCESS) { for (ptr = session->event_hooks.video_write_frame; ptr; ptr = ptr->next) { @@ -69,6 +74,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core return SWITCH_STATUS_FALSE; } + if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) { + *frame = &runtime.dummy_cng_frame; + switch_yield(20000); + return SWITCH_STATUS_SUCCESS; + } + if (session->endpoint_interface->io_routines->read_video_frame) { if ((status = session->endpoint_interface->io_routines->read_video_frame(session, frame, flags, stream_id)) == SWITCH_STATUS_SUCCESS) { for (ptr = session->event_hooks.video_read_frame; ptr; ptr = ptr->next) { @@ -165,6 +176,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi *frame = &runtime.dummy_cng_frame; return SWITCH_STATUS_SUCCESS; } + + if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) { + switch_yield(20000); + *frame = &runtime.dummy_cng_frame; + // switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Media Paused!!!!\n"); + return SWITCH_STATUS_SUCCESS; + } + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no read codec.\n", switch_channel_get_name(session->channel)); switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); return SWITCH_STATUS_FALSE; @@ -1033,6 +1052,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess } } + if (switch_channel_test_flag(session->channel, CF_MEDIA_PAUSE)) { + return SWITCH_STATUS_SUCCESS; + } + if (!(session->write_codec && switch_core_codec_ready(session->write_codec)) && !pass_cng) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel)); switch_channel_hangup(session->channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION); From 3a0f93478827e76012ff1a853254db71460bc16d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 18:52:21 +0500 Subject: [PATCH 14/51] revert one change --- src/switch_core_media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index c25c2e5ed1..25af9b4e29 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -7907,7 +7907,7 @@ static void switch_core_media_set_r_sdp_codec_string(switch_core_session_t *sess map->rm_pt, map->rm_rate, ptime, - SWITCH_TRUE); + SWITCH_FALSE); } } } From 4129adc9ac94003d5c24cfedb993c5831a9ec9a7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 22:21:32 +0500 Subject: [PATCH 15/51] update more fields on re-subscribe --- src/mod/endpoints/mod_sofia/sofia_presence.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index ef28993d89..6f72d1d51b 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3772,9 +3772,12 @@ void sofia_presence_handle_sip_i_subscribe(int status, sstr = switch_mprintf("active;expires=%ld", exp_delta); sql = switch_mprintf("update sip_subscriptions " - "set expires=%ld " + "set expires=%ld, " + "network_ip='%q',network_port='%q',sip_user='%q',sip_host='%q',full_via='%q',full_to='%q',full_from='%q',contact='%q' " "where call_id='%q' and profile_name='%q' and hostname='%q'", (long) switch_epoch_time_now(NULL) + exp_delta, + np.network_ip, np.network_port, from_user, from_host, full_via, full_to, full_from, contact_str, + call_id, profile->name, mod_sofia_globals.hostname); if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) { From 726b607667c0c1aea6280f04ded4d183a65bb95b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 22:52:59 +0500 Subject: [PATCH 16/51] FS-5841 --resolve --- .../mod_voicemail/mod_voicemail.c | 8 +-- src/switch_xml.c | 68 ++++++++++++------- 2 files changed, 47 insertions(+), 29 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 6f2e5d68c9..3d41f90c51 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1724,7 +1724,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS); switch_assert(my_params); - status = switch_xml_locate_user_merged("id", vm_cc, cbt->domain, NULL, &x_user, my_params); + status = switch_xml_locate_user_merged("id:number-alias", vm_cc, cbt->domain, NULL, &x_user, my_params); switch_event_destroy(&my_params); if (status != SWITCH_STATUS_SUCCESS) { @@ -2440,7 +2440,7 @@ static void voicemail_check_main(switch_core_session_t *session, vm_profile_t *p switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "destination_number", caller_profile->destination_number); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "caller_id_number", caller_id_number); - if (switch_xml_locate_user_merged("id", myid, domain_name, switch_channel_get_variable(channel, "network_addr"), + if (switch_xml_locate_user_merged("id:number-alias", myid, domain_name, switch_channel_get_variable(channel, "network_addr"), &x_user, params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", myid, domain_name); ok = 0; @@ -3388,7 +3388,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p switch_assert(locate_params); switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "action", "voicemail-lookup"); - if (switch_xml_locate_user_merged("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"), + if (switch_xml_locate_user_merged("id:number-alias", id, domain_name, switch_channel_get_variable(channel, "network_addr"), &x_user, locate_params) == SWITCH_STATUS_SUCCESS) { id = switch_core_session_strdup(session, switch_xml_attr(x_user, "id")); @@ -5689,7 +5689,7 @@ SWITCH_STANDARD_API(vm_fsdb_auth_login_function) } switch_event_create(¶ms, SWITCH_EVENT_GENERAL); - if (switch_xml_locate_user_merged("id", id, domain, NULL, &x_user, params) != SWITCH_STATUS_SUCCESS) { + if (switch_xml_locate_user_merged("id:number-alias", id, domain, NULL, &x_user, params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Can't find user [%s@%s]\n", id, domain); stream->write_function(stream, "-ERR User not found\n"); } else { diff --git a/src/switch_xml.c b/src/switch_xml.c index 81ec0609b8..d1a9a1ca61 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -2044,34 +2044,52 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_merged(const char *key, c { switch_xml_t xml, domain, group, x_user, x_user_dup; switch_status_t status = SWITCH_STATUS_FALSE; + char *kdup = NULL; + char *keys[10] = {0}; + int i, nkeys; - if ((status = switch_xml_locate_user_cache(key, user_name, domain_name, &x_user)) == SWITCH_STATUS_SUCCESS) { - *user = x_user; - } else if ((status = switch_xml_locate_user(key, user_name, domain_name, ip, &xml, &domain, &x_user, &group, params)) == SWITCH_STATUS_SUCCESS) { - const char *cacheable = NULL; - - x_user_dup = switch_xml_dup(x_user); - switch_xml_merge_user(x_user_dup, domain, group); - - cacheable = switch_xml_attr(x_user_dup, "cacheable"); - if (switch_true(cacheable)) { - switch_time_t expires = 0; - switch_time_t time_now = 0; - - if (switch_is_number(cacheable)) { - int cache_ms = atol(cacheable); - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "caching lookup for user %s@%s for %d milliseconds\n", user_name, domain_name, cache_ms); - time_now = switch_micro_time_now(); - expires = time_now + (cache_ms * 1000); - } else { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "caching lookup for user %s@%s indefinitely\n", user_name, domain_name); - } - switch_xml_user_cache(key, user_name, domain_name, x_user_dup, expires); - } - *user = x_user_dup; - switch_xml_free(xml); + if (strchr(key, ':')) { + kdup = strdup(key); + nkeys = switch_split(kdup, ':', keys); + } else { + keys[0] = (char *)key; + nkeys = 1; } + for(i = 0; i < nkeys; i++) { + if ((status = switch_xml_locate_user_cache(keys[i], user_name, domain_name, &x_user)) == SWITCH_STATUS_SUCCESS) { + *user = x_user; + break; + } else if ((status = switch_xml_locate_user(keys[i], user_name, domain_name, ip, &xml, &domain, &x_user, &group, params)) == SWITCH_STATUS_SUCCESS) { + const char *cacheable = NULL; + + x_user_dup = switch_xml_dup(x_user); + switch_xml_merge_user(x_user_dup, domain, group); + + cacheable = switch_xml_attr(x_user_dup, "cacheable"); + if (switch_true(cacheable)) { + switch_time_t expires = 0; + switch_time_t time_now = 0; + + if (switch_is_number(cacheable)) { + int cache_ms = atol(cacheable); + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "caching lookup for user %s@%s for %d milliseconds\n", + user_name, domain_name, cache_ms); + time_now = switch_micro_time_now(); + expires = time_now + (cache_ms * 1000); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "caching lookup for user %s@%s indefinitely\n", user_name, domain_name); + } + switch_xml_user_cache(keys[i], user_name, domain_name, x_user_dup, expires); + } + *user = x_user_dup; + switch_xml_free(xml); + break; + } + } + + switch_safe_free(kdup); + return status; } From 94939d1bff7b6f9e3b2a7bfcd238fdd9cb5f6bf1 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 01:12:24 +0500 Subject: [PATCH 17/51] add nomux flag when playing to a member to block other audio --- .../mod_conference/mod_conference.c | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 1564b1898d..cc3003b0cc 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -273,6 +273,7 @@ typedef struct conference_file_node { uint32_t leadin; struct conference_file_node *next; char *file; + switch_bool_t mux; } conference_file_node_t; typedef enum { @@ -540,7 +541,7 @@ static void launch_conference_video_thread(conference_obj_t *conference); static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj); static switch_status_t conference_local_play_file(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf, uint32_t buflen); -static switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin); +static switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin, switch_bool_t mux); static switch_status_t conference_member_say(conference_member_t *member, char *text, uint32_t leadin); static uint32_t conference_member_stop_file(conference_member_t *member, file_stop_t stop); static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_core_session_t *session, switch_memory_pool_t *pool); @@ -3160,7 +3161,7 @@ static void conference_loop_fn_energy_up(conference_member_t *member, caller_con switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } @@ -3192,7 +3193,7 @@ static void conference_loop_fn_energy_equ_conf(conference_member_t *member, call switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } } @@ -3224,7 +3225,7 @@ static void conference_loop_fn_energy_dn(conference_member_t *member, caller_con switch_snprintf(str, sizeof(str), "%d", abs(member->energy_level) / 200); for (p = str; p && *p; p++) { switch_snprintf(msg, sizeof(msg), "digits/%c.wav", *p); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } } @@ -3253,11 +3254,11 @@ static void conference_loop_fn_volume_talk_up(conference_member_t *member, calle if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } @@ -3285,11 +3286,11 @@ static void conference_loop_fn_volume_talk_zero(conference_member_t *member, cal if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } static void conference_loop_fn_volume_talk_dn(conference_member_t *member, caller_control_action_t *action) @@ -3316,11 +3317,11 @@ static void conference_loop_fn_volume_talk_dn(conference_member_t *member, calle if (member->volume_out_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_out_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_out_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } static void conference_loop_fn_volume_listen_up(conference_member_t *member, caller_control_action_t *action) @@ -3347,11 +3348,11 @@ static void conference_loop_fn_volume_listen_up(conference_member_t *member, cal if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } @@ -3378,11 +3379,11 @@ static void conference_loop_fn_volume_listen_zero(conference_member_t *member, c if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } @@ -3410,11 +3411,11 @@ static void conference_loop_fn_volume_listen_dn(conference_member_t *member, cal if (member->volume_in_level < 0) { switch_snprintf(msg, sizeof(msg), "currency/negative.wav", member->volume_in_level); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } switch_snprintf(msg, sizeof(msg), "digits/%d.wav", abs(member->volume_in_level)); - conference_member_play_file(member, msg, 0); + conference_member_play_file(member, msg, 0, SWITCH_TRUE); } static void conference_loop_fn_event(conference_member_t *member, caller_control_action_t *action) @@ -4000,9 +4001,13 @@ static void member_add_file_data(conference_member_t *member, int16_t *data, swi } for (i = 0; i < file_sample_len; i++) { - sample = data[i] + file_frame[i]; - switch_normalize_to_16bit(sample); - data[i] = sample; + if (member->fnode->mux) { + sample = data[i] + file_frame[i]; + switch_normalize_to_16bit(sample); + data[i] = sample; + } else { + data[i] = file_frame[i]; + } } } @@ -4162,7 +4167,7 @@ static void conference_loop_output(conference_member_t *member) goto end; } - conference_member_play_file(member, "tone_stream://%(500,0,640)", 0); + conference_member_play_file(member, "tone_stream://%(500,0,640)", 0, SWITCH_TRUE); } if (!switch_test_flag(member->conference, CFLAG_ANSWERED)) { @@ -4324,7 +4329,7 @@ static void conference_loop_output(conference_member_t *member) if (switch_test_flag(member, MFLAG_INDICATE_MUTE)) { if (!zstr(member->conference->muted_sound)) { - conference_member_play_file(member, member->conference->muted_sound, 0); + conference_member_play_file(member, member->conference->muted_sound, 0, SWITCH_TRUE); } else { char msg[512]; @@ -4336,7 +4341,7 @@ static void conference_loop_output(conference_member_t *member) if (switch_test_flag(member, MFLAG_INDICATE_MUTE_DETECT)) { if (!zstr(member->conference->mute_detect_sound)) { - conference_member_play_file(member, member->conference->mute_detect_sound, 0); + conference_member_play_file(member, member->conference->mute_detect_sound, 0, SWITCH_TRUE); } else { char msg[512]; @@ -4348,7 +4353,7 @@ static void conference_loop_output(conference_member_t *member) if (switch_test_flag(member, MFLAG_INDICATE_UNMUTE)) { if (!zstr(member->conference->unmuted_sound)) { - conference_member_play_file(member, member->conference->unmuted_sound, 0); + conference_member_play_file(member, member->conference->unmuted_sound, 0, SWITCH_TRUE); } else { char msg[512]; @@ -4850,7 +4855,7 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char * } /* Play a file in the conference room to a member */ -static switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin) +static switch_status_t conference_member_play_file(conference_member_t *member, char *file, uint32_t leadin, switch_bool_t mux) { switch_status_t status = SWITCH_STATUS_FALSE; char *dfile = NULL, *expanded = NULL; @@ -4897,6 +4902,8 @@ static switch_status_t conference_member_play_file(conference_member_t *member, } fnode->type = NODE_TYPE_FILE; fnode->leadin = leadin; + fnode->mux = mux; + /* Open the file */ fnode->fh.pre_buffer_datalen = SWITCH_DEFAULT_FILE_BUFFER_LEN; if (switch_core_file_open(&fnode->fh, @@ -6234,12 +6241,17 @@ static switch_status_t conf_api_sub_play(conference_obj_t *conference, switch_st stream->write_function(stream, "(play) File: %s not found.\n", argv[2] ? argv[2] : "(unspecified)"); } ret_status = SWITCH_STATUS_SUCCESS; - } else if (argc == 4) { + } else if (argc >= 4) { uint32_t id = atoi(argv[3]); conference_member_t *member; + switch_bool_t mux = SWITCH_TRUE; + + if (argc > 4 && !strcasecmp(argv[4], "nomux")) { + mux = SWITCH_FALSE; + } if ((member = conference_member_get(conference, id))) { - if (conference_member_play_file(member, argv[2], 0) == SWITCH_STATUS_SUCCESS) { + if (conference_member_play_file(member, argv[2], 0, mux) == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "(play) Playing file %s to member %u\n", argv[2], id); if (test_eflag(conference, EFLAG_PLAY_FILE_MEMBER) && switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { @@ -7040,7 +7052,7 @@ static api_command_t conf_api_sub_commands[] = { {"energy", (void_fn_t) & conf_api_sub_energy, CONF_API_SUB_MEMBER_TARGET, "energy", " []"}, {"volume_in", (void_fn_t) & conf_api_sub_volume_in, CONF_API_SUB_MEMBER_TARGET, "volume_in", " []"}, {"volume_out", (void_fn_t) & conf_api_sub_volume_out, CONF_API_SUB_MEMBER_TARGET, "volume_out", " []"}, - {"play", (void_fn_t) & conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async|]"}, + {"play", (void_fn_t) & conf_api_sub_play, CONF_API_SUB_ARGS_SPLIT, "play", " [async| [nomux]]"}, {"pause_play", (void_fn_t) & conf_api_sub_pause_play, CONF_API_SUB_ARGS_SPLIT, "pause", ""}, {"file_seek", (void_fn_t) & conf_api_sub_file_seek, CONF_API_SUB_ARGS_SPLIT, "file_seek", "[+-]"}, {"say", (void_fn_t) & conf_api_sub_say, CONF_API_SUB_ARGS_AS_ONE, "say", ""}, From c7f00c3e21cf628acd818167caaba8b88e6bfad6 Mon Sep 17 00:00:00 2001 From: Eliot Gable Date: Fri, 22 Nov 2013 20:13:49 +0000 Subject: [PATCH 18/51] Add queue talk time and hold time stats to consumer and caller stop events. --- src/mod/applications/mod_fifo/mod_fifo.c | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index e5c12c0998..4ba7b01f78 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -2244,6 +2244,10 @@ static void dec_use_count(switch_core_session_t *session, const char *type) if (type) { if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) { + uint64_t hold_usec = 0, tt_usec = 0; + switch_caller_profile_t *originator_cp = NULL; + + originator_cp = switch_channel_get_caller_profile(channel); switch_channel_event_set_data(channel, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", MANUAL_QUEUE_NAME); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "channel-consumer-stop"); @@ -2252,6 +2256,18 @@ static void dec_use_count(switch_core_session_t *session, const char *type) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Outbound-ID", outbound_id); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Use-Count", "%d", fifo_get_use_count(outbound_id)); } + hold_usec = originator_cp->times->hold_accum; + tt_usec = (switch_micro_time_now() - originator_cp->times->bridged) - hold_usec; + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%lu", originator_cp->times->bridged); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%lu", (uint64_t)(originator_cp->times->bridged / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%lu", (uint64_t)(originator_cp->times->bridged / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%lu", tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%lu", hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); + switch_event_fire(&event); } } @@ -3260,6 +3276,7 @@ SWITCH_STANDARD_APP(fifo_function) if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) { + uint64_t hold_usec = 0, tt_usec = 0; switch_channel_event_set_data(channel, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", arg_fifo_name); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "channel-consumer-stop"); @@ -3268,6 +3285,18 @@ SWITCH_STANDARD_APP(fifo_function) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Outbound-ID", outbound_id); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Use-Count", "%d", fifo_get_use_count(outbound_id)); } + hold_usec = originator_cp->times->hold_accum; + tt_usec = (switch_micro_time_now() - originator_cp->times->bridged) - hold_usec; + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%lu", originator_cp->times->bridged); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%lu", (uint64_t)(originator_cp->times->bridged / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%lu", (uint64_t)(originator_cp->times->bridged / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%lu", tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%lu", hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); + switch_event_fire(&event); } @@ -3286,9 +3315,18 @@ SWITCH_STANDARD_APP(fifo_function) switch_event_fire(&event); } if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, FIFO_EVENT) == SWITCH_STATUS_SUCCESS) { + uint64_t hold_usec = 0, tt_usec = 0; switch_channel_event_set_data(other_channel, event); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Name", argv[0]); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "bridge-caller-stop"); + hold_usec = originatee_cp->times->hold_accum; + tt_usec = (switch_micro_time_now() - originatee_cp->times->bridged) - hold_usec; + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-us", "%lu", tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-us", "%lu", hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); switch_event_fire(&event); } From 8015a3a0a6b514886310ecd37e0d1833d5833b62 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 02:32:02 +0500 Subject: [PATCH 19/51] fix typo that caused a seg in presesnce --- src/mod/endpoints/mod_sofia/sofia_presence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 6f72d1d51b..90f251dfb9 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3773,10 +3773,10 @@ void sofia_presence_handle_sip_i_subscribe(int status, sql = switch_mprintf("update sip_subscriptions " "set expires=%ld, " - "network_ip='%q',network_port='%q',sip_user='%q',sip_host='%q',full_via='%q',full_to='%q',full_from='%q',contact='%q' " + "network_ip='%q',network_port='%d',sip_user='%q',sip_host='%q',full_via='%q',full_to='%q;tag=%q',full_from='%q',contact='%q' " "where call_id='%q' and profile_name='%q' and hostname='%q'", (long) switch_epoch_time_now(NULL) + exp_delta, - np.network_ip, np.network_port, from_user, from_host, full_via, full_to, full_from, contact_str, + np.network_ip, np.network_port, from_user, from_host, full_via, full_to, use_to_tag, full_from, contact_str, call_id, profile->name, mod_sofia_globals.hostname); From 882b82aa91c5aedfcdc79616d4c91f70f26d11b5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 02:53:05 +0500 Subject: [PATCH 20/51] pass callee_id on early --- src/switch_ivr_originate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index b30df42a98..a284bfc036 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -3478,6 +3478,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess if (switch_channel_test_flag(caller_channel, CF_PROXY_MODE)) { status = SWITCH_STATUS_SUCCESS; } else { + switch_channel_pass_callee_id(peer_channel, caller_channel); status = switch_channel_pre_answer(caller_channel); } } else { From b64cbe33b4f132ef9621e62e9c5cd6ee51d0d129 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 22 Nov 2013 16:21:41 -0600 Subject: [PATCH 21/51] swigall --- .../languages/mod_managed/freeswitch_wrap.cxx | 719 +++++++++++++++++- src/mod/languages/mod_managed/managed/swig.cs | 560 +++++++++++++- 2 files changed, 1255 insertions(+), 24 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 2c57e207a4..4d4750877c 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -6967,6 +6967,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_node_t_hup_profile_get(void * } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_node_t_direction_set(void * jarg1, int jarg2) { + switch_device_node_t *arg1 = (switch_device_node_t *) 0 ; + switch_call_direction_t arg2 ; + + arg1 = (switch_device_node_t *)jarg1; + arg2 = (switch_call_direction_t)jarg2; + if (arg1) (arg1)->direction = arg2; + +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_device_node_t_direction_get(void * jarg1) { + int jresult ; + switch_device_node_t *arg1 = (switch_device_node_t *) 0 ; + switch_call_direction_t result; + + arg1 = (switch_device_node_t *)jarg1; + result = (switch_call_direction_t) ((arg1)->direction); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_node_t_parent_set(void * jarg1, void * jarg2) { switch_device_node_t *arg1 = (switch_device_node_t *) 0 ; switch_device_record_s *arg2 = (switch_device_record_s *) 0 ; @@ -7055,6 +7078,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_total_get(void } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_total_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->total_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_total_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->total_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_total_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->total_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_total_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->total_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_offhook_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7078,6 +7147,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_offhook_get(vo } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_offhook_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->offhook_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_offhook_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->offhook_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_offhook_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->offhook_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_offhook_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->offhook_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_active_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7101,6 +7216,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_active_get(voi } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_active_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->active_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_active_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->active_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_active_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->active_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_active_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->active_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_held_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7124,6 +7285,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_held_get(void } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_held_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->held_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_held_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->held_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_held_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->held_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_held_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->held_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_hup_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7147,6 +7354,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_hup_get(void * } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_hup_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->hup_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_hup_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->hup_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_hup_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->hup_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_hup_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->hup_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_ringing_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7170,6 +7423,52 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_ringing_get(vo } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_ringing_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->ringing_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_ringing_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->ringing_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_ringing_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->ringing_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_ringing_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->ringing_out); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_early_set(void * jarg1, unsigned long jarg2) { switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; uint32_t arg2 ; @@ -7193,6 +7492,75 @@ SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_early_get(void } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_early_in_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->early_in = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_early_in_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->early_in); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_early_out_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->early_out = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_early_out_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->early_out); + jresult = (unsigned long)result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_stats_t_ring_wait_set(void * jarg1, unsigned long jarg2) { + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t arg2 ; + + arg1 = (switch_device_stats_t *)jarg1; + arg2 = (uint32_t)jarg2; + if (arg1) (arg1)->ring_wait = arg2; + +} + + +SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_device_stats_t_ring_wait_get(void * jarg1) { + unsigned long jresult ; + switch_device_stats_t *arg1 = (switch_device_stats_t *) 0 ; + uint32_t result; + + arg1 = (switch_device_stats_t *)jarg1; + result = (uint32_t) ((arg1)->ring_wait); + jresult = (unsigned long)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_device_stats_t() { void * jresult ; switch_device_stats_t *result = 0 ; @@ -7318,6 +7686,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_stats_get(void * jar } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_last_stats_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_device_stats_t *arg2 = (switch_device_stats_t *) 0 ; + + arg1 = (switch_device_record_t *)jarg1; + arg2 = (switch_device_stats_t *)jarg2; + if (arg1) (arg1)->last_stats = *arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_last_stats_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_device_stats_t *result = 0 ; + + arg1 = (switch_device_record_t *)jarg1; + result = (switch_device_stats_t *)& ((arg1)->last_stats); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_state_set(void * jarg1, int jarg2) { switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; switch_device_state_t arg2 ; @@ -7451,6 +7842,151 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_last_call_time_get(v } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_ring_start_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t arg2 ; + switch_time_t *argp2 ; + + arg1 = (switch_device_record_t *)jarg1; + argp2 = (switch_time_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_time_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->ring_start = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_ring_start_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t result; + + arg1 = (switch_device_record_t *)jarg1; + result = ((arg1)->ring_start); + jresult = new switch_time_t((switch_time_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_ring_stop_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t arg2 ; + switch_time_t *argp2 ; + + arg1 = (switch_device_record_t *)jarg1; + argp2 = (switch_time_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_time_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->ring_stop = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_ring_stop_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t result; + + arg1 = (switch_device_record_t *)jarg1; + result = ((arg1)->ring_stop); + jresult = new switch_time_t((switch_time_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_hold_start_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t arg2 ; + switch_time_t *argp2 ; + + arg1 = (switch_device_record_t *)jarg1; + argp2 = (switch_time_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_time_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->hold_start = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_hold_start_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t result; + + arg1 = (switch_device_record_t *)jarg1; + result = ((arg1)->hold_start); + jresult = new switch_time_t((switch_time_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_hold_stop_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t arg2 ; + switch_time_t *argp2 ; + + arg1 = (switch_device_record_t *)jarg1; + argp2 = (switch_time_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_time_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->hold_stop = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_hold_stop_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t result; + + arg1 = (switch_device_record_t *)jarg1; + result = ((arg1)->hold_stop); + jresult = new switch_time_t((switch_time_t &)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_call_start_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t arg2 ; + switch_time_t *argp2 ; + + arg1 = (switch_device_record_t *)jarg1; + argp2 = (switch_time_t *)jarg2; + if (!argp2) { + SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_time_t", 0); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->call_start = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_call_start_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + switch_time_t result; + + arg1 = (switch_device_record_t *)jarg1; + result = ((arg1)->call_start); + jresult = new switch_time_t((switch_time_t &)result); + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_uuid_list_set(void * jarg1, void * jarg2) { switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; device_uuid_node_s *arg2 = (device_uuid_node_s *) 0 ; @@ -7543,6 +8079,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_pool_get(void * jarg } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_device_record_t_user_data_set(void * jarg1, void * jarg2) { + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + void *arg2 = (void *) 0 ; + + arg1 = (switch_device_record_t *)jarg1; + arg2 = (void *)jarg2; + if (arg1) (arg1)->user_data = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_device_record_t_user_data_get(void * jarg1) { + void * jresult ; + switch_device_record_t *arg1 = (switch_device_record_t *) 0 ; + void *result = 0 ; + + arg1 = (switch_device_record_t *)jarg1; + result = (void *) ((arg1)->user_data); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_device_record_t() { void * jresult ; switch_device_record_t *result = 0 ; @@ -12579,9 +13138,9 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_time_set_monotonic(int jarg1) { SWIGEXPORT void SWIGSTDCALL CSharp_switch_time_set_timerfd(int jarg1) { - switch_bool_t arg1 ; + int arg1 ; - arg1 = (switch_bool_t)jarg1; + arg1 = (int)jarg1; switch_time_set_timerfd(arg1); } @@ -14059,6 +14618,14 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ice_direction(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_session_debug_pool(void * jarg1) { + switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ; + + arg1 = (switch_stream_handle_t *)jarg1; + switch_core_session_debug_pool(arg1); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) { switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ; char *arg2 = (char *) 0 ; @@ -18098,6 +18665,29 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_caller_profile_direction_get(void * jar } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_logical_direction_set(void * jarg1, int jarg2) { + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_call_direction_t arg2 ; + + arg1 = (switch_caller_profile *)jarg1; + arg2 = (switch_call_direction_t)jarg2; + if (arg1) (arg1)->logical_direction = arg2; + +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_caller_profile_logical_direction_get(void * jarg1) { + int jresult ; + switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; + switch_call_direction_t result; + + arg1 = (switch_caller_profile *)jarg1; + result = (switch_call_direction_t) ((arg1)->logical_direction); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_caller_profile_soft_set(void * jarg1, void * jarg2) { switch_caller_profile *arg1 = (switch_caller_profile *) 0 ; profile_node_t *arg2 = (profile_node_t *) 0 ; @@ -19101,6 +19691,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_frame_user_data_get(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_frame_pmap_set(void * jarg1, void * jarg2) { + switch_frame *arg1 = (switch_frame *) 0 ; + payload_map_t *arg2 = (payload_map_t *) 0 ; + + arg1 = (switch_frame *)jarg1; + arg2 = (payload_map_t *)jarg2; + if (arg1) (arg1)->pmap = arg2; + +} + + +SWIGEXPORT void * SWIGSTDCALL CSharp_switch_frame_pmap_get(void * jarg1) { + void * jresult ; + switch_frame *arg1 = (switch_frame *) 0 ; + payload_map_t *result = 0 ; + + arg1 = (switch_frame *)jarg1; + result = (payload_map_t *) ((arg1)->pmap); + jresult = (void *)result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_frame() { void * jresult ; switch_frame *result = 0 ; @@ -29824,6 +30437,18 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_direction(void * jarg1) { } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_logical_direction(void * jarg1) { + int jresult ; + switch_channel_t *arg1 = (switch_channel_t *) 0 ; + switch_call_direction_t result; + + arg1 = (switch_channel_t *)jarg1; + result = (switch_call_direction_t)switch_channel_logical_direction(arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_direction(void * jarg1, int jarg2) { switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_call_direction_t arg2 ; @@ -32169,6 +32794,72 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_live_array_parse_json(void * jarg1, un } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_live_array_add_alias(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_live_array_t *arg1 = (switch_live_array_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_bool_t result; + + arg1 = (switch_live_array_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_bool_t)switch_live_array_add_alias(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_live_array_clear_alias(void * jarg1, char * jarg2, char * jarg3) { + int jresult ; + switch_live_array_t *arg1 = (switch_live_array_t *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + switch_bool_t result; + + arg1 = (switch_live_array_t *)jarg1; + arg2 = (char *)jarg2; + arg3 = (char *)jarg3; + result = (switch_bool_t)switch_live_array_clear_alias(arg1,(char const *)arg2,(char const *)arg3); + jresult = result; + return jresult; +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_channel_permission_verify(char * jarg1, char * jarg2) { + int jresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + switch_bool_t result; + + arg1 = (char *)jarg1; + arg2 = (char *)jarg2; + result = (switch_bool_t)switch_event_channel_permission_verify((char const *)arg1,(char const *)arg2); + jresult = result; + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_event_channel_permission_modify(char * jarg1, char * jarg2, int jarg3) { + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + switch_bool_t arg3 ; + + arg1 = (char *)jarg1; + arg2 = (char *)jarg2; + arg3 = (switch_bool_t)jarg3; + switch_event_channel_permission_modify((char const *)arg1,(char const *)arg2,arg3); +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_event_channel_permission_clear(char * jarg1) { + char *arg1 = (char *) 0 ; + + arg1 = (char *)jarg1; + switch_event_channel_permission_clear((char const *)arg1); +} + + SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RESAMPLE_QUALITY_get() { int jresult ; int result; @@ -36923,16 +37614,6 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_telephony_recv_event(void * ja } -SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_recv_pt(void * jarg1, unsigned char jarg2) { - switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; - switch_payload_t arg2 ; - - arg1 = (switch_rtp_t *)jarg1; - arg2 = (switch_payload_t)jarg2; - switch_rtp_set_recv_pt(arg1,arg2); -} - - SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_cng_pt(void * jarg1, unsigned char jarg2) { switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; switch_payload_t arg2 ; @@ -36955,6 +37636,20 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_rtp_get_private(void * jarg1) { } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_set_payload_map(void * jarg1, void * jarg2) { + int jresult ; + switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; + payload_map_t **arg2 = (payload_map_t **) 0 ; + switch_status_t result; + + arg1 = (switch_rtp_t *)jarg1; + arg2 = (payload_map_t **)jarg2; + result = (switch_status_t)switch_rtp_set_payload_map(arg1,arg2); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_intentional_bugs(void * jarg1, int jarg2) { switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; switch_rtp_bug_flag_t arg2 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 50ac5a3245..46c72e92d2 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -2749,8 +2749,8 @@ public class freeswitch { freeswitchPINVOKE.switch_time_set_monotonic((int)enable); } - public static void switch_time_set_timerfd(switch_bool_t enable) { - freeswitchPINVOKE.switch_time_set_timerfd((int)enable); + public static void switch_time_set_timerfd(int enable) { + freeswitchPINVOKE.switch_time_set_timerfd(enable); } public static void switch_time_set_nanosleep(switch_bool_t enable) { @@ -3146,6 +3146,10 @@ public class freeswitch { return ret; } + public static void switch_core_session_debug_pool(switch_stream_handle stream) { + freeswitchPINVOKE.switch_core_session_debug_pool(switch_stream_handle.getCPtr(stream)); + } + public static switch_status_t switch_loadable_module_init(switch_bool_t autoload) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init((int)autoload); return ret; @@ -4581,6 +4585,11 @@ public class freeswitch { return ret; } + public static switch_call_direction_t switch_channel_logical_direction(SWIGTYPE_p_switch_channel channel) { + switch_call_direction_t ret = (switch_call_direction_t)freeswitchPINVOKE.switch_channel_logical_direction(SWIGTYPE_p_switch_channel.getCPtr(channel)); + return ret; + } + public static void switch_channel_set_direction(SWIGTYPE_p_switch_channel channel, switch_call_direction_t direction) { freeswitchPINVOKE.switch_channel_set_direction(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)direction); } @@ -5129,6 +5138,29 @@ public class freeswitch { freeswitchPINVOKE.switch_live_array_parse_json(SWIGTYPE_p_cJSON.getCPtr(json), channel_id); } + public static switch_bool_t switch_live_array_add_alias(SWIGTYPE_p_switch_live_array_s la, string event_channel, string name) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_live_array_add_alias(SWIGTYPE_p_switch_live_array_s.getCPtr(la), event_channel, name); + return ret; + } + + public static switch_bool_t switch_live_array_clear_alias(SWIGTYPE_p_switch_live_array_s la, string event_channel, string name) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_live_array_clear_alias(SWIGTYPE_p_switch_live_array_s.getCPtr(la), event_channel, name); + return ret; + } + + public static switch_bool_t switch_event_channel_permission_verify(string cookie, string event_channel) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_event_channel_permission_verify(cookie, event_channel); + return ret; + } + + public static void switch_event_channel_permission_modify(string cookie, string event_channel, switch_bool_t set) { + freeswitchPINVOKE.switch_event_channel_permission_modify(cookie, event_channel, (int)set); + } + + public static void switch_event_channel_permission_clear(string cookie) { + freeswitchPINVOKE.switch_event_channel_permission_clear(cookie); + } + public static switch_status_t switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t new_resampler, uint from_rate, uint to_rate, uint to_size, int quality, uint channels, string file, string func, int line) { switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_resample_perform_create(SWIGTYPE_p_p_switch_audio_resampler_t.getCPtr(new_resampler), from_rate, to_rate, to_size, quality, channels, file, func, line); return ret; @@ -6197,10 +6229,6 @@ public class freeswitch { freeswitchPINVOKE.switch_rtp_set_telephony_recv_event(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), te); } - public static void switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) { - freeswitchPINVOKE.switch_rtp_set_recv_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt); - } - public static void switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp rtp_session, byte pt) { freeswitchPINVOKE.switch_rtp_set_cng_pt(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), pt); } @@ -6211,6 +6239,11 @@ public class freeswitch { return ret; } + public static switch_status_t switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp rtp_session, SWIGTYPE_p_p_payload_map_t pmap) { + switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_payload_map(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), SWIGTYPE_p_p_payload_map_t.getCPtr(pmap)); + return ret; + } + public static void switch_rtp_intentional_bugs(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_bug_flag_t bugs) { freeswitchPINVOKE.switch_rtp_intentional_bugs(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)bugs); } @@ -8903,6 +8936,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_device_node_t_hup_profile_get")] public static extern IntPtr switch_device_node_t_hup_profile_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_node_t_direction_set")] + public static extern void switch_device_node_t_direction_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_node_t_direction_get")] + public static extern int switch_device_node_t_direction_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_node_t_parent_set")] public static extern void switch_device_node_t_parent_set(HandleRef jarg1, HandleRef jarg2); @@ -8927,42 +8966,132 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_total_get")] public static extern uint switch_device_stats_t_total_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_total_in_set")] + public static extern void switch_device_stats_t_total_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_total_in_get")] + public static extern uint switch_device_stats_t_total_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_total_out_set")] + public static extern void switch_device_stats_t_total_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_total_out_get")] + public static extern uint switch_device_stats_t_total_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_set")] public static extern void switch_device_stats_t_offhook_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_get")] public static extern uint switch_device_stats_t_offhook_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_in_set")] + public static extern void switch_device_stats_t_offhook_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_in_get")] + public static extern uint switch_device_stats_t_offhook_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_out_set")] + public static extern void switch_device_stats_t_offhook_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_offhook_out_get")] + public static extern uint switch_device_stats_t_offhook_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_set")] public static extern void switch_device_stats_t_active_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_get")] public static extern uint switch_device_stats_t_active_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_in_set")] + public static extern void switch_device_stats_t_active_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_in_get")] + public static extern uint switch_device_stats_t_active_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_out_set")] + public static extern void switch_device_stats_t_active_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_active_out_get")] + public static extern uint switch_device_stats_t_active_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_set")] public static extern void switch_device_stats_t_held_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_get")] public static extern uint switch_device_stats_t_held_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_in_set")] + public static extern void switch_device_stats_t_held_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_in_get")] + public static extern uint switch_device_stats_t_held_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_out_set")] + public static extern void switch_device_stats_t_held_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_held_out_get")] + public static extern uint switch_device_stats_t_held_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_set")] public static extern void switch_device_stats_t_hup_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_get")] public static extern uint switch_device_stats_t_hup_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_in_set")] + public static extern void switch_device_stats_t_hup_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_in_get")] + public static extern uint switch_device_stats_t_hup_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_out_set")] + public static extern void switch_device_stats_t_hup_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_hup_out_get")] + public static extern uint switch_device_stats_t_hup_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_set")] public static extern void switch_device_stats_t_ringing_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_get")] public static extern uint switch_device_stats_t_ringing_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_in_set")] + public static extern void switch_device_stats_t_ringing_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_in_get")] + public static extern uint switch_device_stats_t_ringing_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_out_set")] + public static extern void switch_device_stats_t_ringing_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ringing_out_get")] + public static extern uint switch_device_stats_t_ringing_out_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_set")] public static extern void switch_device_stats_t_early_set(HandleRef jarg1, uint jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_get")] public static extern uint switch_device_stats_t_early_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_in_set")] + public static extern void switch_device_stats_t_early_in_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_in_get")] + public static extern uint switch_device_stats_t_early_in_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_out_set")] + public static extern void switch_device_stats_t_early_out_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_early_out_get")] + public static extern uint switch_device_stats_t_early_out_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ring_wait_set")] + public static extern void switch_device_stats_t_ring_wait_set(HandleRef jarg1, uint jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_stats_t_ring_wait_get")] + public static extern uint switch_device_stats_t_ring_wait_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_device_stats_t")] public static extern IntPtr new_switch_device_stats_t(); @@ -8993,6 +9122,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_stats_get")] public static extern IntPtr switch_device_record_t_stats_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_last_stats_set")] + public static extern void switch_device_record_t_last_stats_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_last_stats_get")] + public static extern IntPtr switch_device_record_t_last_stats_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_state_set")] public static extern void switch_device_record_t_state_set(HandleRef jarg1, int jarg2); @@ -9023,6 +9158,36 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_last_call_time_get")] public static extern IntPtr switch_device_record_t_last_call_time_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_ring_start_set")] + public static extern void switch_device_record_t_ring_start_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_ring_start_get")] + public static extern IntPtr switch_device_record_t_ring_start_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_ring_stop_set")] + public static extern void switch_device_record_t_ring_stop_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_ring_stop_get")] + public static extern IntPtr switch_device_record_t_ring_stop_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_hold_start_set")] + public static extern void switch_device_record_t_hold_start_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_hold_start_get")] + public static extern IntPtr switch_device_record_t_hold_start_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_hold_stop_set")] + public static extern void switch_device_record_t_hold_stop_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_hold_stop_get")] + public static extern IntPtr switch_device_record_t_hold_stop_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_call_start_set")] + public static extern void switch_device_record_t_call_start_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_call_start_get")] + public static extern IntPtr switch_device_record_t_call_start_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_uuid_list_set")] public static extern void switch_device_record_t_uuid_list_set(HandleRef jarg1, HandleRef jarg2); @@ -9047,6 +9212,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_pool_get")] public static extern IntPtr switch_device_record_t_pool_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_user_data_set")] + public static extern void switch_device_record_t_user_data_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_device_record_t_user_data_get")] + public static extern IntPtr switch_device_record_t_user_data_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_device_record_t")] public static extern IntPtr new_switch_device_record_t(); @@ -10538,6 +10709,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_ice_direction")] public static extern int switch_ice_direction(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_debug_pool")] + public static extern void switch_core_session_debug_pool(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")] public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2); @@ -11426,6 +11600,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_direction_get")] public static extern int switch_caller_profile_direction_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_logical_direction_set")] + public static extern void switch_caller_profile_logical_direction_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_logical_direction_get")] + public static extern int switch_caller_profile_logical_direction_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_caller_profile_soft_set")] public static extern void switch_caller_profile_soft_set(HandleRef jarg1, HandleRef jarg2); @@ -11663,6 +11843,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_frame_user_data_get")] public static extern IntPtr switch_frame_user_data_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_frame_pmap_set")] + public static extern void switch_frame_pmap_set(HandleRef jarg1, HandleRef jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_frame_pmap_get")] + public static extern IntPtr switch_frame_pmap_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_frame")] public static extern IntPtr new_switch_frame(); @@ -14327,6 +14513,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_direction")] public static extern int switch_channel_direction(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_logical_direction")] + public static extern int switch_channel_logical_direction(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_direction")] public static extern void switch_channel_set_direction(HandleRef jarg1, int jarg2); @@ -14849,6 +15038,21 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_live_array_parse_json")] public static extern void switch_live_array_parse_json(HandleRef jarg1, uint jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_live_array_add_alias")] + public static extern int switch_live_array_add_alias(HandleRef jarg1, string jarg2, string jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_live_array_clear_alias")] + public static extern int switch_live_array_clear_alias(HandleRef jarg1, string jarg2, string jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_channel_permission_verify")] + public static extern int switch_event_channel_permission_verify(string jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_channel_permission_modify")] + public static extern void switch_event_channel_permission_modify(string jarg1, string jarg2, int jarg3); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_channel_permission_clear")] + public static extern void switch_event_channel_permission_clear(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RESAMPLE_QUALITY_get")] public static extern int SWITCH_RESAMPLE_QUALITY_get(); @@ -15836,15 +16040,15 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_telephony_recv_event")] public static extern void switch_rtp_set_telephony_recv_event(HandleRef jarg1, byte jarg2); - [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_recv_pt")] - public static extern void switch_rtp_set_recv_pt(HandleRef jarg1, byte jarg2); - [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_cng_pt")] public static extern void switch_rtp_set_cng_pt(HandleRef jarg1, byte jarg2); [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_get_private")] public static extern IntPtr switch_rtp_get_private(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_payload_map")] + public static extern int switch_rtp_set_payload_map(HandleRef jarg1, HandleRef jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_intentional_bugs")] public static extern void switch_rtp_intentional_bugs(HandleRef jarg1, int jarg2); @@ -20882,6 +21086,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_payload_map_t { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_payload_map_t(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_payload_map_t() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_payload_map_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_p_char { private HandleRef swigCPtr; @@ -20972,6 +21206,36 @@ namespace FreeSWITCH.Native { using System; using System.Runtime.InteropServices; +public class SWIGTYPE_p_p_payload_map_t { + private HandleRef swigCPtr; + + internal SWIGTYPE_p_p_payload_map_t(IntPtr cPtr, bool futureUse) { + swigCPtr = new HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_p_payload_map_t() { + swigCPtr = new HandleRef(null, IntPtr.Zero); + } + + internal static HandleRef getCPtr(SWIGTYPE_p_p_payload_map_t obj) { + return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + +using System; +using System.Runtime.InteropServices; + public class SWIGTYPE_p_p_p_char { private HandleRef swigCPtr; @@ -26140,6 +26404,16 @@ public class switch_caller_profile : IDisposable { } } + public switch_call_direction_t logical_direction { + set { + freeswitchPINVOKE.switch_caller_profile_logical_direction_set(swigCPtr, (int)value); + } + get { + switch_call_direction_t ret = (switch_call_direction_t)freeswitchPINVOKE.switch_caller_profile_logical_direction_get(swigCPtr); + return ret; + } + } + public profile_node_t soft { set { freeswitchPINVOKE.switch_caller_profile_soft_set(swigCPtr, profile_node_t.getCPtr(value)); @@ -26241,6 +26515,7 @@ public enum switch_channel_callstate_t { CCS_EARLY, CCS_ACTIVE, CCS_HELD, + CCS_RING_WAIT, CCS_HANGUP, CCS_UNHOLD } @@ -26360,6 +26635,7 @@ public enum switch_channel_flag_t { CF_CONFIRM_BLIND_TRANSFER, CF_NO_PRESENCE, CF_CONFERENCE, + CF_CONFERENCE_ADV, CF_RECOVERING, CF_RECOVERING_BRIDGE, CF_TRACKED, @@ -26393,6 +26669,7 @@ public enum switch_channel_flag_t { CF_VIDEO_ECHO, CF_SLA_INTERCEPT, CF_VIDEO_BREAK, + CF_MEDIA_PAUSE, CF_FLAG_MAX } @@ -28314,6 +28591,7 @@ public enum switch_core_session_message_types_t { SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE, SWITCH_MESSAGE_INDICATE_STUN_ERROR, SWITCH_MESSAGE_INDICATE_MEDIA_RENEG, + SWITCH_MESSAGE_REFER_EVENT, SWITCH_MESSAGE_ANSWER_EVENT, SWITCH_MESSAGE_PROGRESS_EVENT, SWITCH_MESSAGE_RING_EVENT, @@ -28644,6 +28922,16 @@ public class switch_device_node_t : IDisposable { } } + public switch_call_direction_t direction { + set { + freeswitchPINVOKE.switch_device_node_t_direction_set(swigCPtr, (int)value); + } + get { + switch_call_direction_t ret = (switch_call_direction_t)freeswitchPINVOKE.switch_device_node_t_direction_get(swigCPtr); + return ret; + } + } + public switch_device_record_t parent { set { freeswitchPINVOKE.switch_device_node_t_parent_set(swigCPtr, switch_device_record_t.getCPtr(value)); @@ -28754,6 +29042,17 @@ public class switch_device_record_t : IDisposable { } } + public switch_device_stats_t last_stats { + set { + freeswitchPINVOKE.switch_device_record_t_last_stats_set(swigCPtr, switch_device_stats_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_device_record_t_last_stats_get(swigCPtr); + switch_device_stats_t ret = (cPtr == IntPtr.Zero) ? null : new switch_device_stats_t(cPtr, false); + return ret; + } + } + public switch_device_state_t state { set { freeswitchPINVOKE.switch_device_record_t_state_set(swigCPtr, (int)value); @@ -28810,6 +29109,66 @@ public class switch_device_record_t : IDisposable { } } + public SWIGTYPE_p_switch_time_t ring_start { + set { + freeswitchPINVOKE.switch_device_record_t_ring_start_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_device_record_t_ring_start_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_time_t ring_stop { + set { + freeswitchPINVOKE.switch_device_record_t_ring_stop_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_device_record_t_ring_stop_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_time_t hold_start { + set { + freeswitchPINVOKE.switch_device_record_t_hold_start_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_device_record_t_hold_start_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_time_t hold_stop { + set { + freeswitchPINVOKE.switch_device_record_t_hold_stop_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_device_record_t_hold_stop_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public SWIGTYPE_p_switch_time_t call_start { + set { + freeswitchPINVOKE.switch_device_record_t_call_start_set(swigCPtr, SWIGTYPE_p_switch_time_t.getCPtr(value)); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + } + get { + SWIGTYPE_p_switch_time_t ret = new SWIGTYPE_p_switch_time_t(freeswitchPINVOKE.switch_device_record_t_call_start_get(swigCPtr), true); + if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + public switch_device_node_t uuid_list { set { freeswitchPINVOKE.switch_device_record_t_uuid_list_set(swigCPtr, switch_device_node_t.getCPtr(value)); @@ -28854,6 +29213,17 @@ public class switch_device_record_t : IDisposable { } } + public SWIGTYPE_p_void user_data { + set { + freeswitchPINVOKE.switch_device_record_t_user_data_set(swigCPtr, SWIGTYPE_p_void.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_device_record_t_user_data_get(swigCPtr); + SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false); + return ret; + } + } + public switch_device_record_t() : this(freeswitchPINVOKE.new_switch_device_record_t(), true) { } @@ -28931,6 +29301,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint total_in { + set { + freeswitchPINVOKE.switch_device_stats_t_total_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_total_in_get(swigCPtr); + return ret; + } + } + + public uint total_out { + set { + freeswitchPINVOKE.switch_device_stats_t_total_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_total_out_get(swigCPtr); + return ret; + } + } + public uint offhook { set { freeswitchPINVOKE.switch_device_stats_t_offhook_set(swigCPtr, value); @@ -28941,6 +29331,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint offhook_in { + set { + freeswitchPINVOKE.switch_device_stats_t_offhook_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_offhook_in_get(swigCPtr); + return ret; + } + } + + public uint offhook_out { + set { + freeswitchPINVOKE.switch_device_stats_t_offhook_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_offhook_out_get(swigCPtr); + return ret; + } + } + public uint active { set { freeswitchPINVOKE.switch_device_stats_t_active_set(swigCPtr, value); @@ -28951,6 +29361,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint active_in { + set { + freeswitchPINVOKE.switch_device_stats_t_active_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_active_in_get(swigCPtr); + return ret; + } + } + + public uint active_out { + set { + freeswitchPINVOKE.switch_device_stats_t_active_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_active_out_get(swigCPtr); + return ret; + } + } + public uint held { set { freeswitchPINVOKE.switch_device_stats_t_held_set(swigCPtr, value); @@ -28961,6 +29391,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint held_in { + set { + freeswitchPINVOKE.switch_device_stats_t_held_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_held_in_get(swigCPtr); + return ret; + } + } + + public uint held_out { + set { + freeswitchPINVOKE.switch_device_stats_t_held_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_held_out_get(swigCPtr); + return ret; + } + } + public uint hup { set { freeswitchPINVOKE.switch_device_stats_t_hup_set(swigCPtr, value); @@ -28971,6 +29421,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint hup_in { + set { + freeswitchPINVOKE.switch_device_stats_t_hup_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_hup_in_get(swigCPtr); + return ret; + } + } + + public uint hup_out { + set { + freeswitchPINVOKE.switch_device_stats_t_hup_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_hup_out_get(swigCPtr); + return ret; + } + } + public uint ringing { set { freeswitchPINVOKE.switch_device_stats_t_ringing_set(swigCPtr, value); @@ -28981,6 +29451,26 @@ public class switch_device_stats_t : IDisposable { } } + public uint ringing_in { + set { + freeswitchPINVOKE.switch_device_stats_t_ringing_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_ringing_in_get(swigCPtr); + return ret; + } + } + + public uint ringing_out { + set { + freeswitchPINVOKE.switch_device_stats_t_ringing_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_ringing_out_get(swigCPtr); + return ret; + } + } + public uint early { set { freeswitchPINVOKE.switch_device_stats_t_early_set(swigCPtr, value); @@ -28991,6 +29481,36 @@ public class switch_device_stats_t : IDisposable { } } + public uint early_in { + set { + freeswitchPINVOKE.switch_device_stats_t_early_in_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_early_in_get(swigCPtr); + return ret; + } + } + + public uint early_out { + set { + freeswitchPINVOKE.switch_device_stats_t_early_out_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_early_out_get(swigCPtr); + return ret; + } + } + + public uint ring_wait { + set { + freeswitchPINVOKE.switch_device_stats_t_ring_wait_set(swigCPtr, value); + } + get { + uint ret = freeswitchPINVOKE.switch_device_stats_t_ring_wait_get(swigCPtr); + return ret; + } + } + public switch_device_stats_t() : this(freeswitchPINVOKE.new_switch_device_stats_t(), true) { } @@ -31337,6 +31857,17 @@ public class switch_frame : IDisposable { } } + public SWIGTYPE_p_payload_map_t pmap { + set { + freeswitchPINVOKE.switch_frame_pmap_set(swigCPtr, SWIGTYPE_p_payload_map_t.getCPtr(value)); + } + get { + IntPtr cPtr = freeswitchPINVOKE.switch_frame_pmap_get(swigCPtr); + SWIGTYPE_p_payload_map_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_payload_map_t(cPtr, false); + return ret; + } + } + public switch_frame() : this(freeswitchPINVOKE.new_switch_frame(), true) { } @@ -34147,9 +34678,11 @@ namespace FreeSWITCH.Native { SOF_NONE = 0, SOF_NOBLOCK = (1 << 0), SOF_FORKED_DIAL = (1 << 1), - SOF_NO_EFFECTIVE_CID_NUM = (1 << 2), - SOF_NO_EFFECTIVE_CID_NAME = (1 << 3), - SOF_NO_LIMITS = (1 << 4) + SOF_NO_EFFECTIVE_ANI = (1 << 2), + SOF_NO_EFFECTIVE_ANIII = (1 << 3), + SOF_NO_EFFECTIVE_CID_NUM = (1 << 4), + SOF_NO_EFFECTIVE_CID_NAME = (1 << 5), + SOF_NO_LIMITS = (1 << 6) } } @@ -34605,6 +35138,9 @@ public enum switch_rtp_flag_t { SWITCH_RTP_FLAG_RTCP_MUX, SWITCH_RTP_FLAG_KILL_JB, SWITCH_RTP_FLAG_VIDEO_BREAK, + SWITCH_RTP_FLAG_PAUSE, + SWITCH_RTP_FLAG_FIR, + SWITCH_RTP_FLAG_PLI, SWITCH_RTP_FLAG_INVALID } From 0221403514d2f364b9dc5d738d7ad5eeee183a8a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 03:21:25 +0500 Subject: [PATCH 22/51] bump --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 42256e2dda..e445e34776 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.5.7b], bugs@freeswitch.org) +AC_INIT([freeswitch], [1.5.7], bugs@freeswitch.org) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [5]) -AC_SUBST(SWITCH_VERSION_MICRO, [7b]) +AC_SUBST(SWITCH_VERSION_MICRO, [7]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) From 2cd5841cd44e26942668b1213515bae3469ba338 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 03:23:01 +0500 Subject: [PATCH 23/51] bump --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e445e34776..e27d3d860a 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.5.7], bugs@freeswitch.org) +AC_INIT([freeswitch], [1.5.8b], bugs@freeswitch.org) AC_SUBST(SWITCH_VERSION_MAJOR, [1]) AC_SUBST(SWITCH_VERSION_MINOR, [5]) -AC_SUBST(SWITCH_VERSION_MICRO, [7]) +AC_SUBST(SWITCH_VERSION_MICRO, [8b]) AC_SUBST(SWITCH_VERSION_REVISION, []) AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, []) From ed69ca80dec4cd6ae861a8781a32b0edd2be0cec Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 19:23:11 -0600 Subject: [PATCH 24/51] fix compile --- src/mod/applications/mod_fifo/mod_fifo.c | 48 ++++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c index 4ba7b01f78..b993756963 100644 --- a/src/mod/applications/mod_fifo/mod_fifo.c +++ b/src/mod/applications/mod_fifo/mod_fifo.c @@ -2258,15 +2258,15 @@ static void dec_use_count(switch_core_session_t *session, const char *type) } hold_usec = originator_cp->times->hold_accum; tt_usec = (switch_micro_time_now() - originator_cp->times->bridged) - hold_usec; - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%lu", originator_cp->times->bridged); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%lu", (uint64_t)(originator_cp->times->bridged / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%lu", (uint64_t)(originator_cp->times->bridged / 1000000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%lu", tt_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%lu", hold_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%"SWITCH_TIME_T_FMT, originator_cp->times->bridged); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(originator_cp->times->bridged / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(originator_cp->times->bridged / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%"SWITCH_TIME_T_FMT, tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%"SWITCH_TIME_T_FMT, hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000000)); switch_event_fire(&event); } @@ -3287,15 +3287,15 @@ SWITCH_STANDARD_APP(fifo_function) } hold_usec = originator_cp->times->hold_accum; tt_usec = (switch_micro_time_now() - originator_cp->times->bridged) - hold_usec; - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%lu", originator_cp->times->bridged); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%lu", (uint64_t)(originator_cp->times->bridged / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%lu", (uint64_t)(originator_cp->times->bridged / 1000000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%lu", tt_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%lu", hold_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-us", "%"SWITCH_TIME_T_FMT, originator_cp->times->bridged); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(originator_cp->times->bridged / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Bridge-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(originator_cp->times->bridged / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-us", "%"SWITCH_TIME_T_FMT, tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Talk-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-us", "%"SWITCH_TIME_T_FMT, hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Consumer-Hold-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000000)); switch_event_fire(&event); } @@ -3321,12 +3321,12 @@ SWITCH_STANDARD_APP(fifo_function) switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "FIFO-Action", "bridge-caller-stop"); hold_usec = originatee_cp->times->hold_accum; tt_usec = (switch_micro_time_now() - originatee_cp->times->bridged) - hold_usec; - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-us", "%lu", tt_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-ms", "%lu", (uint64_t)(tt_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-s", "%lu", (uint64_t)(tt_usec / 1000000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-us", "%lu", hold_usec); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-ms", "%lu", (uint64_t)(hold_usec / 1000)); - switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-s", "%lu", (uint64_t)(hold_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-us", "%"SWITCH_TIME_T_FMT, tt_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Talk-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(tt_usec / 1000000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-us", "%"SWITCH_TIME_T_FMT, hold_usec); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-ms", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000)); + switch_event_add_header(event, SWITCH_STACK_BOTTOM, "FIFO-Caller-Hold-Time-s", "%"SWITCH_TIME_T_FMT, (uint64_t)(hold_usec / 1000000)); switch_event_fire(&event); } From aa8a4913b4c7d9436cde45075e0d9df07096ca51 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 23 Nov 2013 20:11:59 -0600 Subject: [PATCH 25/51] FS-5994 --- src/switch_ivr_bridge.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/switch_ivr_bridge.c b/src/switch_ivr_bridge.c index 089301da0e..ffc7e0b5e8 100644 --- a/src/switch_ivr_bridge.c +++ b/src/switch_ivr_bridge.c @@ -976,18 +976,12 @@ static switch_status_t sb_on_dtmf(switch_core_session_t *session, const switch_d static switch_status_t hanguphook(switch_core_session_t *session) { - switch_core_session_message_t msg = { 0 }; + switch_core_session_message_t *msg = NULL; switch_channel_t *channel = NULL; switch_event_t *event; channel = switch_core_session_get_channel(session); - - msg.message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; - msg.from = __FILE__; - msg.string_arg = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE); - - if (switch_channel_test_flag(channel, CF_BRIDGE_ORIGINATOR)) { switch_channel_clear_flag_recursive(channel, CF_BRIDGE_ORIGINATOR); if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_UNBRIDGE) == SWITCH_STATUS_SUCCESS) { @@ -996,8 +990,14 @@ static switch_status_t hanguphook(switch_core_session_t *session) } } + + msg = switch_core_session_alloc(session, sizeof(*msg)); + MESSAGE_STAMP_FFL(msg); + msg->message_id = SWITCH_MESSAGE_INDICATE_UNBRIDGE; + msg->from = __FILE__; + msg->string_arg = switch_channel_get_variable(channel, SWITCH_SIGNAL_BRIDGE_VARIABLE); + switch_core_session_queue_message(session, msg); - switch_core_session_receive_message(session, &msg); switch_core_event_hook_remove_state_change(session, hanguphook); return SWITCH_STATUS_SUCCESS; From 27476602696e1a2dea1beea88091bb22fcefeb9d Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 25 Nov 2013 12:08:17 -0600 Subject: [PATCH 26/51] FS-5959 FS-5958 --- src/mod/endpoints/mod_sofia/sofia.c | 2 +- src/switch_core_media.c | 12 +++++++++++- src/switch_rtp.c | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index cd566c22bd..f9fc330c71 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6478,7 +6478,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status, switch_channel_set_flag(tech_pvt->channel, CF_REINVITE); if (tech_pvt->mparams.num_codecs) { - match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_REQUEST); + match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE); } if (match) { if (switch_core_media_choose_port(tech_pvt->session, SWITCH_MEDIA_TYPE_AUDIO, 0) != SWITCH_STATUS_SUCCESS) { diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 25af9b4e29..873519eb11 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -497,6 +497,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core recv_pt = pmap->recv_pt; fmtp = pmap->rm_fmtp; found++; + break; } } switch_mutex_unlock(smh->sdp_mutex); @@ -602,7 +603,12 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se if (sdp_type == SDP_TYPE_REQUEST || !exists) { + int b4 = pmap->pt; pmap->pt = (switch_payload_t) (local_pt ? local_pt : pt); + + if (b4 == 97 && pmap->pt == 109) { + abort(); + } } if (negotiated) { @@ -6354,7 +6360,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess pass_fmtp = switch_channel_get_variable(session->channel, "rtp_video_fmtp"); } } - + if (pass_fmtp) { switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=fmtp:%d %s\n", v_engine->cur_payload_map->pt, pass_fmtp); } @@ -6433,6 +6439,10 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess fmtp = switch_event_get_header(map, imp->iananame); } + if (smh->fmtps[i]) { + fmtp = smh->fmtps[i]; + } + if (zstr(fmtp)) fmtp = imp->fmtp; if (zstr(fmtp)) fmtp = (char *) pass_fmtp; diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 490137e08b..6e6c594f05 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -5047,6 +5047,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ payload_map_t *pmap; switch_mutex_lock(rtp_session->flag_mutex); for (pmap = *rtp_session->pmaps; pmap && pmap->allocated; pmap = pmap->next) { + if (!pmap->negotiated) { continue; } @@ -5056,6 +5057,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (pmapP) { *pmapP = pmap; } + break; } } switch_mutex_unlock(rtp_session->flag_mutex); @@ -5064,6 +5066,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (!accept_packet && !(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PAYLOAD) && !(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PACKETS)) { /* drop frames of incorrect payload number and return CNG frame instead */ + return_cng_frame(); } } From 1e59690cc17bbe9072bd14b11a1c97e489dd1d35 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 25 Nov 2013 12:34:04 -0600 Subject: [PATCH 27/51] FS-6001 --resolve --- src/mod/applications/mod_commands/mod_commands.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 019e3f8563..7956903c38 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -1946,6 +1946,16 @@ SWITCH_STANDARD_API(cond_function) } } + if (strspn(a, "!<>=")) { + expr = a; + } + + if (expr == a) { + a = ""; + } + + while (*expr == ' ') expr++; + while(expr && *expr) { switch(*expr) { case '!': From 00f52f30021dd2d74812427c1e724e076748d2c9 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 25 Nov 2013 16:09:12 -0600 Subject: [PATCH 28/51] FS-4965 calling the variable playback_last_offset_pos instead --- src/switch_ivr_play_say.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 3d7894ff74..1d44342ca3 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1721,6 +1721,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess } switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file %s\n", file); + switch_channel_set_variable_printf(channel, "playback_last_offset_pos", "%d", fh->offset_pos); if (read_impl.samples_per_second) { switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->native_rate); From 83ccceb2b5e8f9d8033006a153aca022665fd971 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 26 Nov 2013 10:04:29 -0600 Subject: [PATCH 29/51] FS-5958 remove debug --- src/switch_core_media.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 873519eb11..790ea0f5bc 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -605,10 +605,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se if (sdp_type == SDP_TYPE_REQUEST || !exists) { int b4 = pmap->pt; pmap->pt = (switch_payload_t) (local_pt ? local_pt : pt); - - if (b4 == 97 && pmap->pt == 109) { - abort(); - } } if (negotiated) { From c56b73d0be53c87a7fb12edef1b186267cb428d3 Mon Sep 17 00:00:00 2001 From: Brian West Date: Tue, 26 Nov 2013 17:15:14 +0000 Subject: [PATCH 30/51] remove unused variable --- src/switch_core_media.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 790ea0f5bc..a8336dd03b 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -603,7 +603,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se if (sdp_type == SDP_TYPE_REQUEST || !exists) { - int b4 = pmap->pt; pmap->pt = (switch_payload_t) (local_pt ? local_pt : pt); } From beb0673f259788a239e5e44162e8b1e2c765dd64 Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Tue, 26 Nov 2013 19:38:30 -0500 Subject: [PATCH 31/51] expose useful internals... thanks jaybinks --- src/switch_ivr_play_say.c | 138 ++++++++++++++++++++------------------ 1 file changed, 72 insertions(+), 66 deletions(-) diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index 1d44342ca3..97f553d733 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1,4 +1,4 @@ -/* +/* * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application * Copyright (C) 2005-2012, Anthony Minessale II * @@ -22,7 +22,7 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * * Anthony Minessale II * Paul D. Tinsley * Neal Horman @@ -314,12 +314,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio switch_ivr_sleep(session, pause, SWITCH_FALSE, NULL); switch_safe_free(expanded); switch_safe_free(substituted); - + } } switch_regex_safe_free(re); - + if ((match && do_break && switch_true(do_break)) || status == SWITCH_STATUS_BREAK) { break; } @@ -438,7 +438,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se } } - + if ((vval = switch_channel_get_variable(channel, "record_fill_cng"))) { if (!strcasecmp(vval, "true")) { @@ -449,7 +449,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se } } } - + if ((vval = switch_channel_get_variable(channel, "record_waste_resources"))) { @@ -539,7 +539,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if (sample_start > 0) { uint32_t pos = 0; switch_core_file_seek(fh, &pos, sample_start, SEEK_SET); - switch_clear_flag(fh, SWITCH_FILE_SEEK); + switch_clear_flag(fh, SWITCH_FILE_SEEK); fh->samples = 0; } @@ -547,7 +547,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if (switch_test_flag(fh, SWITCH_FILE_NATIVE)) { asis = 1; } - + restart_limit_on_dtmf = switch_true(switch_channel_get_variable(channel, "record_restart_limit_on_dtmf")); if ((p = switch_channel_get_variable(channel, "RECORD_TITLE"))) { @@ -655,7 +655,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if (args) { /* - dtmf handler function you can hook up to be executed when a digit is dialed during playback + dtmf handler function you can hook up to be executed when a digit is dialed during playback if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. */ if (switch_channel_has_dtmf(channel)) { @@ -675,7 +675,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) { break; } - } + } if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); @@ -693,7 +693,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se if ((ostatus = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen)) != SWITCH_STATUS_SUCCESS) { status = ostatus; } - + switch_event_destroy(&event); } } @@ -760,7 +760,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se len = write_frame.datalen / 2; if (switch_core_file_write(fh, write_frame.data, &len) != SWITCH_STATUS_SUCCESS) { break; - } + } } if (waste_resources) { @@ -782,22 +782,22 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se char *cmd = switch_core_session_strdup(session, var); char *data, *expanded = NULL; switch_stream_handle_t stream = { 0 }; - + SWITCH_STANDARD_STREAM(stream); - + if ((data = strchr(cmd, ':'))) { *data++ = '\0'; expanded = switch_channel_expand_variables(channel, data); } - + switch_api_execute(cmd, expanded, session, &stream); - + if (expanded && expanded != data) { free(expanded); } - + switch_safe_free(stream.data); - + } if (read_impl.actual_samples_per_second) { @@ -916,7 +916,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi if (args) { /* - dtmf handler function you can hook up to be executed when a digit is dialed during gentones + dtmf handler function you can hook up to be executed when a digit is dialed during gentones if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. */ if (switch_channel_has_dtmf(channel)) { @@ -931,7 +931,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) { break; } - } + } if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); @@ -943,7 +943,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_gentones(switch_core_session_t *sessi if (args->input_callback) { switch_event_t *event; - + if (switch_core_session_dequeue_event(session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) { switch_status_t ostatus = args->input_callback(session, event, SWITCH_INPUT_TYPE_EVENT, args->buf, args->buflen); if (ostatus != SWITCH_STATUS_SUCCESS) { @@ -985,7 +985,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_get_file_handle(switch_core_session_t *fh = NULL; switch_core_session_io_read_lock(session); - + if ((fhp = switch_channel_get_private(channel, "__fh"))) { *fh = fhp; return SWITCH_STATUS_SUCCESS; @@ -1105,12 +1105,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess fh = &lfh; memset(fh, 0, sizeof(lfh)); } - + if (fh->samples > 0) { sample_start = fh->samples; fh->samples = 0; } - + @@ -1122,9 +1122,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess fh->samples = sample_start = 0; if (sleep_val_i) { status = switch_ivr_sleep(session, sleep_val_i, SWITCH_FALSE, args); - if(status != SWITCH_STATUS_SUCCESS) { - break; - } + if(status != SWITCH_STATUS_SUCCESS) { + break; + } } } @@ -1300,7 +1300,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess //date = switch_core_session_strdup(session, p); switch_channel_set_variable(channel, "RECORD_DATE", p); } - + interval = read_impl.microseconds_per_packet / 1000; if (!fh->audio_buffer) { @@ -1309,7 +1309,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess } codec_name = "L16"; - + if (!switch_core_codec_ready((&codec))) { if (switch_core_codec_init(&codec, codec_name, @@ -1318,17 +1318,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess interval, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Codec Activated %s@%uhz %u channels %dms\n", codec_name, fh->samplerate, fh->channels, interval); - - + + } else { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Raw Codec Activation Failed %s@%uhz %u channels %dms\n", codec_name, fh->samplerate, fh->channels, interval); switch_core_session_io_write_lock(session); switch_channel_set_private(channel, "__fh", NULL); switch_core_session_io_rwunlock(session); - + switch_core_file_close(fh); - + switch_core_session_reset(session, SWITCH_TRUE, SWITCH_FALSE); status = SWITCH_STATUS_GENERR; continue; @@ -1346,7 +1346,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess samples = codec.implementation->samples_per_packet; framelen = codec.implementation->decoded_bytes_per_packet; } - + last_native = test_native; if (timer_name && !timer.samplecount) { @@ -1395,7 +1395,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess int do_speed = 1; int last_speed = -1; int f; - + if (!switch_channel_ready(channel)) { status = SWITCH_STATUS_FALSE; break; @@ -1414,7 +1414,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess if (args) { /* - dtmf handler function you can hook up to be executed when a digit is dialed during playback + dtmf handler function you can hook up to be executed when a digit is dialed during playback if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. */ if (switch_channel_has_dtmf(channel)) { @@ -1430,7 +1430,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) { break; } - } + } if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); @@ -1523,14 +1523,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess eof++; continue; } - + test_native = switch_test_flag(fh, SWITCH_FILE_NATIVE); if (test_native != last_native) { if (test_native) { write_frame.codec = switch_core_session_get_read_codec(session); samples = read_impl.samples_per_packet; - framelen = read_impl.encoded_bytes_per_packet; + framelen = read_impl.encoded_bytes_per_packet; } else { write_frame.codec = &codec; samples = codec.implementation->samples_per_packet; @@ -1616,7 +1616,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess last_speed = fh->speed; continue; } - + if (olen < llen) { uint8_t *dp = (uint8_t *) write_frame.data; memset(dp + (int) olen, 255, (int) (llen - olen)); @@ -1631,7 +1631,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess } else { /* time off the channel (if you must) */ switch_frame_t *read_frame; switch_status_t tstatus; - + while (switch_channel_ready(channel) && switch_channel_test_flag(channel, CF_HOLD)) { switch_ivr_parse_all_messages(session); switch_yield(10000); @@ -1704,7 +1704,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess break; } } - + if (status == SWITCH_STATUS_MORE_DATA) { status = SWITCH_STATUS_SUCCESS; @@ -1854,26 +1854,32 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_silence(switch_core_session_ if (sample_count) { sample_count -= raw_codec.implementation->samples_per_packet; if (sample_count <= 0) { + switch_channel_set_variable(channel, "wait_for_silence_timeout", "true"); + switch_channel_set_variable_printf(channel, "wait_for_silence_listenhits", "%d", listening); + switch_channel_set_variable_printf(channel, "wait_for_silence_silence_hits", "%d", silence_hits); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "switch_ivr_wait_for_silence: TIMEOUT %d\n", countdown); break; } } - + if (abuf) { switch_size_t olen = raw_codec.implementation->samples_per_packet; - + if (switch_core_file_read(&fh, abuf, &olen) != SWITCH_STATUS_SUCCESS) { break; } - + write_frame.samples = (uint32_t) olen; write_frame.datalen = (uint32_t) (olen * sizeof(int16_t)); if ((status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0)) != SWITCH_STATUS_SUCCESS) { break; } } - + if (countdown) { if (!--countdown) { + switch_channel_set_variable(channel, "wait_for_silence_timeout", "false"); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "switch_ivr_wait_for_silence: SILENCE DETECTED\n"); break; } else { continue; @@ -1920,9 +1926,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session, uint32_t max_digits, const char *prompt_audio_file, const char *var_name, - char *digit_buffer, - switch_size_t digit_buffer_length, - uint32_t timeout, + char *digit_buffer, + switch_size_t digit_buffer_length, + uint32_t timeout, const char *valid_terminators, uint32_t digit_timeout) @@ -1933,7 +1939,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session, size_t len = 0; char tb[2] = ""; int term_required = 0; - + if (valid_terminators && *valid_terminators == '=') { term_required = 1; @@ -1986,7 +1992,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session, if ((min_digits && len < min_digits) || len < max_digits) { args.buf = digit_buffer + len; args.buflen = (uint32_t) (digit_buffer_length - len); - status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &tb[0], + status = switch_ivr_collect_digits_count(session, digit_buffer, digit_buffer_length, max_digits, valid_terminators, &tb[0], len ? digit_timeout : timeout, digit_timeout, 0); } @@ -2049,8 +2055,8 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t const char *prompt_audio_file, const char *bad_input_audio_file, const char *var_name, - char *digit_buffer, - uint32_t digit_buffer_length, + char *digit_buffer, + uint32_t digit_buffer_length, const char *digits_regex, uint32_t digit_timeout, const char *transfer_on_failure) @@ -2103,10 +2109,10 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t } memset(digit_buffer, 0, digit_buffer_length); - + /* If we get here then check for transfer-on-failure ext/dp/context */ /* split this arg on spaces to get ext, dp, and context */ - + if (!zstr(transfer_on_failure)) { const char *failure_ext = NULL; const char *failure_dialplan = NULL; @@ -2114,18 +2120,18 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t char *target[4]; char *mydata = switch_core_session_strdup(session, transfer_on_failure); int argc; - + argc = switch_separate_string(mydata, ' ', target, (sizeof(target) / sizeof(target[0]))); - + if ( argc < 1 ) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR,"Bad target for PAGD failure: [%s]\n", transfer_on_failure); return SWITCH_STATUS_FALSE; } - + if ( argc > 0 ) { failure_ext = target[0]; } - + if ( argc > 1 ) { failure_dialplan = target[1]; } @@ -2134,14 +2140,14 @@ SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t failure_context = target[2]; } - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "PAGD failure! Transfer to: %s / %s / %s\n", failure_ext, failure_dialplan, failure_context); - + switch_ivr_session_transfer(session,failure_ext, failure_dialplan, failure_context); return SWITCH_STATUS_FALSE; - } - - return SWITCH_STATUS_FALSE; + } + + return SWITCH_STATUS_FALSE; } SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session, @@ -2276,7 +2282,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session } if (args) { - /* dtmf handler function you can hook up to be executed when a digit is dialed during playback + /* dtmf handler function you can hook up to be executed when a digit is dialed during playback * if you return anything but SWITCH_STATUS_SUCCESS the playback will stop. */ if (switch_channel_has_dtmf(channel)) { @@ -2295,7 +2301,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session if ((status = switch_ivr_dmachine_feed(args->dmachine, ds, NULL)) != SWITCH_STATUS_SUCCESS) { break; } - } + } if (args->input_callback) { status = args->input_callback(session, (void *) &dtmf, SWITCH_INPUT_TYPE_DTMF, args->buf, args->buflen); From c62db1a600de4edadceebc9e460d2e2d50dc12c9 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Wed, 27 Nov 2013 09:51:33 -0500 Subject: [PATCH 32/51] freetdm: ftmod_wanpipe: Remove chatty debug msg, not really useful anyways --- libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c index 83dbd62210..a7ac119486 100755 --- a/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c +++ b/libs/freetdm/src/ftmod/ftmod_wanpipe/ftmod_wanpipe.c @@ -1397,7 +1397,6 @@ static FIO_GET_ALARMS_FUNCTION(wanpipe_get_alarms) * on at application startup, until that is fixed we check the link status here too */ ftdm_channel_command(ftdmchan, FTDM_COMMAND_GET_LINK_STATUS, &sangoma_status); ftdmchan->alarm_flags = sangoma_status == FTDM_HW_LINK_DISCONNECTED ? FTDM_ALARM_RED : FTDM_ALARM_NONE; - ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Link status is %d\n", sangoma_status); } } From bbe1fe1a31cdb555fbf71b4669e8b6d8b1548ebb Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 Nov 2013 10:20:29 -0600 Subject: [PATCH 33/51] FS-6005 --resolve --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index bd0253e8c0..f36394da87 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Fri Oct 25 23:51:29 CDT 2013 +Wed Nov 27 10:20:13 CST 2013 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c index 9b862415a3..f0b4d35d58 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_session.c @@ -270,8 +270,10 @@ void nua_session_usage_remove(nua_handle_t *nh, ss->ss_reporting = 0; } - if (cr == du->du_cr && cr->cr_orq) + if (cr == du->du_cr && cr->cr_orq) { + nua_client_request_unref(cr); continue; + } if (cr->cr_status < 200) { nua_stack_event(nh->nh_nua, nh, From 3e00d270d7477a63b3c2e845b5473e6e7e3f1cfc Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 Nov 2013 12:40:35 -0600 Subject: [PATCH 34/51] FS-6006 --resolve --- src/switch_core_session.c | 13 +++++++++++-- src/switch_ivr.c | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 0056e2d155..22964a3c72 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -766,6 +766,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit switch_assert(session != NULL); + if (message->message_id == SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) { + if (session->endpoint_interface->io_routines->receive_message) { + status = session->endpoint_interface->io_routines->receive_message(session, message); + } + + switch_core_session_free_message(&message); + return status; + } + if ((status = switch_core_session_read_lock_hangup(session)) != SWITCH_STATUS_SUCCESS) { return status; } @@ -821,7 +830,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit } - if (switch_channel_down_nosig(session->channel) && message->message_id != SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) { + if (switch_channel_down_nosig(session->channel)) { switch_log_printf(SWITCH_CHANNEL_ID_LOG, message->_file, message->_func, message->_line, switch_core_session_get_uuid(session), SWITCH_LOG_DEBUG, "%s skip receive message [%s] (channel is hungup already)\n", switch_channel_get_name(session->channel), message_names[message->message_id]); @@ -830,7 +839,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_receive_message(swit if (session->media_handle) { status = switch_core_media_receive_message(session, message); } - if (status == SWITCH_STATUS_SUCCESS || message->message_id == SWITCH_MESSAGE_INDICATE_SIGNAL_DATA) { + if (status == SWITCH_STATUS_SUCCESS) { if (session->endpoint_interface->io_routines->receive_message) { status = session->endpoint_interface->io_routines->receive_message(session, message); } diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 1f91ed9625..daba288c7e 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -811,6 +811,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_signal_data(switch_core_ses int i = 0; switch_channel_t *channel = switch_core_session_get_channel(session); + if (!switch_core_session_in_thread(session)) { + return SWITCH_STATUS_FALSE; + } if (switch_channel_test_flag(channel, CF_SIGNAL_DATA)) { return SWITCH_STATUS_FALSE; From a19d013d3e27d426fbd6166f3478fdd65dc4b8fb Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Wed, 27 Nov 2013 19:19:31 -0500 Subject: [PATCH 35/51] FS-5993 --resolve --- src/mod/applications/mod_callcenter/mod_callcenter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 3286cea05a..cd8ed15dbc 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1584,7 +1584,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa if (atoi(res) == 0) { goto done; } - switch_core_session_hupall_matching_var("cc_member_pre_answer_uuid", h->member_uuid, SWITCH_CAUSE_ORIGINATOR_CANCEL); + switch_core_session_hupall_matching_var("cc_member_pre_answer_uuid", h->member_uuid, SWITCH_CAUSE_LOSE_RACE); } t_agent_answered = local_epoch_time_now(NULL); From 30325093d4d7c8c9b0df8e3edb9ea093344b93e5 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 27 Nov 2013 23:55:00 -0600 Subject: [PATCH 36/51] FS-6009 --resolve --- src/mod/endpoints/mod_sofia/sofia_presence.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 90f251dfb9..747f4491e5 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -3770,13 +3770,13 @@ void sofia_presence_handle_sip_i_subscribe(int status, if (sub_state == nua_substate_active) { sstr = switch_mprintf("active;expires=%ld", exp_delta); - + sql = switch_mprintf("update sip_subscriptions " "set expires=%ld, " - "network_ip='%q',network_port='%d',sip_user='%q',sip_host='%q',full_via='%q',full_to='%q;tag=%q',full_from='%q',contact='%q' " + "network_ip='%q',network_port='%d',sip_user='%q',sip_host='%q',full_via='%q',full_to='%q',full_from='%q',contact='%q' " "where call_id='%q' and profile_name='%q' and hostname='%q'", (long) switch_epoch_time_now(NULL) + exp_delta, - np.network_ip, np.network_port, from_user, from_host, full_via, full_to, use_to_tag, full_from, contact_str, + np.network_ip, np.network_port, from_user, from_host, full_via, full_to, full_from, contact_str, call_id, profile->name, mod_sofia_globals.hostname); From 9ecbb5406104ca710ee28009415aa5339de40198 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 28 Nov 2013 01:28:00 -0500 Subject: [PATCH 37/51] FS-5850 --resolve Thanks --- .../mod_callcenter/mod_callcenter.c | 134 ++++++++++++++---- 1 file changed, 106 insertions(+), 28 deletions(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index cd8ed15dbc..785d44bc5e 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1249,13 +1249,74 @@ end: return SWITCH_STATUS_SUCCESS; } +static switch_status_t load_tier(const char *queue, const char *agent, const char *level, const char *position) +{ + /* Hack to check if an tier already exist */ + if (cc_tier_update("unknown", "unknown", queue, agent) == CC_STATUS_TIER_NOT_FOUND) { + if (level && position) { + cc_tier_add(queue, agent, cc_tier_state2str(CC_TIER_STATE_READY), atoi(level), atoi(position)); + } else { + /* default to level 1 and position 1 within the level */ + cc_tier_add(queue, agent, cc_tier_state2str(CC_TIER_STATE_READY), 0, 0); + } + } else { + if (level) { + cc_tier_update("level", level, queue, agent); + } + if (position) { + cc_tier_update("position", position, queue, agent); + } + } + return SWITCH_STATUS_SUCCESS; +} + +static switch_status_t load_tiers(switch_bool_t load_all, const char *queue_name, const char *agent_name) +{ + switch_xml_t x_tiers, x_tier, cfg, xml; + switch_status_t result = SWITCH_STATUS_FALSE; + + if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf); + return SWITCH_STATUS_FALSE; + } + + if (!(x_tiers = switch_xml_child(cfg, "tiers"))) { + goto end; + } + + /* Importing from XML config Agent Tiers */ + for (x_tier = switch_xml_child(x_tiers, "tier"); x_tier; x_tier = x_tier->next) { + const char *agent = switch_xml_attr(x_tier, "agent"); + const char *queue = switch_xml_attr(x_tier, "queue"); + const char *level = switch_xml_attr(x_tier, "level"); + const char *position = switch_xml_attr(x_tier, "position"); + if (load_all == SWITCH_TRUE) { + result = load_tier(queue, agent, level, position); + } else if (!zstr(agent_name) && !zstr(queue_name) && !strcasecmp(agent, agent_name) && !strcasecmp(queue, queue_name)) { + result = load_tier(queue, agent, level, position); + } else if (zstr(agent_name) && !strcasecmp(queue, queue_name)) { + result = load_tier(queue, agent, level, position); + } else if (zstr(queue_name) && !strcasecmp(agent, agent_name)) { + result = load_tier(queue, agent, level, position); + } + } + +end: + + if (xml) { + switch_xml_free(xml); + } + + return result; +} + static switch_status_t load_config(void) { switch_status_t status = SWITCH_STATUS_SUCCESS; - switch_xml_t cfg, xml, settings, param, x_queues, x_queue, x_agents, x_agent, x_tiers, x_tier; + switch_xml_t cfg, xml, settings, param, x_queues, x_queue, x_agents, x_agent; switch_cache_db_handle_t *dbh = NULL; char *sql = NULL; - + if (!(xml = switch_xml_open_cfg(global_cf, &cfg, NULL))) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of %s failed\n", global_cf); status = SWITCH_STATUS_TERM; @@ -1323,32 +1384,7 @@ static switch_status_t load_config(void) } /* Importing from XML config Agent Tiers */ - if ((x_tiers = switch_xml_child(cfg, "tiers"))) { - for (x_tier = switch_xml_child(x_tiers, "tier"); x_tier; x_tier = x_tier->next) { - const char *agent = switch_xml_attr(x_tier, "agent"); - const char *queue_name = switch_xml_attr(x_tier, "queue"); - const char *level = switch_xml_attr(x_tier, "level"); - const char *position = switch_xml_attr(x_tier, "position"); - if (agent && queue_name) { - /* Hack to check if an tier already exist */ - if (cc_tier_update("unknown", "unknown", queue_name, agent) == CC_STATUS_TIER_NOT_FOUND) { - if (level && position) { - cc_tier_add(queue_name, agent, cc_tier_state2str(CC_TIER_STATE_READY), atoi(level), atoi(position)); - } else { - /* default to level 1 and position 1 within the level */ - cc_tier_add(queue_name, agent, cc_tier_state2str(CC_TIER_STATE_READY), 0, 0); - } - } else { - if (level) { - cc_tier_update("level", level, queue_name, agent); - } - if (position) { - cc_tier_update("position", position, queue_name, agent); - } - } - } - } - } + load_tiers(SWITCH_TRUE, NULL, NULL); end: switch_mutex_unlock(globals.mutex); @@ -2736,6 +2772,7 @@ static int list_result_callback(void *pArg, int argc, char **argv, char **column #define CC_CONFIG_API_SYNTAX "callcenter_config ,\n"\ "\tcallcenter_config agent add [name] [type] | \n" \ "\tcallcenter_config agent del [name] | \n" \ +"\tcallcenter_config agent reload [name] | \n" \ "\tcallcenter_config agent set status [agent_name] [status] | \n" \ "\tcallcenter_config agent set state [agent_name] [state] | \n" \ "\tcallcenter_config agent set contact [agent_name] [contact] | \n" \ @@ -2752,6 +2789,7 @@ static int list_result_callback(void *pArg, int argc, char **argv, char **column "\tcallcenter_config tier set level [queue_name] [agent_name] [level] | \n" \ "\tcallcenter_config tier set position [queue_name] [agent_name] [position] | \n" \ "\tcallcenter_config tier del [queue_name] [agent_name] | \n" \ +"\tcallcenter_config tier reload [queue_name] [agent_name] | \n" \ "\tcallcenter_config tier list | \n" \ "\tcallcenter_config queue load [queue_name] | \n" \ "\tcallcenter_config queue unload [queue_name] | \n" \ @@ -2837,6 +2875,22 @@ SWITCH_STANDARD_API(cc_config_api_function) } } + } else if (action && !strcasecmp(action, "reload")) { + if (argc-initial_argc < 1) { + stream->write_function(stream, "%s", "-ERR Invalid!\n"); + goto done; + } else { + const char *agent = argv[0 + initial_argc]; + switch (load_agent(agent)) { + case SWITCH_STATUS_SUCCESS: + stream->write_function(stream, "%s", "+OK\n"); + break; + default: + stream->write_function(stream, "%s", "-ERR Unknown Error!\n"); + goto done; + } + } + } else if (action && !strcasecmp(action, "set")) { if (argc-initial_argc < 3) { stream->write_function(stream, "%s", "-ERR Invalid!\n"); @@ -3002,6 +3056,28 @@ SWITCH_STANDARD_API(cc_config_api_function) } } + } else if (action && !strcasecmp(action, "reload")) { + if (argc-initial_argc < 1) { + stream->write_function(stream, "%s", "-ERR Invalid!\n"); + goto done; + } else { + const char *queue = argv[0 + initial_argc]; + const char *agent = argv[1 + initial_argc]; + switch_bool_t load_all = SWITCH_FALSE; + if (!strcasecmp(queue, "all")) { + load_all = SWITCH_TRUE; + } + switch (load_tiers(load_all, queue, agent)) { + case SWITCH_STATUS_SUCCESS: + stream->write_function(stream, "%s", "+OK\n"); + break; + default: + stream->write_function(stream, "%s", "-ERR Unknown Error!\n"); + goto done; + + } + } + } else if (action && !strcasecmp(action, "list")) { struct list_result cbt; cbt.row_process = 0; @@ -3194,6 +3270,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) switch_console_set_complete("add callcenter_config agent add"); switch_console_set_complete("add callcenter_config agent del"); + switch_console_set_complete("add callcenter_config agent reload"); switch_console_set_complete("add callcenter_config agent set status"); switch_console_set_complete("add callcenter_config agent set state"); switch_console_set_complete("add callcenter_config agent set uuid"); @@ -3207,6 +3284,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_callcenter_load) switch_console_set_complete("add callcenter_config tier add"); switch_console_set_complete("add callcenter_config tier del"); + switch_console_set_complete("add callcenter_config tier reload"); switch_console_set_complete("add callcenter_config tier set state"); switch_console_set_complete("add callcenter_config tier set level"); switch_console_set_complete("add callcenter_config tier set position"); From bb53175526fd8270276f4901f2edcc4995cfbbb4 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Fri, 29 Nov 2013 22:16:49 -0600 Subject: [PATCH 38/51] FS-6010 --resolve --- libs/apr/atomic/win32/apr_atomic.c | 18 ++++++++++++++++++ libs/esl/src/esl_event.c | 2 +- libs/ilbc/src/iLBC_decode.c | 2 ++ libs/libsndfile/src/float_cast.h | 2 ++ libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c | 2 ++ libs/sofia-sip/libsofia-sip-ua/su/strtoull.c | 7 ++++++- libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c | 2 ++ libs/spandsp/src/msvc/config.h | 2 ++ libs/spandsp/src/spandsp/fast_convert.h | 4 ++++ src/switch_time.c | 2 +- 10 files changed, 40 insertions(+), 3 deletions(-) diff --git a/libs/apr/atomic/win32/apr_atomic.c b/libs/apr/atomic/win32/apr_atomic.c index 9393fcb008..18a7bcd0ba 100644 --- a/libs/apr/atomic/win32/apr_atomic.c +++ b/libs/apr/atomic/win32/apr_atomic.c @@ -27,6 +27,7 @@ APR_DECLARE(apr_status_t) apr_atomic_init(apr_pool_t *p) * Remapping function pointer type to accept apr_uint32_t's type-safely * as the arguments for as our apr_atomic_foo32 Functions */ +#if (_MSC_VER < 1800) typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_fn) (apr_uint32_t volatile *); typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_fn) @@ -38,11 +39,14 @@ typedef WINBASEAPI apr_uint32_t (WINAPI * apr_atomic_win32_ptr_val_val_fn) typedef WINBASEAPI void * (WINAPI * apr_atomic_win32_ptr_ptr_ptr_fn) (volatile void **, void *, const void *); +#endif APR_DECLARE(apr_uint32_t) apr_atomic_add32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) return InterlockedExchangeAdd(mem, val); +#elif (_MSC_VER >= 1800) + return InterlockedExchangeAdd(mem, val); #else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, val); #endif @@ -55,6 +59,8 @@ APR_DECLARE(void) apr_atomic_sub32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) InterlockedExchangeAdd(mem, -val); +#elif (_MSC_VER >= 1800) + InterlockedExchangeAdd(mem, -val); #else ((apr_atomic_win32_ptr_val_fn)InterlockedExchangeAdd)(mem, -val); #endif @@ -65,6 +71,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_inc32(volatile apr_uint32_t *mem) /* we return old value, win32 returns new value :( */ #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedIncrement(mem) - 1; +#elif (_MSC_VER >= 1800) + return InterlockedIncrement(mem) - 1; #else return ((apr_atomic_win32_ptr_fn)InterlockedIncrement)(mem) - 1; #endif @@ -74,6 +82,8 @@ APR_DECLARE(int) apr_atomic_dec32(volatile apr_uint32_t *mem) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedDecrement(mem); +#elif (_MSC_VER >= 1800) + return InterlockedDecrement(mem); #else return ((apr_atomic_win32_ptr_fn)InterlockedDecrement)(mem); #endif @@ -83,6 +93,8 @@ APR_DECLARE(void) apr_atomic_set32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) InterlockedExchange(mem, val); +#elif (_MSC_VER >= 1800) + InterlockedExchange(mem, val); #else ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif @@ -98,6 +110,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchange(mem, with, cmp); +#elif (_MSC_VER >= 1800) + return InterlockedCompareExchange(mem, with, cmp); #else return ((apr_atomic_win32_ptr_val_val_fn)InterlockedCompareExchange)(mem, with, cmp); #endif @@ -107,6 +121,8 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedCompareExchangePointer(mem, with, cmp); +#elif (_MSC_VER >= 1800) + return InterlockedCompareExchangePointer(mem, with, cmp); #else /* Too many VC6 users have stale win32 API files, stub this */ return ((apr_atomic_win32_ptr_ptr_ptr_fn)InterlockedCompareExchange)(mem, with, cmp); @@ -117,6 +133,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) return InterlockedExchange(mem, val); +#elif (_MSC_VER >= 1800) + return InterlockedExchange(mem, val); #else return ((apr_atomic_win32_ptr_val_fn)InterlockedExchange)(mem, val); #endif diff --git a/libs/esl/src/esl_event.c b/libs/esl/src/esl_event.c index b5a6be4d58..41f4f9f0ac 100644 --- a/libs/esl/src/esl_event.c +++ b/libs/esl/src/esl_event.c @@ -308,7 +308,7 @@ ESL_DECLARE(esl_status_t) esl_event_del_header_val(esl_event_t *event, const cha esl_assert(x < 1000000); hash = esl_ci_hashfunc_default(header_name, &hlen); - if ((!hp->hash || hash == hp->hash) && (hp->name && !strcasecmp(header_name, hp->name)) && (esl_strlen_zero(val) || !strcmp(hp->value, val))) { + if ((!hp->hash || hash == hp->hash) && (hp->name && !strcasecmp(header_name, hp->name)) && (esl_strlen_zero(val) || (hp->value && !strcmp(hp->value, val)))) { if (lp) { lp->next = hp->next; } else { diff --git a/libs/ilbc/src/iLBC_decode.c b/libs/ilbc/src/iLBC_decode.c index 9fc7a24bb4..ddc164bed8 100644 --- a/libs/ilbc/src/iLBC_decode.c +++ b/libs/ilbc/src/iLBC_decode.c @@ -40,6 +40,7 @@ #include "hpOutput.h" #include "syntFilter.h" +#if (defined(WIN32) || defined(_WIN32)) && (_MSC_VER < 1800) #if (defined(WIN32) || defined(_WIN32)) && !defined(_WIN64) __inline long int rint(double dbl) { @@ -63,6 +64,7 @@ #endif } #endif +#endif /*----------------------------------------------------------------* * Initiation of decoder instance. diff --git a/libs/libsndfile/src/float_cast.h b/libs/libsndfile/src/float_cast.h index 2c06aaf233..98c7de74b1 100644 --- a/libs/libsndfile/src/float_cast.h +++ b/libs/libsndfile/src/float_cast.h @@ -158,6 +158,7 @@ } #elif defined(_WIN64) +#if (_MSC_VER < 1800) __inline long int lrint(double x) { return (long int) (x); @@ -166,6 +167,7 @@ { return (long int) (x); } +#endif #elif (defined (__MWERKS__) && defined (macintosh)) /* This MacOS 9 solution was provided by Stephane Letz */ diff --git a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c index 7877100978..f29d7139bb 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c +++ b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c @@ -1808,8 +1808,10 @@ static int parse_ul(sdp_parser_t *p, char **r, } #if !HAVE_STRTOULL +#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800)) unsigned long long strtoull(char const *string, char **return_end, int base); #endif +#endif /* * parse_ull: parse an unsigned long long diff --git a/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c b/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c index c4854aaeac..824a39df43 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/strtoull.c @@ -73,7 +73,10 @@ static char cvtIn[] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; - + + +#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800)) + /**Convert an ASCII string into an unsigned long long integer. * * @param[in] string String of ASCII digits, possibly preceded by white @@ -284,3 +287,5 @@ strtoull(const char *string, char **endPtr, int base) return (unsigned longlong)-1; } + +#endif diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c b/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c index 65037c2d18..431a2dcb56 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_taglist.c @@ -60,8 +60,10 @@ #include #ifndef HAVE_STRTOULL +#if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800)) unsigned longlong strtoull(const char *, char **, int); #endif +#endif /**@defgroup su_tag Tag Item Lists * diff --git a/libs/spandsp/src/msvc/config.h b/libs/spandsp/src/msvc/config.h index 876f66f56a..c974d7c7c4 100644 --- a/libs/spandsp/src/msvc/config.h +++ b/libs/spandsp/src/msvc/config.h @@ -74,7 +74,9 @@ #define _MMX_H_ + #if !((defined(WIN32) || defined(_WIN32)) && (_MSC_VER >= 1800)) #define cbrtf(value) pow((float)value, (float).333) + #endif #include // To get alloca diff --git a/libs/spandsp/src/spandsp/fast_convert.h b/libs/spandsp/src/spandsp/fast_convert.h index e6da451f9c..120050646f 100644 --- a/libs/spandsp/src/spandsp/fast_convert.h +++ b/libs/spandsp/src/spandsp/fast_convert.h @@ -247,6 +247,7 @@ extern "C" * Therefore implement inline versions of these functions here. */ +#if (_MSC_VER < 1800) __inline long int lrint(double x) { long int i; @@ -288,6 +289,7 @@ extern "C" frndint } } +#endif __inline long int lfastrint(double x) { @@ -317,6 +319,7 @@ extern "C" /* x86_64 machines will do best with a simple assignment. */ #include +#if (_MSC_VER < 1800) __inline long int lrint(double x) { return (long int)_mm_cvtsd_si64x( _mm_loadu_pd ((const double*)&x) ); @@ -326,6 +329,7 @@ extern "C" { return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) ); } +#endif __inline long int lfastrint(double x) { diff --git a/src/switch_time.c b/src/switch_time.c index c4b6b8b445..63152aac31 100644 --- a/src/switch_time.c +++ b/src/switch_time.c @@ -756,7 +756,7 @@ static switch_status_t timer_step(switch_timer_t *timer) } check_roll(); - samples = timer->samples * (private_info->reference - private_info->start); + samples = (uint64_t)timer->samples * (private_info->reference - private_info->start); if (samples > UINT32_MAX) { private_info->start = private_info->reference - 1; /* Must have a diff */ From 4e6852fd88f40332c3c9bdb3e5958f2c85a02b2c Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Fri, 29 Nov 2013 22:23:08 -0600 Subject: [PATCH 39/51] FS-5989 --resolve --- src/mod/applications/mod_avmd/mod_avmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_avmd/mod_avmd.c b/src/mod/applications/mod_avmd/mod_avmd.c index 15f954b326..68c72755fc 100644 --- a/src/mod/applications/mod_avmd/mod_avmd.c +++ b/src/mod/applications/mod_avmd/mod_avmd.c @@ -539,7 +539,7 @@ static void avmd_process(avmd_session_t *session, switch_frame_t *frame) /*! If variance is less than threshold then we have detection */ if(v < VARIANCE_THRESHOLD){ - switch_channel_execute_on(switch_core_session_get_channel(session), "execute_on_avmd_beep"); + switch_channel_execute_on(switch_core_session_get_channel(session->session), "execute_on_avmd_beep"); /*! Throw an event to FreeSWITCH */ status = switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, AVMD_EVENT_BEEP); From ae99177598736a21fda7b48018ce9ed9748ae8c4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 30 Nov 2013 19:13:49 -0600 Subject: [PATCH 40/51] add more range to saved candidates and fix off-by-one error when total is met --- src/include/switch_rtp.h | 2 +- src/switch_core_media.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index ca0b3f3b8d..82dde7a798 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -96,7 +96,7 @@ typedef struct icand_s { uint8_t ready; } icand_t; -#define MAX_CAND 25 +#define MAX_CAND 50 typedef struct ice_s { icand_t cands[MAX_CAND][2]; diff --git a/src/switch_core_media.c b/src/switch_core_media.c index a8336dd03b..8008e0ccee 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -2332,6 +2332,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_ data = switch_core_session_strdup(smh->session, attr->a_value); argc = switch_split(data, ' ', fields); + + engine->ice_in.cand_idx++; if (argc < 5 || engine->ice_in.cand_idx >= MAX_CAND) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Invalid data\n"); @@ -2349,8 +2351,6 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_ "Checking Candidate cid: %d proto: %s type: %s addr: %s:%s\n", cid+1, fields[2], fields[7], fields[4], fields[5]); - engine->ice_in.cand_idx++; - for (i = 0; i < engine->cand_acl_count; i++) { if (!engine->ice_in.chosen[cid] && switch_check_network_list_ip(fields[4], engine->cand_acl[i])) { engine->ice_in.chosen[cid] = engine->ice_in.cand_idx; From d050d9ef3caf0d086d36c56add4c571709e62ff7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 30 Nov 2013 19:26:12 -0600 Subject: [PATCH 41/51] FS-6012 --resolve --- src/mod/applications/mod_spandsp/udptl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_spandsp/udptl.c b/src/mod/applications/mod_spandsp/udptl.c index 45fa6b6ffc..553e4135e3 100644 --- a/src/mod/applications/mod_spandsp/udptl.c +++ b/src/mod/applications/mod_spandsp/udptl.c @@ -170,8 +170,8 @@ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len) int count; int total_count; int seq_no; - const uint8_t *msg; - const uint8_t *data; + const uint8_t *msg = NULL; + const uint8_t *data = NULL; int msg_len; int repaired[16]; const uint8_t *bufs[16] = {0}; From 2f7ed973ed98a2ba3ce3a868da6ea065c470828a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 30 Nov 2013 20:49:59 -0600 Subject: [PATCH 42/51] separate read mutex for each stream type --- src/switch_core_media.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 8008e0ccee..80dcec3cc7 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -140,7 +140,7 @@ typedef struct switch_rtp_engine_s { struct media_helper mh; switch_thread_t *media_thread; - switch_mutex_t *read_mutex; + switch_mutex_t *read_mutex[2]; uint8_t reset_codec; uint8_t codec_negotiated; @@ -1427,7 +1427,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session return SWITCH_STATUS_FALSE; } - if (switch_mutex_trylock(engine->read_mutex) != SWITCH_STATUS_SUCCESS) { + if (engine->read_mutex[type] && switch_mutex_trylock(engine->read_mutex[type]) != SWITCH_STATUS_SUCCESS) { /* return CNG, another thread is already reading */ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG1, "%s is already being read for %s\n", switch_channel_get_name(session->channel), type2str(type)); @@ -1759,7 +1759,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session end: - switch_mutex_unlock(engine->read_mutex); + if (engine->read_mutex[type]) { + switch_mutex_unlock(engine->read_mutex[type]); + } return status; } @@ -3853,7 +3855,7 @@ static switch_status_t start_video_thread(switch_core_session_t *session) switch_thread_cond_create(&v_engine->mh.cond, pool); switch_mutex_init(&v_engine->mh.cond_mutex, SWITCH_MUTEX_NESTED, pool); - switch_mutex_init(&v_engine->read_mutex, SWITCH_MUTEX_NESTED, pool); + switch_mutex_init(&v_engine->read_mutex[SWITCH_MEDIA_TYPE_VIDEO], SWITCH_MUTEX_NESTED, pool); switch_thread_create(&v_engine->media_thread, thd_attr, video_helper_thread, &v_engine->mh, switch_core_session_get_pool(session)); return SWITCH_STATUS_SUCCESS; @@ -4665,7 +4667,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi uint8_t inb = switch_channel_direction(session->channel) == SWITCH_CALL_DIRECTION_INBOUND; const char *ssrc; - switch_mutex_init(&a_engine->read_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); + switch_mutex_init(&a_engine->read_mutex[SWITCH_MEDIA_TYPE_AUDIO], SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); //switch_core_media_set_rtp_session(session, SWITCH_MEDIA_TYPE_AUDIO, a_engine->rtp_session); From a0e2fc0342d91f27e53186966d3f2ce5d885b38e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 30 Nov 2013 21:02:52 -0600 Subject: [PATCH 43/51] swigall --- src/mod/languages/mod_managed/freeswitch_wrap.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 4d4750877c..ea1a306269 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -36574,7 +36574,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MAX_CAND_get() { int jresult ; int result; - result = (int) 25; + result = (int) 50; jresult = result; return jresult; @@ -36591,7 +36591,7 @@ SWIGEXPORT void SWIGSTDCALL CSharp_ice_t_cands_set(void * jarg1, void * jarg2) { icand_t (*inp)[2] = (icand_t (*)[2])(arg2); icand_t (*dest)[2] = (icand_t (*)[2])(arg1->cands); size_t ii = 0; - for (; ii < 25; ++ii) { + for (; ii < 50; ++ii) { icand_t *ip = inp[ii]; icand_t *dp = dest[ii]; size_t jj = 0; From 2b60308891696bc4089a21dc58264e254067ff5e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 1 Dec 2013 02:53:27 -0600 Subject: [PATCH 44/51] redo --- src/switch_core_media.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/switch_core_media.c b/src/switch_core_media.c index 80dcec3cc7..cc960c886d 100644 --- a/src/switch_core_media.c +++ b/src/switch_core_media.c @@ -2334,10 +2334,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_ data = switch_core_session_strdup(smh->session, attr->a_value); argc = switch_split(data, ' ', fields); - - engine->ice_in.cand_idx++; - if (argc < 5 || engine->ice_in.cand_idx >= MAX_CAND) { + if (argc < 5 || engine->ice_in.cand_idx >= MAX_CAND - 1) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Invalid data\n"); continue; } @@ -2353,6 +2351,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_ "Checking Candidate cid: %d proto: %s type: %s addr: %s:%s\n", cid+1, fields[2], fields[7], fields[4], fields[5]); + engine->ice_in.cand_idx++; + for (i = 0; i < engine->cand_acl_count; i++) { if (!engine->ice_in.chosen[cid] && switch_check_network_list_ip(fields[4], engine->cand_acl[i])) { engine->ice_in.chosen[cid] = engine->ice_in.cand_idx; From e127ca7d4022c10cfa100afb080e14a0aa795111 Mon Sep 17 00:00:00 2001 From: Robert Jongbloed Date: Tue, 3 Dec 2013 09:48:06 +1100 Subject: [PATCH 45/51] Updated to current stable version of PTLib/OPAL. --- src/mod/endpoints/mod_opal/mod_opal.cpp | 2 +- src/mod/endpoints/mod_opal/mod_opal.h | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) mode change 100644 => 100755 src/mod/endpoints/mod_opal/mod_opal.cpp mode change 100644 => 100755 src/mod/endpoints/mod_opal/mod_opal.h diff --git a/src/mod/endpoints/mod_opal/mod_opal.cpp b/src/mod/endpoints/mod_opal/mod_opal.cpp old mode 100644 new mode 100755 index 6f0fb3addd..7d97c29b51 --- a/src/mod/endpoints/mod_opal/mod_opal.cpp +++ b/src/mod/endpoints/mod_opal/mod_opal.cpp @@ -1031,7 +1031,7 @@ switch_status_t FSConnection::receive_message(switch_core_session_message_t *msg { PTRACE(2, "mod_opal\tRequesting switch to T.38"); PSafePtr other = GetOtherPartyConnection(); - if (other != NULL && other->SwitchT38(true)) + if (other != NULL && other->SwitchFaxMediaStreams(true)) switch_channel_set_flag(m_fsChannel, CF_REQ_MEDIA); else { PTRACE(1, "mod_opal\tMode change request to T.38 failed"); diff --git a/src/mod/endpoints/mod_opal/mod_opal.h b/src/mod/endpoints/mod_opal/mod_opal.h old mode 100644 new mode 100755 index 7b3993b0b2..4b0cd62a02 --- a/src/mod/endpoints/mod_opal/mod_opal.h +++ b/src/mod/endpoints/mod_opal/mod_opal.h @@ -32,13 +32,17 @@ #endif #include +#include -#if !defined(PTLIB_CHECK_VERSION) - #error PTLib is too old to use, must be >= 2.10.6 +#ifndef OPAL_CHECK_VERSION + #define OPAL_CHECK_VERSION(a,b,c) 0 #endif -#include -#include +#if !OPAL_CHECK_VERSION(3,12,8) + #error OPAL is too old to use, must be >= 2.12.8 +#endif + +#include #include #include @@ -53,11 +57,8 @@ #define MODNAME "mod_opal" -#ifndef OPAL_CHECK_VERSION - #define OPAL_CHECK_VERSION(a,b,c) 0 -#endif +#define HAVE_T38 OPAL_T38_CAPABILITY -#define HAVE_T38 (OPAL_CHECK_VERSION(3,11,2) && OPAL_T38_CAPABILITY) class FSEndPoint; From 70accd9f272472ac2081283f1927d901b409acb6 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 4 Dec 2013 17:46:02 -0600 Subject: [PATCH 46/51] FS-5997 --resolve --- src/switch_ivr_originate.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index a284bfc036..0afad2ba2a 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -130,6 +130,7 @@ typedef struct { typedef enum { + IDX_XFER = -5, IDX_KEY_CANCEL = -4, IDX_TIMEOUT = -3, IDX_CANCEL = -2, @@ -3358,7 +3359,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_channel_set_flag(peer_channel, CF_LAZY_ATTENDED_TRANSFER); switch_ivr_uuid_bridge(holding, switch_core_session_get_uuid(peer_session)); holding = NULL; - oglobals.idx = IDX_NADA; + oglobals.idx = IDX_XFER; if (caller_channel && switch_channel_up_nosig(caller_channel) && !switch_channel_test_flag(caller_channel, CF_INTERCEPTED)) { switch_channel_hangup(caller_channel, SWITCH_CAUSE_ATTENDED_TRANSFER); } @@ -3668,8 +3669,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } else if (oglobals.idx == IDX_TIMEOUT) { *cause = SWITCH_CAUSE_NO_ANSWER; } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, - "Originate Resulted in Error Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause)); + if (oglobals.idx == IDX_XFER) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, + "Originate Resulted in Attended Transfer Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause)); + goto outer_for; + } else { + + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(oglobals.session), SWITCH_LOG_DEBUG, + "Originate Resulted in Error Cause: %d [%s]\n", *cause, switch_channel_cause2str(*cause)); + } } } From 4a2054a9515191784181019aa17409413c4e7ab3 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Wed, 4 Dec 2013 20:18:09 -0500 Subject: [PATCH 47/51] mod_rayo: doh- fix adhearsionconf core dump --- src/mod/event_handlers/mod_rayo/mod_rayo.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_rayo/mod_rayo.c b/src/mod/event_handlers/mod_rayo/mod_rayo.c index 6d95d28885..a6b749a869 100644 --- a/src/mod/event_handlers/mod_rayo/mod_rayo.c +++ b/src/mod/event_handlers/mod_rayo/mod_rayo.c @@ -3936,10 +3936,15 @@ static int presence_api(char *cmd, switch_stream_handle_t *stream) SWITCH_STANDARD_API(rayo_api) { struct rayo_cmd_alias *alias; - char *cmd_dup = strdup(cmd); + char *cmd_dup = NULL; char *argv[2] = { 0 }; int success = 0; + if (zstr(cmd) ) { + goto done; + } + + cmd_dup = strdup(cmd); switch_separate_string(cmd_dup, ' ', argv, sizeof(argv) / sizeof(argv[0])); /* check if a command alias */ @@ -3957,11 +3962,12 @@ SWITCH_STANDARD_API(rayo_api) success = presence_api(argv[1], stream); } +done: if (!success) { stream->write_function(stream, "-ERR: USAGE %s\n", RAYO_API_SYNTAX); } - free(cmd_dup); + switch_safe_free(cmd_dup); return SWITCH_STATUS_SUCCESS; } From 7d6b0e48b76c74b519233c30d76264e8ef078f31 Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Thu, 5 Dec 2013 13:34:25 +0800 Subject: [PATCH 48/51] Added an XML script to the FAX tests which will provoke the crashing issue seen recently in spandsp's FAX engine. The next step is to fix the actual crash. --- libs/spandsp/spandsp/fax-tests.xml | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/libs/spandsp/spandsp/fax-tests.xml b/libs/spandsp/spandsp/fax-tests.xml index e770e244b8..82a3e1490d 100644 --- a/libs/spandsp/spandsp/fax-tests.xml +++ b/libs/spandsp/spandsp/fax-tests.xml @@ -87,6 +87,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9edbbd9c61efedc60830f66a0c2d66812886ad6e Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Thu, 5 Dec 2013 21:10:57 +0800 Subject: [PATCH 49/51] Tweaks to FAX modem handling. These do NOT fix the occassional crashes people see, but they are working towards a clean and complete fix. --- libs/spandsp/spandsp/fax-tests.xml | 2 +- libs/spandsp/spandsp/tsb85.xml | 2 +- libs/spandsp/src/fax.c | 8 + libs/spandsp/src/fax_modems.c | 28 +++- libs/spandsp/src/libspandsp.2005.sln | 68 -------- libs/spandsp/src/libspandsp.2008.sln | 209 ------------------------ libs/spandsp/tests/tsb85_extra_tests.sh | 2 +- 7 files changed, 33 insertions(+), 286 deletions(-) delete mode 100644 libs/spandsp/src/libspandsp.2005.sln delete mode 100644 libs/spandsp/src/libspandsp.2008.sln diff --git a/libs/spandsp/spandsp/fax-tests.xml b/libs/spandsp/spandsp/fax-tests.xml index 82a3e1490d..23f333a396 100644 --- a/libs/spandsp/spandsp/fax-tests.xml +++ b/libs/spandsp/spandsp/fax-tests.xml @@ -163,7 +163,7 @@ - + diff --git a/libs/spandsp/spandsp/tsb85.xml b/libs/spandsp/spandsp/tsb85.xml index 8826098946..482e18b989 100644 --- a/libs/spandsp/spandsp/tsb85.xml +++ b/libs/spandsp/spandsp/tsb85.xml @@ -423,7 +423,7 @@ - + diff --git a/libs/spandsp/src/fax.c b/libs/spandsp/src/fax.c index 8d8b3b25bc..ddc45a04d8 100644 --- a/libs/spandsp/src/fax.c +++ b/libs/spandsp/src/fax.c @@ -77,6 +77,10 @@ #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" +#if defined(SPANDSP_SUPPORT_V34) +#include "spandsp/bitstream.h" +#include "spandsp/v34.h" +#endif #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" @@ -103,6 +107,10 @@ #include "spandsp/private/fsk.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/v8.h" +#if defined(SPANDSP_SUPPORT_V34) +#include "spandsp/private/bitstream.h" +#include "spandsp/private/v34.h" +#endif #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" diff --git a/libs/spandsp/src/fax_modems.c b/libs/spandsp/src/fax_modems.c index e298f4d70a..14f4db0fe3 100644 --- a/libs/spandsp/src/fax_modems.c +++ b/libs/spandsp/src/fax_modems.c @@ -5,7 +5,7 @@ * * Written by Steve Underwood * - * Copyright (C) 2003, 2005, 2006, 2008 Steve Underwood + * Copyright (C) 2003, 2005, 2006, 2008, 2013 Steve Underwood * * All rights reserved. * @@ -139,6 +139,12 @@ SPAN_DECLARE(const char *) fax_modem_to_str(int modem) return "V.27ter Rx"; case FAX_MODEM_V29_RX: return "V.29 Rx"; +#if defined(SPANDSP_SUPPORT_V34) + case FAX_MODEM_V34_TX: + return "V.34 HDX Tx"; + case FAX_MODEM_V34_RX: + return "V.34 HDX Rx"; +#endif } /*endswitch*/ return "???"; @@ -150,8 +156,8 @@ static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; - if (ok) - s->rx_frame_received = false; + if (len >= 0 && ok) + s->rx_frame_received = true; if (s->hdlc_accept) s->hdlc_accept(s->hdlc_accept_user_data, msg, len, ok); } @@ -322,7 +328,7 @@ SPAN_DECLARE(void) fax_modems_start_slow_modem(fax_modems_state_t *s, int which) fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx); fax_modems_set_rx_handler(s, (span_rx_handler_t) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t) &fsk_rx_fillin, &s->v21_rx); fsk_rx_signal_cutoff(&s->v21_rx, -39.09f); - s->rx_frame_received = false; + //hdlc_rx_init(&s->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s); break; case FAX_MODEM_CED_TONE_RX: modem_connect_tones_rx_init(&s->connect_rx, MODEM_CONNECT_TONES_FAX_CED, s->tone_callback, s->tone_callback_user_data); @@ -348,6 +354,8 @@ SPAN_DECLARE(void) fax_modems_start_slow_modem(fax_modems_state_t *s, int which) fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); break; } + /*endswitch*/ + s->rx_frame_received = false; } /*- End of function --------------------------------------------------------*/ @@ -365,6 +373,7 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, get_bit_user_data = (void *) &s->hdlc_tx; put_bit = (put_bit_func_t) hdlc_rx_put_bit; put_bit_user_data = (void *) &s->hdlc_rx; + //hdlc_rx_init(&s->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, s); } else { @@ -382,8 +391,6 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, s->current_rx_type = which; s->short_train = false; s->fast_modem = which; - if (hdlc_mode) - s->rx_frame_received = false; switch (s->fast_modem) { case FAX_MODEM_V27TER_RX: @@ -417,6 +424,14 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, fax_modems_set_tx_handler(s, (span_tx_handler_t) &v17_tx, &s->fast_modems.v17_tx); fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); break; +#if defined(SPANDSP_SUPPORT_V34) + case FAX_MODEM_V34_RX: + v34_init(&s->fast_modems.v34, 2400, s->bit_rate, true, false, NULL, NULL, put_bit, put_bit_user_data); + break; + case FAX_MODEM_V34_TX: + v34_init(&s->fast_modems.v34, 2400, s->bit_rate, true, false, get_bit, get_bit_user_data, NULL, NULL); + break; +#endif } /*endswitch*/ } @@ -465,6 +480,7 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, /*endswitch*/ } /*endif*/ + s->rx_frame_received = false; } /*- End of function --------------------------------------------------------*/ diff --git a/libs/spandsp/src/libspandsp.2005.sln b/libs/spandsp/src/libspandsp.2005.sln deleted file mode 100644 index 0aa47bda59..0000000000 --- a/libs/spandsp/src/libspandsp.2005.sln +++ /dev/null @@ -1,68 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2005.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2005.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.2005.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" - ProjectSection(ProjectDependencies) = postProject - {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} - {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp_sim", "..\spandsp-sim\libspandsp_sim.2005.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" - ProjectSection(ProjectDependencies) = postProject - {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} - {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2005.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}" - ProjectSection(ProjectDependencies) = postProject - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "msvc\Download_TIFF.2005.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - All|Win32 = All|Win32 - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.Build.0 = Release|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.Build.0 = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.Build.0 = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.Build.0 = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.Build.0 = All|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libs/spandsp/src/libspandsp.2008.sln b/libs/spandsp/src/libspandsp.2008.sln deleted file mode 100644 index 7a0323998b..0000000000 --- a/libs/spandsp/src/libspandsp.2008.sln +++ /dev/null @@ -1,209 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2008.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2008.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.2008.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" - ProjectSection(ProjectDependencies) = postProject - {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} - {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_line_models", "..\spandsp-sim\msvc\make_line_models.2008.vcproj", "{F290BADE-82DE-4037-B49D-D563E43169DA}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp_sim", "..\spandsp-sim\libspandsp_sim.2008.vcproj", "{502F1E51-F0A0-4607-AB7F-05BAB530AAE1}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2008.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}" - ProjectSection(ProjectDependencies) = postProject - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "msvc\Download_TIFF.2008.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_core_tests", "..\tests\msvc\t38_core_tests.vcproj", "{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_non_ecm_buffer_tests", "..\tests\msvc\t38_non_ecm_buffer_tests.vcproj", "{80A3D9D9-3846-4DA5-8676-F940D725EA62}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_int_tests", "..\tests\msvc\vector_int_tests.vcproj", "{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_float_tests", "..\tests\msvc\vector_float_tests.vcproj", "{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_tests", "..\tests\msvc\complex_tests.vcproj", "{A349379F-0FEA-49C8-9535-05F39663337B}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_float_tests", "..\tests\msvc\complex_vector_float_tests.vcproj", "{2B0D705C-1CF2-401C-BFBC-A43FB806908C}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_int_tests", "..\tests\msvc\complex_vector_int_tests.vcproj", "{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}" - ProjectSection(ProjectDependencies) = postProject - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - All|Win32 = All|Win32 - All|x64 = All|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32 - {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|x64.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32 - {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.ActiveCfg = All|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.ActiveCfg = Release|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.Build.0 = Release|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.ActiveCfg = Debug|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.Build.0 = Debug|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.ActiveCfg = Release|x64 - {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.Build.0 = Release|x64 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|Win32.ActiveCfg = Release|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|Win32.Build.0 = Release|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|x64.ActiveCfg = Release|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|Win32.ActiveCfg = Debug|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|Win32.Build.0 = Debug|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|x64.ActiveCfg = Debug|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|Win32.ActiveCfg = Release|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|Win32.Build.0 = Release|Win32 - {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|x64.ActiveCfg = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.ActiveCfg = Release|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.Build.0 = Release|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.ActiveCfg = Debug|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.Build.0 = Debug|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.ActiveCfg = Release|x64 - {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.Build.0 = Release|x64 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.Build.0 = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|x64.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.Build.0 = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|x64.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.ActiveCfg = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.Build.0 = All|Win32 - {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|x64.ActiveCfg = All|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.ActiveCfg = Release|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.Build.0 = Release|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|x64.ActiveCfg = Release|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.ActiveCfg = Debug|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.Build.0 = Debug|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|x64.ActiveCfg = Debug|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.ActiveCfg = Release|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.Build.0 = Release|Win32 - {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|x64.ActiveCfg = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.ActiveCfg = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.Build.0 = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|x64.ActiveCfg = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.ActiveCfg = Debug|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.Build.0 = Debug|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|x64.ActiveCfg = Debug|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.ActiveCfg = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.Build.0 = Release|Win32 - {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|x64.ActiveCfg = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.ActiveCfg = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.Build.0 = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|x64.ActiveCfg = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.ActiveCfg = Debug|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.Build.0 = Debug|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|x64.ActiveCfg = Debug|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.ActiveCfg = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.Build.0 = Release|Win32 - {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|x64.ActiveCfg = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.ActiveCfg = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.Build.0 = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|x64.ActiveCfg = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.ActiveCfg = Debug|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.Build.0 = Debug|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|x64.ActiveCfg = Debug|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.ActiveCfg = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.Build.0 = Release|Win32 - {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|x64.ActiveCfg = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.ActiveCfg = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.Build.0 = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.All|x64.ActiveCfg = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.ActiveCfg = Debug|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.Build.0 = Debug|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|x64.ActiveCfg = Debug|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.ActiveCfg = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.Build.0 = Release|Win32 - {A349379F-0FEA-49C8-9535-05F39663337B}.Release|x64.ActiveCfg = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.ActiveCfg = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.Build.0 = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|x64.ActiveCfg = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.ActiveCfg = Debug|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.Build.0 = Debug|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|x64.ActiveCfg = Debug|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.ActiveCfg = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.Build.0 = Release|Win32 - {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|x64.ActiveCfg = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.ActiveCfg = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.Build.0 = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|x64.ActiveCfg = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.ActiveCfg = Debug|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.Build.0 = Debug|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|x64.ActiveCfg = Debug|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.ActiveCfg = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.Build.0 = Release|Win32 - {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|x64.ActiveCfg = Release|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.All|Win32.ActiveCfg = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.All|Win32.Build.0 = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.All|x64.ActiveCfg = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|Win32.ActiveCfg = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|Win32.Build.0 = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|x64.ActiveCfg = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|Win32.ActiveCfg = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|Win32.Build.0 = All|Win32 - {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|x64.ActiveCfg = All|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/libs/spandsp/tests/tsb85_extra_tests.sh b/libs/spandsp/tests/tsb85_extra_tests.sh index 2d64fb05b4..8aa3b24740 100755 --- a/libs/spandsp/tests/tsb85_extra_tests.sh +++ b/libs/spandsp/tests/tsb85_extra_tests.sh @@ -28,7 +28,7 @@ run_tsb85_test() fi } -for TEST in PPS-MPS-lost-PPS +for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 do run_tsb85_test done From d5a7495a72cd6746a33870f6dbad2d3da634dc8c Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Thu, 5 Dec 2013 21:49:59 +0800 Subject: [PATCH 50/51] This should fix the FAX crashes when negotiation falls back to slower modems --- libs/spandsp/src/fax.c | 3 +-- libs/spandsp/src/fax_modems.c | 19 ++++++++++++++++++- libs/spandsp/src/spandsp/fax_modems.h | 2 ++ libs/spandsp/src/t38_gateway.c | 8 ++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/libs/spandsp/src/fax.c b/libs/spandsp/src/fax.c index ddc45a04d8..196c9ab0d3 100644 --- a/libs/spandsp/src/fax.c +++ b/libs/spandsp/src/fax.c @@ -256,8 +256,7 @@ static void fax_set_rx_type(void *user_data, int type, int bit_rate, int short_t return; t->current_rx_type = type; t->rx_bit_rate = bit_rate; - if (use_hdlc) - hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30); + hdlc_rx_init(&t->hdlc_rx, false, true, HDLC_FRAMING_OK_THRESHOLD, fax_modems_hdlc_accept, t); switch (type) { diff --git a/libs/spandsp/src/fax_modems.c b/libs/spandsp/src/fax_modems.c index 14f4db0fe3..74d71ecc29 100644 --- a/libs/spandsp/src/fax_modems.c +++ b/libs/spandsp/src/fax_modems.c @@ -151,7 +151,8 @@ SPAN_DECLARE(const char *) fax_modem_to_str(int modem) } /*- End of function --------------------------------------------------------*/ -static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) +//static void fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) +SPAN_DECLARE(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { fax_modems_state_t *s; @@ -427,9 +428,13 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, #if defined(SPANDSP_SUPPORT_V34) case FAX_MODEM_V34_RX: v34_init(&s->fast_modems.v34, 2400, s->bit_rate, true, false, NULL, NULL, put_bit, put_bit_user_data); + //fax_modems_set_tx_handler(s, (span_tx_handler_t) &v34_rx, &s->fast_modems.v34_rx); + fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); break; case FAX_MODEM_V34_TX: v34_init(&s->fast_modems.v34, 2400, s->bit_rate, true, false, get_bit, get_bit_user_data, NULL, NULL); + //fax_modems_set_tx_handler(s, (span_tx_handler_t) &v34_tx, &s->fast_modems.v34_tx); + fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); break; #endif } @@ -476,6 +481,18 @@ SPAN_DECLARE(void) fax_modems_start_fast_modem(fax_modems_state_t *s, int which, fax_modems_set_tx_handler(s, (span_tx_handler_t) &v17_tx, &s->fast_modems.v17_tx); fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); break; +#if defined(SPANDSP_SUPPORT_V34) + case FAX_MODEM_V34_RX: + v34_restart(&s->fast_modems.v34, 2400, s->bit_rate, false); + //fax_modems_set_tx_handler(s, (span_tx_handler_t) &v34_rx, &s->fast_modems.v34_rx); + fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); + break; + case FAX_MODEM_V34_TX: + v34_restart(&s->fast_modems.v34, 2400, s->bit_rate, false); + //fax_modems_set_tx_handler(s, (span_tx_handler_t) &v34_tx, &s->fast_modems.v34_tx); + fax_modems_set_next_tx_handler(s, (span_tx_handler_t) NULL, NULL); + break; +#endif } /*endswitch*/ } diff --git a/libs/spandsp/src/spandsp/fax_modems.h b/libs/spandsp/src/spandsp/fax_modems.h index 2ffb7be7c5..3a6adf28c1 100644 --- a/libs/spandsp/src/spandsp/fax_modems.h +++ b/libs/spandsp/src/spandsp/fax_modems.h @@ -59,6 +59,8 @@ extern "C" { #endif +SPAN_DECLARE(void) fax_modems_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok); + /*! Convert a FAX modem type to a short text description. \brief Convert a FAX modem type to a short text description. \param modem The modem code. diff --git a/libs/spandsp/src/t38_gateway.c b/libs/spandsp/src/t38_gateway.c index d89e21e0c4..402c7cded2 100644 --- a/libs/spandsp/src/t38_gateway.c +++ b/libs/spandsp/src/t38_gateway.c @@ -75,6 +75,10 @@ #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" +#if defined(SPANDSP_SUPPORT_V34) +#include "spandsp/bitstream.h" +#include "spandsp/v34.h" +#endif #include "spandsp/super_tone_rx.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/timezone.h" @@ -100,6 +104,10 @@ #include "spandsp/private/silence_gen.h" #include "spandsp/private/power_meter.h" #include "spandsp/private/fsk.h" +#if defined(SPANDSP_SUPPORT_V34) +#include "spandsp/private/bitstream.h" +#include "spandsp/private/v34.h" +#endif #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" From 715731de9ae7f9971c1dd8fc4edc0ac69d61716b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 5 Dec 2013 11:35:33 -0600 Subject: [PATCH 51/51] FS-6026 --resolve --- src/mod/applications/mod_httapi/mod_httapi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 6ae3001804..7c61f52719 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -1473,7 +1473,6 @@ static switch_status_t httapi_sync(client_t *client) if (!put_file) { switch_curl_process_form_post_params(client->params, curl_handle, &formpost); - get_style_method = 1; } if (formpost) {