diff --git a/Makefile.am b/Makefile.am
index 84a01260ce..3a99b52824 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,6 @@ DEFAULT_SOUNDS=en-us-callie-8000
fi; \
fi
-
sounds: sounds-en-us-callie-8000
sounds-install: sounds-en-us-callie-8000-install
sounds-ru: sounds-ru-RU-elena-8000
@@ -72,6 +71,35 @@ cd-moh-install: uhd-moh-install sounds-music-48000-install
all-recursive: libfreeswitch.la
clean-recusive: clean_core
install-recursive: install-libLTLIBRARIES install-binPROGRAMS
+$(RECURSIVE_TARGETS): freeswitch
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; \
+ if test -z "$$fail" ; then \
+ cd $(top_builddir)/build && $(MAKE) $(AM_MAKEFLAGS) $$target || exit 1; \
+ else \
+ exit 1; \
+ fi ;
CORE_CFLAGS = `$(switch_builddir)/libs/apr/apr-1-config --cflags --cppflags --includes`
CORE_CFLAGS += `$(switch_builddir)/libs/apr-util/apu-1-config --includes`
@@ -86,7 +114,7 @@ CORE_CFLAGS += -I$(switch_srcdir)/libs/spandsp/src -I$(switch_srcdir)/libs/tiff-
CORE_LIBS = libs/apr-util/libaprutil-1.la libs/apr/libapr-1.la
CORE_LIBS += libs/sqlite/libsqlite3.la libs/pcre/libpcre.la libs/speex/libspeex/libspeexdsp.la
-CORE_LIBS += libs/sofia-sip/libsofia-sip-ua/sdp/libsdp.la libs/sofia-sip/libsofia-sip-ua/su/libsu.la
+CORE_LIBS += libs/sofia-sip/libsofia-sip-ua/sdp/.libs/libsdp.a libs/sofia-sip/libsofia-sip-ua/su/.libs/libsu.a
if ENABLE_SRTP
CORE_CFLAGS += -DENABLE_SRTP
@@ -420,7 +448,7 @@ libs/libzrtp/projects/gnu/build/libzrtp.a:
libs/sofia-sip/Makefile:
cd libs/sofia-sip && sh ./configure.gnu --prefix=$(prefix)
-libs/sofia-sip/libsofia-sip-ua/sdp/libsdp.la libs/sofia-sip/libsofia-sip-ua/su/libsu.la: libs/sofia-sip/.update libs/sofia-sip/Makefile
+libs/sofia-sip/libsofia-sip-ua/sdp/.libs/libsdp.a libs/sofia-sip/libsofia-sip-ua/su/.libs/libsu.a: libs/sofia-sip/.update libs/sofia-sip/Makefile
@cd libs/sofia-sip && $(MAKE) noop
@cd libs/sofia-sip && $(MAKE) SOFIA_CFLAGS="$(SWITCH_AM_CFLAGS)"
@$(TOUCH_TARGET)
diff --git a/conf/vanilla/autoload_configs/voicemail_ivr.conf.xml b/conf/vanilla/autoload_configs/voicemail_ivr.conf.xml
index 529509a495..1cdf3c222e 100644
--- a/conf/vanilla/autoload_configs/voicemail_ivr.conf.xml
+++ b/conf/vanilla/autoload_configs/voicemail_ivr.conf.xml
@@ -26,6 +26,7 @@
+
@@ -57,11 +58,14 @@
@@ -105,7 +108,7 @@
-
+
@@ -117,7 +120,7 @@
-
+
@@ -132,7 +135,7 @@
-
+
@@ -146,7 +149,7 @@
-
+
diff --git a/conf/vanilla/lang/en/vm/voicemail_ivr.xml b/conf/vanilla/lang/en/vm/voicemail_ivr.xml
index 590026a29d..1c48299430 100644
--- a/conf/vanilla/lang/en/vm/voicemail_ivr.xml
+++ b/conf/vanilla/lang/en/vm/voicemail_ivr.xml
@@ -11,8 +11,8 @@
-
-
+
+
@@ -89,7 +89,7 @@
-
+
@@ -97,7 +97,7 @@
-
+
@@ -105,16 +105,24 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
@@ -264,6 +272,7 @@
+
diff --git a/docs/phrase/phrase_en.xml b/docs/phrase/phrase_en.xml
index f9add503b7..ed4c0d6a75 100644
--- a/docs/phrase/phrase_en.xml
+++ b/docs/phrase/phrase_en.xml
@@ -22,6 +22,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -589,20 +600,32 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -635,6 +658,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h
index 7bdf1e3dd0..e4e8dc7c6f 100644
--- a/src/include/private/switch_core_pvt.h
+++ b/src/include/private/switch_core_pvt.h
@@ -214,8 +214,6 @@ typedef enum {
struct switch_runtime {
switch_time_t initiated;
- switch_time_t mono_initiated;
- switch_time_t mono_reference;
switch_time_t reference;
int64_t offset;
switch_event_t *global_vars;
diff --git a/src/include/switch_core.h b/src/include/switch_core.h
index 68e592b9df..575e4601ae 100644
--- a/src/include/switch_core.h
+++ b/src/include/switch_core.h
@@ -756,7 +756,7 @@ SWITCH_DECLARE(void) switch_core_session_set_dmachine(switch_core_session_t *ses
SWITCH_DECLARE(switch_ivr_dmachine_t *) switch_core_session_get_dmachine(switch_core_session_t *session, switch_digit_action_target_t target);
SWITCH_DECLARE(switch_digit_action_target_t) switch_ivr_dmachine_get_target(switch_ivr_dmachine_t *dmachine);
SWITCH_DECLARE(void) switch_ivr_dmachine_set_target(switch_ivr_dmachine_t *dmachine, switch_digit_action_target_t target);
-
+SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_set_terminators(switch_ivr_dmachine_t *dmachine, const char *terminators);
SWITCH_DECLARE(switch_status_t) switch_core_session_set_codec_slin(switch_core_session_t *session, switch_slin_data_t *data);
/*!
diff --git a/src/mod/applications/mod_dptools/mod_dptools.c b/src/mod/applications/mod_dptools/mod_dptools.c
index e45f7215bc..d90fb29d6a 100755
--- a/src/mod/applications/mod_dptools/mod_dptools.c
+++ b/src/mod/applications/mod_dptools/mod_dptools.c
@@ -336,6 +336,7 @@ static void bind_to_session(switch_core_session_t *session,
struct action_binding *act;
switch_ivr_dmachine_t *dmachine;
switch_channel_t *channel = switch_core_session_get_channel(session);
+ const char *terminators = NULL;
if (!(dmachine = switch_core_session_get_dmachine(session, target))) {
uint32_t digit_timeout = 1500;
@@ -363,6 +364,10 @@ static void bind_to_session(switch_core_session_t *session,
act->target = bind_target;
act->session = session;
switch_ivr_dmachine_bind(dmachine, act->realm, act->input, 0, digit_action_callback, act);
+
+ if ((terminators = switch_channel_get_variable(channel, "bda_terminators"))) {
+ switch_ivr_dmachine_set_terminators(dmachine, terminators);
+ }
}
#define BIND_DIGIT_ACTION_USAGE ",,[,][,][,]"
diff --git a/src/mod/applications/mod_fifo/mod_fifo.c b/src/mod/applications/mod_fifo/mod_fifo.c
index cef4d78be8..75c7006a7d 100644
--- a/src/mod/applications/mod_fifo/mod_fifo.c
+++ b/src/mod/applications/mod_fifo/mod_fifo.c
@@ -2252,7 +2252,7 @@ static void fifo_caller_add(fifo_node_t *node, switch_core_session_t *session)
switch_str_nil(switch_channel_get_variable(channel, "caller_id_number")),
switch_epoch_time_now(NULL));
- fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
+ fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
static void fifo_caller_del(const char *uuid)
@@ -2265,7 +2265,7 @@ static void fifo_caller_del(const char *uuid)
sql = switch_mprintf("delete from fifo_callers");
}
- fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
+ fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
}
@@ -4303,7 +4303,7 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q'", fifo_name, digest);
switch_assert(sql);
- fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
+ fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
switch_mutex_lock(globals.mutex);
@@ -4325,7 +4325,7 @@ static void fifo_member_add(char *fifo_name, char *originate_string, int simo_co
digest, fifo_name, originate_string, simo_count, 0, timeout, lag, 0, (long) expires, globals.hostname, taking_calls,
(long)switch_epoch_time_now(NULL));
switch_assert(sql);
- fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
+ fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
free(name_dup);
cbt.buf = outbound_count;
@@ -4360,7 +4360,7 @@ static void fifo_member_del(char *fifo_name, char *originate_string)
sql = switch_mprintf("delete from fifo_outbound where fifo_name='%q' and uuid = '%q' and hostname='%q'", fifo_name, digest, globals.hostname);
switch_assert(sql);
- fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_FALSE);
+ fifo_execute_sql_queued(&sql, SWITCH_TRUE, SWITCH_TRUE);
switch_mutex_lock(globals.mutex);
if (!(node = switch_core_hash_find(globals.fifo_hash, fifo_name))) {
diff --git a/src/mod/applications/mod_fsv/mod_fsv.c b/src/mod/applications/mod_fsv/mod_fsv.c
index 01160f6f7f..8a7e27c09c 100644
--- a/src/mod/applications/mod_fsv/mod_fsv.c
+++ b/src/mod/applications/mod_fsv/mod_fsv.c
@@ -403,6 +403,15 @@ SWITCH_STANDARD_APP(play_fsv_function)
switch_rtp_hdr_t *hdr = vid_frame.packet;
bytes &= ~VID_BIT;
+ /*
+ * Frame is larger than available buffer space. This error is non-recoverable due to the
+ * structure of the .fsv format (no frame header signature to re-sync).
+ */
+ if (bytes > ((int) vid_frame.buflen + 12)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Corrupt .fsv video frame header is overflowing read buffer, aborting!\n");
+ break;
+ }
+
if ((vid_frame.packetlen = read(fd, vid_frame.packet, bytes)) != (uint32_t) bytes) {
break;
}
@@ -425,10 +434,15 @@ SWITCH_STANDARD_APP(play_fsv_function)
}
last = ts;
} else {
+ /*
+ * Frame is larger than available buffer space. This error is non-recoverable due to the
+ * structure of the .fsv format (no frame header signature to re-sync).
+ */
if (bytes > (int) write_frame.buflen) {
- bytes = write_frame.buflen;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Corrupt .fsv audio frame header is overflowing read buffer, aborting!\n");
+ break;
}
-
+
if ((write_frame.datalen = read(fd, write_frame.data, bytes)) <= 0) {
break;
}
diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c
index 34073260de..cc5fea89eb 100644
--- a/src/mod/applications/mod_httapi/mod_httapi.c
+++ b/src/mod/applications/mod_httapi/mod_httapi.c
@@ -374,6 +374,7 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
const char *action = switch_xml_attr(tag, "action");
const char *digit_timeout_ = switch_xml_attr(tag, "digit-timeout");
const char *input_timeout_ = switch_xml_attr(tag, "input-timeout");
+ const char *terminators = switch_xml_attr(tag, "terminators");
const char *tts_engine = NULL;
const char *tts_voice = NULL;
char *loops_ = (char *) switch_xml_attr(tag, "loops");
@@ -559,6 +560,10 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
}
switch_ivr_dmachine_set_realm(dmachine, realm);
+ if (!zstr(terminators)) {
+ switch_ivr_dmachine_set_terminators(dmachine, terminators);
+ }
+
myargs.dmachine = dmachine;
args = &myargs;
}
@@ -915,6 +920,7 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
const char *action = switch_xml_attr(tag, "action");
const char *sub_action = NULL;
const char *digit_timeout_ = switch_xml_attr(tag, "digit-timeout");
+ const char *terminators = switch_xml_attr(tag, "terminators");
char *loops_ = (char *) switch_xml_attr(tag, "loops");
int loops = 0;
switch_status_t status = SWITCH_STATUS_SUCCESS;
@@ -1032,6 +1038,10 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
}
switch_ivr_dmachine_set_realm(dmachine, realm);
+ if (!zstr(terminators)) {
+ switch_ivr_dmachine_set_terminators(dmachine, terminators);
+ }
+
myargs.dmachine = dmachine;
args = &myargs;
}
diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c
index 195ac3170f..fd1d5856bc 100644
--- a/src/mod/applications/mod_voicemail/mod_voicemail.c
+++ b/src/mod/applications/mod_voicemail/mod_voicemail.c
@@ -3107,6 +3107,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
switch_xml_t ux;
if (switch_xml_locate_user_in_domain(uname, x_domain, &ux, NULL) == SWITCH_STATUS_SUCCESS) {
+ switch_xml_merge_user(ux, x_domain, group);
switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
status =
deliver_vm(profile, ux, domain, path, 0, read_flags, my_params, pool, cid_name, cid_num, forwarded_by,
@@ -3116,6 +3117,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
continue;
}
+ switch_xml_merge_user(ut, x_domain, group);
switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
status = deliver_vm(profile, ut, domain, path, 0, read_flags,
my_params, pool, cid_name, cid_num, forwarded_by, SWITCH_TRUE,
@@ -3139,6 +3141,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
continue;
}
+ switch_xml_merge_user(ut, x_domain, group);
switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
status = deliver_vm(profile, ut, domain, path, 0, read_flags,
my_params, pool, cid_name, cid_num, forwarded_by, SWITCH_TRUE,
@@ -3153,6 +3156,7 @@ static switch_status_t voicemail_inject(const char *data, switch_core_session_t
switch_xml_t x_group = NULL;
if ((status = switch_xml_locate_user_in_domain(user, x_domain, &ut, &x_group)) == SWITCH_STATUS_SUCCESS) {
+ switch_xml_merge_user(ut, x_domain, x_group);
switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
status = deliver_vm(profile, ut, domain, path, 0, read_flags,
my_params, pool, cid_name, cid_num, forwarded_by, SWITCH_TRUE,
@@ -4975,6 +4979,80 @@ done:
return SWITCH_STATUS_SUCCESS;
}
+#define VM_FSDB_PREF_GREETING_GET_USAGE " [slot]"
+SWITCH_STANDARD_API(vm_fsdb_pref_greeting_get_function)
+{
+ /* int slot = -1; not implemented yet */
+ char *sql = NULL;
+ char res[254] = "";
+
+ char *id = NULL, *domain = NULL, *profile_name = NULL;
+ vm_profile_t *profile = NULL;
+
+ char *argv[6] = { 0 };
+ char *mycmd = NULL;
+
+ switch_memory_pool_t *pool;
+
+ switch_core_new_memory_pool(&pool);
+
+ if (!zstr(cmd)) {
+ mycmd = switch_core_strdup(pool, cmd);
+ switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
+ }
+
+ if (argv[1])
+ profile_name = argv[1];
+ if (argv[2])
+ domain = argv[2];
+ if (argv[3])
+ id = argv[3];
+/* if (argv[4])
+ slot = atoi(argv[4]);
+not implemented yet
+*/
+
+ if (!profile_name || !domain || !id) {
+ stream->write_function(stream, "-ERR Missing Arguments\n");
+ goto done;
+ }
+
+ if (!(profile = get_profile(profile_name))) {
+ stream->write_function(stream, "-ERR Profile not found\n");
+ goto done;
+ }
+ sql = switch_mprintf("select greeting_path from voicemail_prefs WHERE domain = '%q' AND username = '%q'", domain, id);
+
+ vm_execute_sql2str(profile, profile->mutex, sql, res, sizeof(res));
+
+ switch_safe_free(sql);
+
+ profile_rwunlock(profile);
+
+ /* TODO If no slot requested, returned currently selected and figure out the slot number from the file name.
+ * IF slot provided, check if file exist, check if it currently selected */
+ if (zstr(res)) {
+ stream->write_function(stream, "-ERR No greeting found\n");
+ } else {
+ switch_event_t *my_params = NULL;
+ char *ebuf = NULL;
+
+ switch_event_create(&my_params, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_event_add_header(my_params, SWITCH_STACK_BOTTOM, "VM-Preference-Greeting-File-Path", "%s", res);
+ switch_event_add_header(my_params, SWITCH_STACK_BOTTOM, "VM-Preference-Greeting-Slot", "%s", "Not Implemented yet");
+ switch_event_add_header(my_params, SWITCH_STACK_BOTTOM, "VM-Preference-Greeting-Selected", "%s", "True");
+ switch_event_serialize_json(my_params, &ebuf);
+ switch_event_destroy(&my_params);
+
+ stream->write_function(stream, "%s", ebuf);
+ switch_safe_free(ebuf);
+
+ }
+done:
+ switch_core_destroy_memory_pool(&pool);
+ return SWITCH_STATUS_SUCCESS;
+}
+
#define VM_FSDB_PREF_RECNAME_SET_USAGE " "
SWITCH_STANDARD_API(vm_fsdb_pref_recname_set_function)
{
@@ -5961,6 +6039,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voicemail_load)
/* Preferences */
SWITCH_ADD_API(commands_api_interface, "vm_fsdb_pref_greeting_set", "vm_fsdb_pref_greeting_set", vm_fsdb_pref_greeting_set_function, VM_FSDB_PREF_GREETING_SET_USAGE);
+ SWITCH_ADD_API(commands_api_interface, "vm_fsdb_pref_greeting_get", "vm_fsdb_pref_greeting_get", vm_fsdb_pref_greeting_get_function, VM_FSDB_PREF_GREETING_GET_USAGE);
SWITCH_ADD_API(commands_api_interface, "vm_fsdb_pref_recname_set", "vm_fsdb_pref_recname_set", vm_fsdb_pref_recname_set_function, VM_FSDB_PREF_RECNAME_SET_USAGE);
SWITCH_ADD_API(commands_api_interface, "vm_fsdb_pref_password_set", "vm_fsdb_pref_password_set", vm_fsdb_pref_password_set_function, VM_FSDB_PREF_PASSWORD_SET_USAGE);
diff --git a/src/mod/applications/mod_voicemail_ivr/conf/autoload_configs/voicemail_ivr.conf.xml b/src/mod/applications/mod_voicemail_ivr/conf/autoload_configs/voicemail_ivr.conf.xml
index 529509a495..502578ee64 100644
--- a/src/mod/applications/mod_voicemail_ivr/conf/autoload_configs/voicemail_ivr.conf.xml
+++ b/src/mod/applications/mod_voicemail_ivr/conf/autoload_configs/voicemail_ivr.conf.xml
@@ -58,10 +58,10 @@