mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-18 10:11:56 +00:00
introduce new say_string method of doing say and use it in mod_say_en as an example. try: eval ${say_string en.gsm en current_date_time pronounced ${strepoch()}} from the cli with this patch. We can do more to centralize the say things and go back and apply it to other langs, using this method you can set the desired file ext as well which I think is a bounty....
This commit is contained in:
@@ -145,6 +145,8 @@ SWITCH_DECLARE(int) switch_snprintf(_Out_z_cap_(len)
|
||||
|
||||
SWITCH_DECLARE(int) switch_vasprintf(_Out_opt_ char **buf, _In_z_ _Printf_format_string_ const char *format, _In_ va_list ap);
|
||||
|
||||
SWITCH_DECLARE(int) switch_vsnprintf(char *buf, switch_size_t len, const char *format, va_list ap);
|
||||
|
||||
SWITCH_DECLARE(char *) switch_copy_string(_Out_z_cap_(dst_size)
|
||||
char *dst, _In_z_ const char *src, _In_ switch_size_t dst_size);
|
||||
|
||||
|
||||
@@ -2240,6 +2240,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_del_registration(const char *user, c
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_expire_registration(int force);
|
||||
|
||||
|
||||
SWITCH_DECLARE(char *) switch_say_file_handle_get_variable(switch_say_file_handle_t *sh, const char *var);
|
||||
SWITCH_DECLARE(char *) switch_say_file_handle_get_path(switch_say_file_handle_t *sh);
|
||||
SWITCH_DECLARE(char *) switch_say_file_handle_detach_path(switch_say_file_handle_t *sh);
|
||||
SWITCH_DECLARE(void) switch_say_file_handle_destroy(switch_say_file_handle_t **sh);
|
||||
SWITCH_DECLARE(switch_status_t) switch_say_file_handle_create(switch_say_file_handle_t **sh, const char *ext, switch_event_t **var_event);
|
||||
SWITCH_DECLARE(void) switch_say_file(switch_say_file_handle_t *sh, const char *fmt, ...);
|
||||
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
/* For Emacs:
|
||||
|
||||
@@ -859,6 +859,16 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session,
|
||||
const char *say_gender,
|
||||
switch_input_args_t *args);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_say_string(switch_core_session_t *session,
|
||||
const char *lang,
|
||||
const char *ext,
|
||||
const char *tosay,
|
||||
const char *module_name,
|
||||
const char *say_type,
|
||||
const char *say_method,
|
||||
const char *say_gender,
|
||||
char **rstr);
|
||||
|
||||
SWITCH_DECLARE(switch_say_method_t) switch_ivr_get_say_method_by_name(const char *name);
|
||||
SWITCH_DECLARE(switch_say_gender_t) switch_ivr_get_say_gender_by_name(const char *name);
|
||||
SWITCH_DECLARE(switch_say_type_t) switch_ivr_get_say_type_by_name(const char *name);
|
||||
|
||||
@@ -103,29 +103,9 @@ struct switch_stream_handle {
|
||||
};
|
||||
|
||||
struct switch_io_event_hooks;
|
||||
struct switch_say_file_handle;
|
||||
|
||||
|
||||
|
||||
typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
|
||||
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t,
|
||||
switch_call_cause_t *);
|
||||
typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
|
||||
@@ -490,6 +470,7 @@ struct switch_say_interface {
|
||||
const char *interface_name;
|
||||
/*! function to pass down to the module */
|
||||
switch_say_callback_t say_function;
|
||||
switch_say_string_callback_t say_string_function;
|
||||
switch_thread_rwlock_t *rwlock;
|
||||
int refs;
|
||||
switch_mutex_t *reflock;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#define SWITCH_TYPES_H
|
||||
|
||||
#include <switch.h>
|
||||
|
||||
SWITCH_BEGIN_EXTERN_C
|
||||
#define SWITCH_ENT_ORIGINATE_DELIM ":_:"
|
||||
#define SWITCH_BLANK_STRING ""
|
||||
@@ -1735,6 +1736,7 @@ typedef switch_status_t (*switch_stream_handle_raw_write_function_t) (switch_str
|
||||
typedef switch_status_t (*switch_api_function_t) (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session,
|
||||
_In_ switch_stream_handle_t *stream);
|
||||
|
||||
|
||||
#define SWITCH_STANDARD_API(name) static switch_status_t name (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
|
||||
|
||||
typedef switch_status_t (*switch_input_callback_function_t) (switch_core_session_t *session, void *input,
|
||||
@@ -1772,17 +1774,32 @@ typedef struct {
|
||||
switch_ivr_dmachine_t *dmachine;
|
||||
} switch_input_args_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
switch_say_type_t type;
|
||||
switch_say_method_t method;
|
||||
switch_say_gender_t gender;
|
||||
const char *ext;
|
||||
} switch_say_args_t;
|
||||
|
||||
|
||||
typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session,
|
||||
char *tosay,
|
||||
switch_say_args_t *say_args,
|
||||
switch_input_args_t *args);
|
||||
|
||||
typedef switch_status_t (*switch_say_string_callback_t) (switch_core_session_t *session,
|
||||
char *tosay,
|
||||
switch_say_args_t *say_args, char **rstr);
|
||||
|
||||
struct switch_say_file_handle;
|
||||
typedef struct switch_say_file_handle switch_say_file_handle_t;
|
||||
|
||||
typedef switch_status_t (*switch_new_say_callback_t) (switch_say_file_handle_t *sh,
|
||||
char *tosay,
|
||||
switch_say_args_t *say_args);
|
||||
|
||||
|
||||
typedef struct switch_xml *switch_xml_t;
|
||||
typedef struct switch_core_time_duration switch_core_time_duration_t;
|
||||
typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
|
||||
|
||||
Reference in New Issue
Block a user