From 535cfbbd4f7240b356c64417550a8814c7319280 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 13 Apr 2015 15:52:43 -0400 Subject: [PATCH 1/6] FS-7426: #resolve fix typo in control-modules for debian build --- debian/control-modules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control-modules b/debian/control-modules index 852df6d0c9..7a8a966ef1 100644 --- a/debian/control-modules +++ b/debian/control-modules @@ -453,7 +453,7 @@ Build-Depends: libperl-dev ## mod/event_handlers -Module: event_handler/mod_amqp +Module: event_handlers/mod_amqp Description: Event handler to send events to an amqp server AMQP event handler Build-Depends: librabbitmq-dev From 3bbfa9f34108fe65d1fcfac560f7f0977066e602 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 13 Apr 2015 22:54:02 +0000 Subject: [PATCH 2/6] FS-7407: when using proxy, make sure to pick the right transport to the proxy --- src/mod/endpoints/mod_sofia/sofia_presence.c | 48 +++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 7e31b4cfdd..d7255e8bfc 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2201,9 +2201,23 @@ static void _send_presence_notify(sofia_profile_t *profile, path = sofia_glue_get_path_from_contact((char *) o_contact); } - tmp = (char *)o_contact; - o_contact_dup = sofia_glue_get_url_from_contact(tmp, 1); + dst = sofia_glue_get_destination((char *) o_contact); + switch_assert(dst); + if (!zstr(dst->contact)) { + contact = sofia_glue_get_url_from_contact(dst->contact, 1); + } else { + contact = strdup(o_contact); + } + + if (dst->route_uri) { + route_uri = sofia_glue_strip_uri(dst->route_uri); + tmp = (char *)route_uri; + } else { + tmp = (char *)o_contact; + } + + o_contact_dup = sofia_glue_get_url_from_contact(tmp, 1); if ((tp = switch_stristr("transport=", o_contact_dup))) { tp += 10; @@ -2272,19 +2286,6 @@ static void _send_presence_notify(sofia_profile_t *profile, free(to_uri); } - dst = sofia_glue_get_destination((char *) o_contact); - switch_assert(dst); - - if (!zstr(dst->contact)) { - contact = sofia_glue_get_url_from_contact(dst->contact, 1); - } else { - contact = strdup(o_contact); - } - - if (dst->route_uri) { - route_uri = sofia_glue_strip_uri(dst->route_uri); - } - if (expires) { long ltmp = atol(expires); @@ -4023,7 +4024,7 @@ void sofia_presence_handle_sip_i_subscribe(int status, char *sticky = NULL; char *contactstr = profile->url, *cs = NULL; char *p = NULL, *new_contactstr = NULL; - + sofia_transport_t transport; if (np.is_nat) { char params[128] = ""; @@ -4040,20 +4041,23 @@ void sofia_presence_handle_sip_i_subscribe(int status, contactstr = profile->url; } + if (sip->sip_via) { + transport = sofia_glue_via2transport(sip->sip_via); + } else { + transport = sofia_glue_url2transport(contact->m_url); + } - if (switch_stristr("port=tcp", contact->m_url->url_params)) { + if (transport == SOFIA_TRANSPORT_TCP) { if (np.is_auto_nat) { cs = profile->tcp_public_contact; } else { cs = profile->tcp_contact; } - } else if (switch_stristr("port=tls", contact->m_url->url_params)) { + } else if (transport == SOFIA_TRANSPORT_TCP_TLS) { if (np.is_auto_nat) { - cs = sofia_test_pflag(profile, PFLAG_TLS) ? - profile->tls_public_contact : profile->tcp_public_contact; + cs = sofia_test_pflag(profile, PFLAG_TLS) ? profile->tls_public_contact : profile->tcp_public_contact; } else { - cs = sofia_test_pflag(profile, PFLAG_TLS) ? - profile->tls_contact : profile->tcp_contact; + cs = sofia_test_pflag(profile, PFLAG_TLS) ? profile->tls_contact : profile->tcp_contact; } } From 464d8ab91086715a2ec7eb1fb9a2d2cb53377eb7 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 14 Apr 2015 15:46:04 -0500 Subject: [PATCH 3/6] FS-7431 #resolve --- src/mod/formats/mod_tone_stream/mod_tone_stream.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mod/formats/mod_tone_stream/mod_tone_stream.c b/src/mod/formats/mod_tone_stream/mod_tone_stream.c index ffc970adee..90d1fec0cf 100644 --- a/src/mod/formats/mod_tone_stream/mod_tone_stream.c +++ b/src/mod/formats/mod_tone_stream/mod_tone_stream.c @@ -48,10 +48,15 @@ static switch_status_t silence_stream_file_open(switch_file_handle_t *handle, co int ms; char *p; - sh = switch_core_alloc(handle->memory_pool, sizeof(*sh)); - ms = atoi(path); + if (ms == 0) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid Input [%s] Expect [,]\n", path); + return SWITCH_STATUS_FALSE; + } + + sh = switch_core_alloc(handle->memory_pool, sizeof(*sh)); + if (ms > 0) { sh->samples = (handle->samplerate / 1000) * ms; } else { From 5fada4bbb5ec15fb6c4f63bf1f85a24e5fc5c523 Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Tue, 14 Apr 2015 16:49:43 -0400 Subject: [PATCH 4/6] FS-7060 added amqp.conf.xml to freeswitch.spec to fix packaging --- freeswitch.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/freeswitch.spec b/freeswitch.spec index bbcff34cc3..03c6c105fe 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -1805,6 +1805,7 @@ fi %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/abstraction.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/acl.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/alsa.conf.xml +%config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/amqp.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/blacklist.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/callcenter.conf.xml %config(noreplace) %attr(0640, freeswitch, daemon) %{sysconfdir}/autoload_configs/cdr_csv.conf.xml From 6a4c2b3406ff5ef9355b6e61dd60a428dc1b7d86 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 15 Apr 2015 17:00:51 -0500 Subject: [PATCH 5/6] convenience app --- .../applications/mod_dptools/mod_dptools.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index 7d5b1d5277..f184647407 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -627,6 +627,28 @@ SWITCH_STANDARD_APP(rename_function) } } +#define TRANSFER_VARS_SYNTAX "<~variable_prefix|variable>" +SWITCH_STANDARD_APP(transfer_vars_function) +{ + char *argv[1] = { 0 }; + int argc; + char *lbuf = NULL; + + if (!zstr(data) && (lbuf = switch_core_session_strdup(session, data)) + && (argc = switch_separate_string(lbuf, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) { + switch_core_session_t *nsession = NULL; + + switch_core_session_get_partner(session, &nsession); + + if (nsession) { + switch_ivr_transfer_variable(session, nsession, argv[0]); + switch_core_session_rwunlock(nsession); + } else { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", RENAME_SYNTAX); + } + } +} + #define SOFT_HOLD_SYNTAX " [] []" SWITCH_STANDARD_APP(soft_hold_function) { @@ -6004,6 +6026,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load) SWITCH_ADD_APP(app_interface, "media_reset", "Reset all bypass/proxy media flags", "Reset all bypass/proxy media flags", media_reset_function, "", SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "mkdir", "Create a directory", "Create a directory", mkdir_function, MKDIR_SYNTAX, SAF_SUPPORT_NOMEDIA); SWITCH_ADD_APP(app_interface, "rename", "Rename file", "Rename file", rename_function, RENAME_SYNTAX, SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC); + SWITCH_ADD_APP(app_interface, "transfer_vars", "Transfer variables", "Transfer variables", transfer_vars_function, TRANSFER_VARS_SYNTAX, + SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC); SWITCH_ADD_APP(app_interface, "soft_hold", "Put a bridged channel on hold", "Put a bridged channel on hold", soft_hold_function, SOFT_HOLD_SYNTAX, SAF_NONE); SWITCH_ADD_APP(app_interface, "bind_meta_app", "Bind a key to an application", "Bind a key to an application", dtmf_bind_function, BIND_SYNTAX, From 40441413e064a9fdbdefeed2182bb741bebe8cde Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 16 Apr 2015 07:49:54 -0500 Subject: [PATCH 6/6] Typo from previous convenience app commit --- src/mod/applications/mod_dptools/mod_dptools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c index f184647407..a72a6b96af 100644 --- a/src/mod/applications/mod_dptools/mod_dptools.c +++ b/src/mod/applications/mod_dptools/mod_dptools.c @@ -644,7 +644,7 @@ SWITCH_STANDARD_APP(transfer_vars_function) switch_ivr_transfer_variable(session, nsession, argv[0]); switch_core_session_rwunlock(nsession); } else { - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", RENAME_SYNTAX); + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: %s\n", TRANSFER_VARS_SYNTAX); } } }