Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
May 2009
- 14 participants
- 307 discussions
12 May '09
Author: mrene
Date: Mon May 11 22:31:40 2009
New Revision: 13281
Log:
s/for/while
Modified:
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Mon May 11 22:31:40 2009
@@ -2168,7 +2168,7 @@
stop_node_thread();
}
- for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_first(NULL, globals.fifo_hash)) {
+ while (hi = switch_hash_first(NULL, globals.fifo_hash)) {
int x = 0;
switch_hash_this(hi, NULL, NULL, &val);
node = (fifo_node_t *) val;
1
0
11 May '09
Author: mikej
Date: Mon May 11 17:28:02 2009
New Revision: 13280
Log:
cleanup msvc code analysis tagging and warnings
Modified:
freeswitch/trunk/src/include/switch_core.h
freeswitch/trunk/src/include/switch_xml.h
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
Modified: freeswitch/trunk/src/include/switch_core.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core.h (original)
+++ freeswitch/trunk/src/include/switch_core.h Mon May 11 17:28:02 2009
@@ -1505,7 +1505,7 @@
const char *module_name,
const char *voice_name,
_In_ unsigned int rate,
- _In_ unsigned int interval, switch_speech_flag_t *flags, _In_ switch_memory_pool_t *pool);
+ _In_ unsigned int interval, switch_speech_flag_t *flags, _In_opt_ switch_memory_pool_t *pool);
/*!
\brief Feed text to the TTS module
\param sh the speech handle to feed
Modified: freeswitch/trunk/src/include/switch_xml.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml.h (original)
+++ freeswitch/trunk/src/include/switch_xml.h Mon May 11 17:28:02 2009
@@ -104,7 +104,7 @@
* \param dup true if you want the string to be strdup()'d automatically
* \return the switch_xml_t or NULL if an error occured
*/
-SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(_In_z_ char *s, _In_opt_ switch_bool_t dup);
+SWITCH_DECLARE(switch_xml_t) switch_xml_parse_str_dynamic(_In_z_ char *s, _In_ switch_bool_t dup);
/*!
* \brief Parses a string into a switch_xml_t
@@ -156,7 +156,7 @@
///\param attrname the attribute name
///\param value the value
///\return an xml node or NULL
-SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(_In_ switch_xml_t node, _In_z_ const char *childname, _In_z_ const char *attrname, _In_z_ const char *value);
+SWITCH_DECLARE(switch_xml_t) switch_xml_find_child(_In_ switch_xml_t node, _In_z_ const char *childname, _In_opt_z_ const char *attrname, _In_opt_z_ const char *value);
SWITCH_DECLARE(switch_xml_t) switch_xml_find_child_multi(_In_ switch_xml_t node, _In_z_ const char *childname, ...);
///\brief returns the next tag of the same name in the same section and depth or NULL
@@ -170,7 +170,7 @@
///\param xml the xml node
///\param idx the index
///\return an xml node or NULL
- switch_xml_t switch_xml_idx(_In_z_ switch_xml_t xml, _In_opt_ int idx);
+ switch_xml_t switch_xml_idx(_In_ switch_xml_t xml, _In_ int idx);
///\brief returns the name of the given tag
///\param xml the xml node
@@ -186,7 +186,7 @@
///\param xml the xml node
///\param attr the attribute
///\return the value
-SWITCH_DECLARE(const char *) switch_xml_attr(_In_ switch_xml_t xml, _In_z_ const char *attr);
+SWITCH_DECLARE(const char *) switch_xml_attr(_In_opt_ switch_xml_t xml, _In_opt_z_ const char *attr);
///\brief returns the value of the requested tag attribute, or "" if not found
///\param xml the xml node
@@ -209,7 +209,7 @@
///\param xml the xml node
///\param prn_header add <?xml version..> header too
///\return the xml text string
-SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_opt_ switch_bool_t prn_header);
+SWITCH_DECLARE(char *) switch_xml_toxml(_In_ switch_xml_t xml, _In_ switch_bool_t prn_header);
///\brief Converts an switch_xml structure back to xml using the buffer passed in the parameters.
///\param xml the xml node
@@ -218,7 +218,7 @@
///\param offset offset to start at
///\param prn_header add <?xml version..> header too
///\return the xml text string
-SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_opt_ switch_size_t offset, _In_opt_ switch_bool_t prn_header);
+SWITCH_DECLARE(char *) switch_xml_toxml_buf(_In_ switch_xml_t xml, _In_z_ char *buf, _In_ switch_size_t buflen, _In_ switch_size_t offset, _In_ switch_bool_t prn_header);
///\brief returns a NULL terminated array of processing instructions for the given
///\ target
@@ -230,7 +230,7 @@
///\brief frees the memory allocated for an switch_xml structure
///\param xml the xml node
///\note in the case of the root node the readlock will be lifted
-SWITCH_DECLARE(void) switch_xml_free(_In_ switch_xml_t xml);
+SWITCH_DECLARE(void) switch_xml_free(_In_opt_ switch_xml_t xml);
SWITCH_DECLARE(void) switch_xml_free_in_thread(_In_ switch_xml_t xml, _In_ int stacksize);
///\brief returns parser error message or empty string if none
@@ -253,7 +253,7 @@
///\param name the name of the tag
///\param off the offset
///\return an xml node or NULL
-SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(_In_ switch_xml_t xml, _In_z_ const char *name, _In_opt_ switch_size_t off);
+SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(_In_ switch_xml_t xml, _In_z_ const char *name, _In_ switch_size_t off);
///\brief wrapper for switch_xml_add_child() that strdup()s name
///\param xml the xml node
@@ -306,7 +306,7 @@
SWITCH_DECLARE(switch_xml_t) switch_xml_cut(_In_ switch_xml_t xml);
///\brief inserts an existing tag into an ezxml structure
-SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_opt_ switch_size_t off);
+SWITCH_DECLARE(switch_xml_t) switch_xml_insert(_In_ switch_xml_t xml, _In_ switch_xml_t dest, _In_ switch_size_t off);
///\brief Moves an existing tag to become a subtag of dest at the given offset from
///\ the start of dest's character content. Returns the moved tag.
@@ -319,7 +319,7 @@
///\param reload if it's is already open close it and open it again as soon as permissable (blocking)
///\param err a pointer to set error strings
///\return the xml root node or NULL
-SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(_In_opt_ uint8_t reload, _Out_ const char **err);
+SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(_In_ uint8_t reload, _Out_ const char **err);
///\brief initilize the core XML backend
///\param pool a memory pool to use
@@ -345,13 +345,13 @@
///\param params optional URL formatted params to pass to external gateways
///\return SWITCH_STATUS_SUCCESS if successful root and node will be assigned
SWITCH_DECLARE(switch_status_t) switch_xml_locate(_In_z_ const char *section,
- _In_z_ const char *tag_name,
- _In_z_ const char *key_name,
- _In_z_ const char *key_value,
+ _In_opt_z_ const char *tag_name,
+ _In_opt_z_ const char *key_name,
+ _In_opt_z_ const char *key_value,
_Out_ switch_xml_t *root,
_Out_ switch_xml_t *node,
_In_opt_ switch_event_t *params,
- _In_opt_ switch_bool_t clone);
+ _In_ switch_bool_t clone);
SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(_In_z_ const char *domain_name, _In_opt_ switch_event_t *params, _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain);
@@ -365,11 +365,11 @@
SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(_In_z_ const char *key,
_In_z_ const char *user_name,
_In_z_ const char *domain_name,
- _In_z_ const char *ip,
- _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup,
+ _In_opt_z_ const char *ip,
+ _Out_ switch_xml_t *root, _Out_ switch_xml_t *domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup,
_In_opt_ switch_event_t *params);
-SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_ switch_xml_t *ingroup);
+SWITCH_DECLARE(switch_status_t) switch_xml_locate_user_in_domain(_In_z_ const char *user_name, _In_ switch_xml_t domain, _Out_ switch_xml_t *user, _Out_opt_ switch_xml_t *ingroup);
///\brief open a config in the core registry
///\param file_path the name of the config section e.g. modules.conf
@@ -400,7 +400,7 @@
///\brief parse a string for a list of sections
///\param str a | delimited list of section names
///\return the section mask
-SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(_In_z_ const char *str);
+SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(_In_opt_z_ const char *str);
SWITCH_END_EXTERN_C
///\}
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Mon May 11 17:28:02 2009
@@ -1672,6 +1672,11 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to allocate memory to duplicate execute_app data.\n");
goto done;
}
+
+ if (!app) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to find application.\n");
+ goto done;
+ }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Execute app: %s, %s\n", app, arg);
channel = switch_core_session_get_channel(member->session);
@@ -2541,10 +2546,10 @@
if (imember->session) {
const char *p;
for (p = dtmf; p && *p; p++) {
- switch_dtmf_t dtmf = { *p, SWITCH_DEFAULT_DTMF_DURATION};
+ switch_dtmf_t digit = { *p, SWITCH_DEFAULT_DTMF_DURATION};
switch_mutex_lock(imember->control_mutex);
switch_core_session_kill_channel(imember->session, SWITCH_SIG_BREAK);
- switch_core_session_send_dtmf(imember->session, &dtmf);
+ switch_core_session_send_dtmf(imember->session, &digit);
switch_mutex_unlock(imember->control_mutex);
}
}
@@ -4562,7 +4567,7 @@
argc = switch_separate_string(dup, '|', argv, (sizeof(argv) / sizeof(argv[0])));
- for(i = 0; i < argc; i++) {
+ for(i = 0; i < argc && argv[i]; i++) {
if (!strcasecmp(argv[i], "mute")) {
*f &= ~MFLAG_CAN_SPEAK;
} else if (!strcasecmp(argv[i], "deaf")) {
Modified: freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_dptools/mod_dptools.c Mon May 11 17:28:02 2009
@@ -2352,54 +2352,54 @@
if ((x_params = switch_xml_child(x_domain, "params"))) {
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
- const char *var = switch_xml_attr(x_param, "name");
+ const char *pvar = switch_xml_attr(x_param, "name");
const char *val = switch_xml_attr(x_param, "value");
- if (!strcasecmp(var, "dial-string")) {
+ if (!strcasecmp(pvar, "dial-string")) {
dest = val;
} else if (!strncasecmp(var, "dial-var-", 9)) {
if (!var_event) {
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
} else {
- switch_event_del_header(var_event, var + 9);
+ switch_event_del_header(var_event, pvar + 9);
}
- switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
}
}
}
if ((x_params = switch_xml_child(x_group, "params"))) {
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
- const char *var = switch_xml_attr(x_param, "name");
+ const char *pvar = switch_xml_attr(x_param, "name");
const char *val = switch_xml_attr(x_param, "value");
- if (!strcasecmp(var, "dial-string")) {
+ if (!strcasecmp(pvar, "dial-string")) {
dest = val;
- } else if (!strncasecmp(var, "dial-var-", 9)) {
+ } else if (!strncasecmp(pvar, "dial-var-", 9)) {
if (!var_event) {
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
} else {
- switch_event_del_header(var_event, var + 9);
+ switch_event_del_header(var_event, pvar + 9);
}
- switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
}
}
}
if ((x_params = switch_xml_child(x_user, "params"))) {
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
- const char *var = switch_xml_attr(x_param, "name");
+ const char *pvar = switch_xml_attr(x_param, "name");
const char *val = switch_xml_attr(x_param, "value");
- if (!strcasecmp(var, "dial-string")) {
+ if (!strcasecmp(pvar, "dial-string")) {
dest = val;
- } else if (!strncasecmp(var, "dial-var-", 9)) {
+ } else if (!strncasecmp(pvar, "dial-var-", 9)) {
if (!var_event) {
switch_event_create(&var_event, SWITCH_EVENT_GENERAL);
} else {
- switch_event_del_header(var_event, var + 9);
+ switch_event_del_header(var_event, pvar + 9);
}
- switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, var + 9, val);
+ switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, pvar + 9, val);
}
}
}
@@ -2408,7 +2408,7 @@
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No dial-string available, please check your user directory.\n");
cause = SWITCH_CAUSE_MANDATORY_IE_MISSING;
} else {
- const char *var;
+ const char *varval;
char *d_dest = NULL;
switch_channel_t *channel;
switch_originate_flag_t myflags = SOF_NONE;
@@ -2422,9 +2422,9 @@
if (session) {
channel = switch_core_session_get_channel(session);
- if ((var = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))
- || (var = switch_event_get_header(var_event, "leg_timeout"))) {
- timelimit = atoi(var);
+ if ((varval = switch_channel_get_variable(channel, SWITCH_CALL_TIMEOUT_VARIABLE))
+ || (varval = switch_event_get_header(var_event, "leg_timeout"))) {
+ timelimit = atoi(varval);
}
switch_channel_set_variable(channel, "dialed_user", user);
@@ -2439,9 +2439,9 @@
switch_event_dup(&event, var_event);
switch_event_del_header(event, "dialed_user");
switch_event_del_header(event, "dialed_domain");
- if ((var = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) ||
- (var = switch_event_get_header(var_event, "leg_timeout"))) {
- timelimit = atoi(var);
+ if ((varval = switch_event_get_header(var_event, SWITCH_CALL_TIMEOUT_VARIABLE)) ||
+ (varval = switch_event_get_header(var_event, "leg_timeout"))) {
+ timelimit = atoi(varval);
}
} else {
switch_event_create(&event, SWITCH_EVENT_REQUEST_PARAMS);
@@ -2485,17 +2485,17 @@
if (new_channel && xml) {
if ((x_params = switch_xml_child(x_domain, "variables"))) {
for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
- const char *var = switch_xml_attr(x_param, "name");
+ const char *pvar = switch_xml_attr(x_param, "name");
const char *val = switch_xml_attr(x_param, "value");
- switch_channel_set_variable(new_channel, var, val);
+ switch_channel_set_variable(new_channel, pvar, val);
}
}
if ((x_params = switch_xml_child(x_user, "variables"))) {
for (x_param = switch_xml_child(x_params, "variable"); x_param; x_param = x_param->next) {
- const char *var = switch_xml_attr(x_param, "name");
+ const char *pvar = switch_xml_attr(x_param, "name");
const char *val = switch_xml_attr(x_param, "value");
- switch_channel_set_variable(new_channel, var, val);
+ switch_channel_set_variable(new_channel, pvar, val);
}
}
}
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Mon May 11 17:28:02 2009
@@ -2168,8 +2168,7 @@
stop_node_thread();
}
- top:
- for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_next(hi)) {
+ for (hi = switch_hash_first(NULL, globals.fifo_hash); hi; hi = switch_hash_first(NULL, globals.fifo_hash)) {
int x = 0;
switch_hash_this(hi, NULL, NULL, &val);
node = (fifo_node_t *) val;
@@ -2186,8 +2185,8 @@
switch_core_hash_destroy(&node->consumer_hash);
switch_thread_rwlock_unlock(node->rwlock);
switch_core_destroy_memory_pool(&node->pool);
- goto top;
}
+
switch_core_hash_destroy(&globals.fifo_hash);
memset(&globals, 0, sizeof(globals));
switch_mutex_unlock(mutex);
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Mon May 11 17:28:02 2009
@@ -2858,15 +2858,15 @@
if (id) {
int ok = 1;
- switch_event_t *params = NULL;
+ switch_event_t *locate_params = NULL;
const char *email_addr = NULL;
- switch_event_create(¶ms, SWITCH_EVENT_REQUEST_PARAMS);
- switch_assert(params);
- switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "mailbox", id);
+ switch_event_create(&locate_params, SWITCH_EVENT_REQUEST_PARAMS);
+ switch_assert(locate_params);
+ switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "mailbox", id);
if (switch_xml_locate_user("id", id, domain_name, switch_channel_get_variable(channel, "network_addr"),
- &x_domain_root, &x_domain, &x_user, NULL, params) == SWITCH_STATUS_SUCCESS) {
+ &x_domain_root, &x_domain, &x_user, NULL, locate_params) == SWITCH_STATUS_SUCCESS) {
if ((x_params = switch_xml_child(x_user, "params"))) {
for (x_param = switch_xml_child(x_params, "param"); x_param; x_param = x_param->next) {
const char *var = switch_xml_attr_soft(x_param, "name");
@@ -2925,7 +2925,7 @@
ok = 0;
}
- switch_event_destroy(¶ms);
+ switch_event_destroy(&locate_params);
if (!ok) {
goto end;
@@ -3904,13 +3904,13 @@
}
if (!profile) {
- switch_hash_index_t *hi;
- void *val;
+ switch_hash_index_t *index;
+ void *value;
switch_mutex_lock(globals.mutex);
- for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
- switch_hash_this(hi, NULL, NULL, &val);
- profile = (vm_profile_t *) val;
+ for (index = switch_hash_first(NULL, globals.profile_hash); index; index = switch_hash_next(index)) {
+ switch_hash_this(index, NULL, NULL, &value);
+ profile = (vm_profile_t *) value;
if (profile) {
switch_thread_rwlock_rdlock(profile->rwlock);
break;
Modified: freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_loopback/mod_loopback.c Mon May 11 17:28:02 2009
@@ -565,7 +565,7 @@
if (switch_test_flag(tech_pvt, TFLAG_CNG)) {
unsigned char data[SWITCH_RECOMMENDED_BUFFER_SIZE];
uint32_t flag = 0;
- switch_status_t status;
+ switch_status_t encode_status;
uint32_t rate = tech_pvt->read_codec.implementation->actual_samples_per_second;
*frame = &tech_pvt->cng_frame;
@@ -575,7 +575,7 @@
memset(&data, 0, sizeof(data));
if (strcasecmp(tech_pvt->read_codec.implementation->iananame, "L16")) {
- status = switch_core_codec_encode(&tech_pvt->read_codec,
+ encode_status = switch_core_codec_encode(&tech_pvt->read_codec,
NULL,
data,
sizeof(data),
@@ -585,7 +585,7 @@
&tech_pvt->cng_frame.datalen,
&rate,
&flag);
- if (status != SWITCH_STATUS_SUCCESS) {
+ if (encode_status != SWITCH_STATUS_SUCCESS) {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
@@ -664,7 +664,7 @@
}
}
- if (switch_test_flag(tech_pvt, TFLAG_LINKED)) {
+ if (switch_test_flag(tech_pvt, TFLAG_LINKED) && tech_pvt->other_tech_pvt) {
switch_frame_t *clone;
if (frame->codec->implementation != tech_pvt->write_codec.implementation) {
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon May 11 17:28:02 2009
@@ -4096,7 +4096,7 @@
end:
- if (switch_event_create(&event, SWITCH_EVENT_RECV_INFO) == SWITCH_STATUS_SUCCESS) {
+ if (sip && switch_event_create(&event, SWITCH_EVENT_RECV_INFO) == SWITCH_STATUS_SUCCESS) {
sip_alert_info_t *alert_info = sip_alert_info(sip);
if (sip && sip->sip_content_type) {
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Mon May 11 17:28:02 2009
@@ -1177,8 +1177,8 @@
if (listener->session) {
- switch_channel_t *channel = switch_core_session_get_channel(listener->session);
- if (switch_channel_get_state(channel) < CS_HANGUP && switch_channel_test_flag(channel, CF_DIVERT_EVENTS)) {
+ switch_channel_t *chan = switch_core_session_get_channel(listener->session);
+ if (switch_channel_get_state(chan) < CS_HANGUP && switch_channel_test_flag(chan, CF_DIVERT_EVENTS)) {
switch_event_t *e = NULL;
while (switch_core_session_dequeue_event(listener->session, &e, SWITCH_TRUE) == SWITCH_STATUS_SUCCESS) {
if (switch_queue_trypush(listener->event_queue, e) != SWITCH_STATUS_SUCCESS) {
@@ -1480,8 +1480,10 @@
switch_set_flag_locked(listener, LFLAG_CONNECTED);
switch_event_create(&call_event, SWITCH_EVENT_CHANNEL_DATA);
- switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event);
- switch_channel_event_set_data(channel, call_event);
+ if (channel) {
+ switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event);
+ switch_channel_event_set_data(channel, call_event);
+ }
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply");
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n");
switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static");
Modified: freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_local_stream/mod_local_stream.c Mon May 11 17:28:02 2009
@@ -597,6 +597,10 @@
}
}
+ if (!local_stream_name) {
+ goto usage;
+ }
+
source = switch_core_hash_find(globals.source_hash, local_stream_name);
if (source) {
if (xml) {
Modified: freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_shout/mod_shout.c Mon May 11 17:28:02 2009
@@ -712,7 +712,7 @@
context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path);
context->prebuf = handle->prebuf;
launch_read_stream_thread(context);
- while((switch_buffer_inuse(context->audio_buffer) < 1*2*context->samplerate) && ++sanity < 10) {
+ while((switch_buffer_inuse(context->audio_buffer) < (switch_size_t)(2 * context->samplerate)) && ++sanity < 10) {
/* at least 1s of audio and up to 5s initialize */
switch_yield(500000);
}
1
0
Author: anthm
Date: Mon May 11 15:20:11 2009
New Revision: 13279
Log:
use menu-timeout instead of menu-inter-digit-timeout when no digits have been entered
Modified:
freeswitch/trunk/src/switch_ivr_menu.c
Modified: freeswitch/trunk/src/switch_ivr_menu.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_menu.c (original)
+++ freeswitch/trunk/src/switch_ivr_menu.c Mon May 11 15:20:11 2009
@@ -292,6 +292,7 @@
switch_input_args_t args = { 0 };
switch_channel_t *channel;
char *sound_expanded = sound;
+ switch_size_t menu_buf_len = 0;
if (!session || !menu || switch_strlen_zero(sound)) {
return status;
@@ -324,12 +325,14 @@
return status;
}
- menu->ptr += strlen(menu->buf);
- if (strlen(menu->buf) < need) {
+ menu_buf_len = strlen(menu->buf);
+
+ menu->ptr += menu_buf_len;
+ if (menu_buf_len < need) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "waiting for %u/%u digits t/o %d\n",
(uint32_t)(menu->inlen - strlen(menu->buf)), (uint32_t)need, menu->inter_timeout);
status = switch_ivr_collect_digits_count(session, menu->ptr, menu->inlen - strlen(menu->buf),
- need, "#", &terminator, menu->inter_timeout, 0, 0);
+ need, "#", &terminator, menu_buf_len ? menu->inter_timeout : menu->timeout, 0, 0);
}
if (menu->confirm_macro && status == SWITCH_STATUS_SUCCESS && *menu->buf != '\0') {
1
0
Author: buklov
Date: Mon May 11 14:06:08 2009
New Revision: 13278
Log:
rewrite the module
Added:
freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h
Modified:
freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c
Modified: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c
==============================================================================
--- freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c (original)
+++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.c Mon May 11 14:06:08 2009
@@ -39,7 +39,6 @@
*
* Anthony Minessale II <anthmct(a)yahoo.com>
* Michael B. Murdock <mike(a)mmurdock.org>
- * Oleg Dolya <oleg.dolya(a)gmail.com>
* Boris Buklov <buklov(a)mail.ru>
*
* mod_say_ru.c -- Say for Russian
@@ -49,40 +48,24 @@
#include <switch.h>
#include <math.h>
#include <ctype.h>
+#include "mod_say_ru.h"
+
+//инициализируем массив вариантов произношения цифр описано в define mod_say_ru.h
+struct say_t matrix[7][8]= {{m_00,m_01,m_02,m_03,m_04,m_05,m_06,m_07},
+ {m_10,m_11,m_12,m_13,m_14,m_15,m_16,m_17},
+ {m_20,m_21,m_22,m_23,m_24,m_25,m_26,m_27},
+ {m_30,m_31,m_32,m_33,m_34,m_35,m_36,m_37},
+ {m_40,m_41,m_42,m_43,m_44,m_45,m_46,m_47},
+ {m_50,m_51,m_52,m_53,m_54,m_55,m_56,m_57},
+ {m_60,m_61,m_62,m_63,m_64,m_65,m_66,m_67}};
+
+
-typedef enum {
- male, //мужского пола
- female, //женского
- it //оно
-} sex_t;
-
-
-
-typedef enum {
- how_much, //сколько с полом
- when, //какого - когда -- без пола
- what_ //какая/какой/какое с полом
-} question_t; //вопрос
-
-typedef enum {
- million,
- thousand,
- zero,
- empty
-} unit_t;
SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load);
SWITCH_MODULE_DEFINITION(mod_say_ru, mod_say_ru_load, NULL, NULL);
-#define say_num(num, t) { \
- char tmp[80];\
- switch_status_t tstatus;\
- switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)num); \
- if ((tstatus = ru_say_general_count(session, tmp, SST_ITEMS, t, args)) != SWITCH_STATUS_SUCCESS) {\
- return tstatus;\
- }}\
-
#define say_file(...) {\
char tmp[80];\
switch_status_t tstatus;\
@@ -95,1010 +78,175 @@
}}\
-static switch_status_t ru_spell(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
-{
- char *p;
- for (p = tosay; p && *p; p++) {
- int a = tolower((int) *p);
- if (a >= 48 && a <= 57) {
- say_file("digits/%d.wav", a - 48);
- } else {
- if (type == SST_NAME_SPELLED) {
- say_file("ascii/%d.wav", a);
- } else if (type == SST_NAME_PHONETIC) {
- say_file("phonetic-ascii/%d.wav", a);
- }
- }
+static char *strip_commas(char *in, char *out, switch_size_t len)
+{
+ char *p = in, *q = out;
+ char *ret = out;
+ switch_size_t x = 0;
+
+ for (; p && *p; p++) {
+ if ((*p > 47 && *p < 58)) {
+ *q++ = *p;
+ } else if (*p != ',') {
+ ret = NULL;
+ break;
+ }
+ if (++x > len) {
+ ret = NULL;
+ break;
+ }
}
-
- return SWITCH_STATUS_SUCCESS;
+ return ret;
}
-//воспроизводить по 3 цифры
-static switch_status_t play_group( sex_t sex,question_t question, int a, int b, int c,
- unit_t what,int last, switch_core_session_t *session, switch_input_args_t *args)
+
+static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d sex=%d q=%d last=%d\n", a,b,c,sex,question,last);
- if (a) {
- if ((b==0)||(c==0)) { // если b и с равны 0 то сказать шестьсот, сестисотый, шестисотая
- switch (question) {
-//------------------------------------------------------
- case how_much: //сколько когда дальше нету цифр например 100 200...
- switch (sex) { //пол
- case male: //мужчина
- say_file("digits/%d00.wav", a); //сто
- if (what==thousand) {
- say_file("digits/thousands.wav");//тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav");//миллионов
- }
- //-------------
- break;
-
- case female: //женщина
- say_file("digits/%d00.wav", a);//сто
- if (what==thousand) {
- say_file("digits/thousands.wav");//тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav");//миллионов
- }
- break;
- //-------------
- case it: //оно
- say_file("digits/%d00.wav", a);//сто
- if (what==thousand) {
- say_file("digits/thousands.wav"); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav");//миллионов
- }
- break;
- //-------------
- }
- break;
-//------------------------------------------------------
- case what_: //какой/я/ое
- switch (sex) { //пол
- case male: //мужчина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionx.wav");//тысячный
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/thousands.wav");//тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionm.wav");//Миллионный
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/millions.wav");//миллионов
- }
- }
- else {
- say_file("digits/h-%d00m.wav", a);//сотый двухсотый
- }
- break;
-
- case female: //женщина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionf.wav");//тысячная
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/thousands.wav");//тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionf.wav");//Миллионная
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/millions.wav");//миллионов
- }
- }
- else {
- say_file("digits/h-%d00f.wav", a);//сотая двухсотая
- }
- break;
- case it: //оно
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionn.wav");//тысячное
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/thousands.wav");//тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionn.wav");//Миллионное
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/millions.wav");//миллионов
- }
- }
- else {
- say_file("digits/h-%d00n.wav", a);//сотого
- }
- break;
- }
- break;
-//-------------------------------------------------------
- case when: //какого - когда без пола
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionx.wav");//тысячного
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/thousands.wav");//тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);//двухсот
- say_file("digits/h-millionx.wav");//Миллионного
- }
- else {
- say_file("digits/%d00.wav", a);//двести
- say_file("digits/millions.wav");//миллионов
- }
- }
- else {
- say_file("digits/h-%d00x.wav", a);//сотого
- }
- break;
- } //end switch (question)
- }//end if ((b==0)||(c==0))
- else // если есть ещё цифры
- {
- switch (question) {
- case how_much:
- say_file("digits/%d00.wav", a); //просто сто и тд
- break;
- case what_:
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);
- }
- else {
- say_file("digits/%d00.wav", a); //сто
- }
- break;
- case when:
- if (last==0) {
- say_file("digits/h-%d00xx.wav", a);
- }
- else {
- say_file("digits/%d00.wav", a); //сто
- }
- break;
- }
- }
- }//end if (a)
- if (b) // если b больше 0
- {
- if (b > 1) { //если цифры больше 19
- if (c==0) { // если c == нолю 20-30-40-50
- switch (question) {
-//------------------------------------------------------
- case how_much: //сколько когда дальше нету цифр например 10 20...
- switch (sex) { //пол
- case male: //мужчина
- say_file("digits/%d0.wav", b); //двадцать
- if (what==thousand) {
- say_file("digits/thousands.wav", b); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav", b); //миллионов
- }
- //-------------
- break;
-
- case female: //женщина
- say_file("digits/%d0.wav", b);//двадцать
- if (what==thousand) {
- say_file("digits/thousands.wav", b); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav", b); //миллионов
- }
- break;
- //-------------
- case it: //оно
- say_file("digits/%d0.wav", b);// двадцать
- if (what==thousand) {
- say_file("digits/thousands.wav", b); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav", b); //миллионов
- }
- break;
- //-------------
- }
- break;
-//------------------------------------------------------
- case what_: //какой/я/ое >19 и c==0 20-30-40
- switch (sex) { //пол
- case male: //мужчина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-thousandm.wav", b); //тысячный
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-millionm.wav", b); //миллионный
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d0m.wav", b);//двадцатый
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- }
- }
- break;
- case female: //женщина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-thousandf.wav", b); //тысячная
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-millionf.wav", b); //миллионная
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d0f.wav", b);//двадцатая
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- }
- }
- break;
- case it: //оно
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-thousandn.wav", b); //тысячное
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-millionn.wav", b); //миллионное
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d0n.wav", b);//двадцатое
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- }
- }
- break;
- }
- break;
-//-------------------------------------------------------
- case when: //какого - когда без пола
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-thousandx.wav", b); //тысячного
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d0xx.wav", b);//двадцати
- say_file("digits/h-millionx.wav", b); //миллионного
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- say_file("digits/h-thousand.wav", b); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d0x.wav", b);//двадцатого
- }
- else {
- say_file("digits/%d0.wav", b);//двадцать
- }
- }
- break;
- }
- }//конец если c == нолю
- else
- {
- say_file("digits/%d0.wav", b); // иначе просто двадцать .. и тд
+ char *p = in, *q = out;
+ char *ret = out;
+ switch_size_t x = 0;
+ // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
+ for (; p && *p; p++) {
+ if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
+ *q++ = *p;
+ }
+ if (++x > len) {
+ ret = NULL;
+ break;
+ }
+ }
+ return ret;
+}
+
+
+static switch_status_t ru_spell(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
+{
+ char *p;
+
+ for (p = tosay; p && *p; p++) {
+ int a = tolower((int) *p);
+ if (a >= 48 && a <= 57) {
+ say_file("digits/%d.wav", a - 48);
+ } else {
+ if (type == SST_NAME_SPELLED) {
+ say_file("ascii/%d.wav", a);
+ } else if (type == SST_NAME_PHONETIC) {
+ say_file("phonetic-ascii/%d.wav", a);
}
- }//конец если больше 19
- else { //если цифры меньше 20
- switch (question) {
-//------------------------------------------------------
- case how_much: //сколько когда от 10 до 19
- switch (sex) { //пол
- case male: //мужчина
- say_file("digits/%d%d.wav",b ,c); //девятнадцать
- if (what==thousand) {
- say_file("digits/thousands.wav"); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav"); //миллионов
- }
- //-------------
- break;
- case female: //женщина
- say_file("digits/%d%d.wav",b ,c);//девятнадцать
- if (what==thousand) {
- say_file("digits/thousands.wav"); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav"); //миллионов
- }
- break;
- //-------------
- case it: //оно
- say_file("digits/%d%d.wav",b ,c);// девятнадцать
- if (what==thousand) {
- say_file("digits/thousands.wav"); //тысяч
- }
- else if (what==million) {
- say_file("digits/millions.wav"); //миллионов
- }
- break;
- //-------------
- }
- break;
-//------------------------------------------------------
- case what_: //какой/я/ое
- switch (sex) { //пол
- case male: //женщина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-thousandm.wav"); //тысячный
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнацать
- say_file("digits/h-thousand.wav"); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-millionm.wav"); //миллионный
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнадцать
- say_file("digits/h-thousand.wav"); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d%dm.wav", b,c);//девятнадцатый
- }
- else {
- say_file("digits/%d%d.wav");//девятнадцать
- }
- }
- case female: //женщина
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-thousandf.wav"); //тысячная
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнацать
- say_file("digits/h-thousand.wav"); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-millionf.wav"); //миллионная
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнадцать
- say_file("digits/h-thousand.wav"); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d%df.wav", b,c);//девятнадцатая
- }
- else {
- say_file("digits/%d%d.wav");//девятнадцать
- }
- }
- break;
- case it: //оно
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-thousandn.wav"); //тысячное
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнацать
- say_file("digits/h-thousand.wav"); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-millionn.wav"); //миллионное
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнадцать
- say_file("digits/h-thousand.wav"); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d%dn.wav", b,c);//девятнадцатое
- }
- else {
- say_file("digits/%d%d.wav");//девятнадцать
- }
- }
- break;
- }
- break;
-//-------------------------------------------------------
- case when: //какого - когда без пола
- if (what==thousand) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-thousandx.wav"); //тысячного
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнацать
- say_file("digits/h-thousand.wav"); //тысяч
- }
- }
- else if (what==million) {
- if (last==0) {
- say_file("digits/h-%d%dxx.wav", b,c);//десяти, пятнадцати ..
- say_file("digits/h-millionx.wav"); //миллионного
- }
- else {
- say_file("digits/%d%d.wav", b,c);//девятнадцать
- say_file("digits/h-thousand.wav"); //миллионов
- }
- }
- else { //без миллионов и тысяч
- if (last==0) {
- say_file("digits/h-%d%dx.wav", b,c);//девятнадцатого
- }
- else {
- say_file("digits/%d%d.wav");//девятнадцать
- }
- }
-
- break;
- }//конец если c == нолю
- c=0; //что бы не проговаривать c
- }// конец //если цифры меньше 20
- }//конец if (b)
-
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group c \n");
-
-
-
- if ((c)||(what==zero)) {// последняя цифра (самая сложная) или проговорить ноль , для случает когда первые цифры нули
- if (c>2||c==0) {//0 и 3-9
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group c 1\n");
-
- switch (question)
- {
-//------------------------------------------------------
- case how_much: //сколько 3-9
- switch (sex)
- { //пол
- case male: //мужчина
- if (what==thousand) { //тысяч
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три - четыре
- say_file("digits/thousands-i.wav"); //тысячи
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/thousands.wav"); //тысяч
- }
- }
- else if (what==million) { //миллионов
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три четыре
- say_file("digits/million-a.wav"); //миллиона
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/millions.wav"); //миллионов
- }
- }
- else {
- say_file("digits/%d.wav", c);// три девять ноль
- }
- break;
-
- case female: //женщина
- if (what==thousand) { //тысяч
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три - четыре
- say_file("digits/thousands-i.wav"); //тысячи
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/thousands.wav"); //тысяч
- }
- }
- else if (what==million) { //миллионов
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три четыре
- say_file("digits/million-a.wav"); //миллиона
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/millions.wav"); //миллионов
- }
- }
- else {
- say_file("digits/%d.wav", c);// три девять ноль
- }
- break;
-
- //-------------
- case it: //оно
- if (what==thousand) { //тысяч
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три - четыре
- say_file("digits/thousands-i.wav"); //тысячи
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/thousands.wav"); //тысяч
- }
- }
- else if (what==million) { //миллионов
- if ((c>2)&&(c<5)) {
- say_file("digits/%d.wav", c);// три четыре
- say_file("digits/million-a.wav"); //миллиона
- }
- else{
- say_file("digits/%d.wav", c);// пять .. девять
- say_file("digits/millions.wav"); //миллионов
- }
- }
- else {
- say_file("digits/%d.wav", c);// три девять ноль
- }
- break;
- }
- break;
-//------------------------------------------------------
- case what_: //какой/я/ое
- switch (sex)
- { //пол
- case male: //мужчина
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-thousandm.wav"); //тысячный
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-millionm.wav"); //миллионный
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dm.wav", c);//третий нулевой ..
- }
- break;
- case female: //женщина
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-thousandf.wav"); //тысячная
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-millionf.wav"); //миллионная
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%df.wav", c);//третья нулевая ..
- }
- break;
- case it: //оно
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-thousandn.wav"); //тысячное
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-millionn.wav"); //миллионное
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dn.wav", c);//третье нулевое ..
- }
- break;
- }
- break;
-//-------------------------------------------------------
- case when: //какого - когда без пола
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-thousandx.wav"); //тысячного
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- say_file("digits/h-millionx.wav"); //миллионого
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dx.wav", c);//третьего нулевого ..
- }
- break;
- }//конец switch (question)
- } //конец //0 и 3-9
- else if ((c==2)||(c==1)) { //1 2
- switch (question) {
-//------------------------------------------------------
- case how_much: //
- switch (sex)
- { //пол
- case male: //мужчина
- if (what==thousand) {
- if (c==1) {
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousand.wav"); //тысяча
- }
- else{
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- say_file("digits/%d.wav", c); // один два
- if (c==1) {
- say_file("digits/million.wav", c); //миллион
- }
- else { //один два
- say_file("digits/million-a.wav"); // миллиона
- }
- }
- else { //просто один два
- say_file("digits/%d.wav", c); // один два
- }
- break;
- //-------------
- case female: //женщина
- if (what==thousand) {
- if (c==1) {
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousand.wav"); //тысяча
- }
- else{
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- say_file("digits/%d.wav", c); // один два
- if (c==1) {
- say_file("digits/million.wav"); //миллион
- }
- else { //один два
- say_file("digits/million-a.wav"); // миллиона
- }
- }
- else { //просто одна две
- say_file("digits/%df.wav", c); // одна две
- }
- break;
- //-------------
- case it: //оно
- if (what==thousand) {
- if (c==1) {
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousand.wav"); //тысяча
- }
- else{
- say_file("digits/%df.wav", c); // одна две
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- say_file("digits/%d.wav", c); // один два
- if (c==1) {
- say_file("digits/million.wav"); //миллион
- }
- else { //один два
- say_file("digits/million-a.wav"); // миллиона
- }
- }
- else { //просто одно две
- say_file("digits/%dn.wav", c); // одна две
- }
- break;
- }
- break;
-//------------------------------------------------------
- case what_: //какой/я/ое
- switch (sex)
- { //пол
- case male: //мужчина
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух,одна 2-х, ...
- if (c!=1) { //не произность одна тысячный
- say_file("digits/h-%dxx.wav", c);//одна, двух
- }
- say_file("digits/h-thousandm.wav"); //тысячный
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%df.wav", c);//одна две
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- if (c!=1) {
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- }
- say_file("digits/h-millionm.wav"); //миллионный
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand-a.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dm.wav", c);//третий нулевой ..
- }
- break;
- case female: //женщина
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 1-х, 2-х ...
- if (c!=1) { //не произность одна тысячная
- say_file("digits/h-%dxx.wav", c);//одна, двух
- }
- say_file("digits/h-thousandf.wav"); //тысячная
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%df.wav", c);//две четыре ..
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- if (c!=1) {
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- }
- say_file("digits/h-millionf.wav"); //миллионная
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand-a.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%df.wav", c);//третья нулевая ..
- }
- break;
- case it: //оно
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 1-х, 2-х ...
- if (c!=1) { //не произность одна тысячное
- say_file("digits/h-%dxx.wav", c);//одна, двух
- }
- say_file("digits/h-thousandn.wav"); //тысячное
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%df.wav", c);//две ..
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- if (c!=1) {
- say_file("digits/h-%dxx.wav", c);//одна, двух
- }
- say_file("digits/h-millionn.wav"); //миллионное
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand-a.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dn.wav", c);//третье нулевое ..
- }
- break;
- }
- break;
-//-------------------------------------------------------
- case when: //какого - когда без пола
- if (what==thousand) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- if (c!=1) { //не произность одна тысячного
- say_file("digits/h-%dxx.wav", c);//одна, двух
- }
- say_file("digits/h-thousandx.wav"); //тысячного
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%df.wav", c);//две четыре ..
- say_file("digits/thousands-i.wav"); //тысячи
- }
- }
- else if (what==million) {
- if (last==0) {// если дальше нету цифр значит говорить двух, 3-х, 4-х ...
- if (c!=1) {
- say_file("digits/h-%dxx.wav", c);//одна, двух, трёх
- }
- say_file("digits/h-millionx.wav"); //миллионного
- }
- else { //если есть дальше цифры меньше 1000
- say_file("digits/%d.wav", c);//три четыре ..
- say_file("digits/thousand-a.wav"); //миллиона
- }
- }//просто цифры без тысяч
- else{
- say_file("digits/h-%dx.wav", c);//третьего нулевого ..
- }
- break;
- }
- }//else if ((c==2)||(c==1)) { //1 2
-
- }//конец if ((c)||(what=="zero"))
+ }
+ }
return SWITCH_STATUS_SUCCESS;
-}
-
+}
+
+
+static switch_status_t play_group(say_type_t say_type, casus_t casus, int a, int b, int c,
+ unit_t what, switch_core_session_t *session, switch_input_args_t *args)
+{
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a= %d b=%d c=%d what=%d!\n", a, b, c,what);
+ if (a) {
+ if (((b==0)&&(c==0))||(matrix[casus][say_type].all==1)) { //если b и с равны 0 то сказать шестьсот, сестисотый, шестисотая
+ if (what==million) { //префикс число окончание
+ say_file("digits/%s%d00%s.wav",matrix[casus][say_type].million[12], a, matrix[casus][say_type].million[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].million[11]);
+ }
+ else if (what==thousand){
+ say_file("digits/%s%d00%s.wav",matrix[casus][say_type].thousand[12], a, matrix[casus][say_type].thousand[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]);
+ }
+ else {
+ say_file("digits/%s%d00%s.wav",matrix[casus][say_type].num[6], a, matrix[casus][say_type].num[7]);
+ }
+ }
+ else { //если дальше есть цифры то тысячи и миллионы не прозносить пока
+ say_file("digits/%d00.wav",a);
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%d - круглые цифры\n",a);
+ }
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "выходим из a");
+ }
-static char *strip_commas(char *in, char *out, switch_size_t len)
-{
- char *p = in, *q = out;
- char *ret = out;
- switch_size_t x = 0;
-
- for (; p && *p; p++) {
- if ((*p > 47 && *p < 58)) {
- *q++ = *p;
- } else if (*p != ',') {
- ret = NULL;
- break;
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play b\n");
+
+ if (b) {
+ if (b>1) { //если 20 и больше
+ if ((c==0)||(matrix[casus][say_type].all==1)) { //если с равны 0 то сказать 20, двадцати, двадцатая
+ if (what==million) { //префикс число окончание
+ say_file("digits/%s%d0%s.wav",matrix[casus][say_type].million[12], b, matrix[casus][say_type].million[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].million[11]);
+ }
+ else if (what==thousand){
+ say_file("digits/%s%d0%s.wav",matrix[casus][say_type].thousand[12], b, matrix[casus][say_type].thousand[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]);
}
-
- if (++x > len) {
- ret = NULL;
- break;
+ else {
+ say_file("digits/%s%d0%s.wav",matrix[casus][say_type].num[6], b, matrix[casus][say_type].num[7]);
}
+ }
+ else { //если есть дальше цифры
+ say_file("digits/%d0.wav",b);
+ }
}
-
- return ret;
-}
-
-static char *strip_nonnumerics(char *in, char *out, switch_size_t len)
-{
- char *p = in, *q = out;
- char *ret = out;
- switch_size_t x = 0;
- // valid are 0 - 9, period (.), minus (-), and plus (+) - remove all others
- for (; p && *p; p++) {
- if ((*p > 47 && *p < 58) || *p == '.' || *p == '-' || *p == '+') {
- *q++ = *p;
+ else { //от 10 до 19
+ if (what==million) {
+ say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].million[12], b, c, matrix[casus][say_type].million[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].million[11]);
+ }
+ else if (what==thousand) {
+ say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].thousand[12], b, c, matrix[casus][say_type].thousand[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]);
+ }
+ else { //просто произнести цифры с префиксом и окончанием
+ say_file("digits/%s%d%d%s.wav",matrix[casus][say_type].num[6], b, c, matrix[casus][say_type].num[7]);
+ }
+ c=0;
+ }
+ }
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c\n");
+ if (c||what==zero) {
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c= %d in matrix=%s what=%d say_type=%d casus=%d\n", c,matrix[casus][say_type].num[c],what,say_type,casus);
+ if (c<=5) {
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "c=%d c<=5\n",c);
+ if (what==million) {
+ if ((strlen(matrix[casus][say_type].million[c*2])) > 0) { // не произносить если не заданно например 1 миллион а просто миллион
+ say_file("digits/%s.wav", matrix[casus][say_type].million[c*2])
}
-
- if (++x > len) {
- ret = NULL;
- break;
+ say_file("digits/%s.wav", matrix[casus][say_type].million[c*2+1]);
+ }
+ else if (what==thousand) {
+ if ((strlen(matrix[casus][say_type].thousand[c*2])) > 0) {// // не произносить если не заданно например одна тысячас а просто тысяча
+ say_file("digits/%s.wav",matrix[casus][say_type].thousand[c*2])
}
+ say_file("digits/%s.wav", matrix[casus][say_type].thousand[c*2+1]);
+ }
+ else { //просто произнести цифры с префиксом и окончанием
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play c= %d in matrix=%s!\n", c,matrix[casus][say_type].num[c]);
+ say_file("digits/%s.wav",matrix[casus][say_type].num[c]);
+ }
}
-
- return ret;
-}
+ else //больше 5
+ {
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "c=%d c>5\n",c);
+ if (what==million) {
+ say_file("digits/%s%d%s.wav",matrix[casus][say_type].million[12], c, matrix[casus][say_type].million[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].million[11]);
+ }
+ else if (what==thousand) {
+ say_file("digits/%s%d%s.wav",matrix[casus][say_type].thousand[12], c, matrix[casus][say_type].thousand[13]);
+ say_file("digits/%s.wav", matrix[casus][say_type].thousand[11]);
+ }
+ else { //просто произнести цифры с префиксом и окончанием
+ say_file("digits/%s%d%s.wav",matrix[casus][say_type].num[6], c, matrix[casus][say_type].num[7]);
+ }
+ }
+ }
+ return SWITCH_STATUS_SUCCESS;
+}
static switch_status_t ru_say_count(switch_core_session_t *session,
- char *tosay, sex_t sex, question_t question, switch_input_args_t *args)
+ char *tosay, say_type_t say_type, casus_t casus, switch_input_args_t *args)
{
int in;
int x = 0;
@@ -1107,7 +255,7 @@
switch_status_t status;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say_count %d %d %d other!\n", places[2], places[1], places[0]);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "ru_say_count %s!\n", tosay);
if (!(tosay = strip_commas(tosay, sbuf, sizeof(sbuf))) || strlen(tosay) > 9) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
@@ -1116,7 +264,7 @@
in = atoi(tosay);
int in_ = in;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d!\n", in);
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d!\n", in);
if (in != 0) {
for (x = 8; x >= 0; x--) {
int num = (int) pow(10, x);
@@ -1124,23 +272,45 @@
in -= places[(uint32_t) x] * num;
}
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "int in=%d \n", in);
-
- if ((status = play_group(sex,question, places[8], places[7], places[6], million,in%1000000, session, args)) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million!\n", places[8], places[7], places[6]);
- return status;
+// switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "a=%d b=%d c=%d\n", places[8],places[7],places[6]);
+//миллионы
+ if (places[8]||places[7]||places[6]) {
+ if ((in_%1000000>0)&&(matrix[casus][say_type].all!=1)) {// если поле миллионов есть цифры поизнести как числительое именительного падежа
+ if ((status = play_group(male_c,nominativus, places[8], places[7], places[6],million, session, args)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million! status=%d\n", places[8], places[7], places[6],status);
+ return status;
+ }
+ }
+ else {// иначе произнести в нужном падеже
+ if ((status = play_group(say_type,casus, places[8], places[7], places[6],million, session, args)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d million! status=%d\n", places[8], places[7], places[6],status);
+ return status;
+ }
+ }
}
- if ((status = play_group(sex,question, places[5], places[4], places[3], thousand,in_%1000,session, args)) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand!\n", places[5], places[4], places[3]);
- return status;
+//тысячи
+ if (places[5]||places[4]||places[3]) {
+ if ((in_%1000>0)&&(matrix[casus][say_type].all!=1)) {// если поле миллионов есть цифры поизнести как числительое именительного падежа
+ if ((status = play_group(male_c,nominativus, places[5], places[4], places[3],thousand, session, args)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status);
+ return status;
+ }
+ }
+ else {// иначе произнести в нужном падеже
+ if ((status = play_group(say_type,casus, places[5], places[4], places[3], thousand,session, args)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status);
+ return status;
+ }
+ }
}
- if ((status = play_group(sex,question, places[2], places[1], places[0], empty, 0,session, args)) != SWITCH_STATUS_SUCCESS)
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d other!\n", places[2], places[1], places[0]);
+// сотни
+ if ((status = play_group(say_type,casus, places[2], places[1], places[0], empty, session, args)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d thousand! status=%d\n", places[5], places[4], places[3],status);
return status;
}
- } else { //если ноль что бы и его проговаривать в правильных падежах
- if ((status = play_group(sex,question, places[2], places[1], places[0], zero,0, session, args)) != SWITCH_STATUS_SUCCESS)
+ }
+ else {
+ if ((status = play_group(say_type, casus, places[2], places[1], places[0], zero, session, args)) != SWITCH_STATUS_SUCCESS)
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "play group %d %d %d other!\n", places[2], places[1], places[0]);
return status;
@@ -1150,296 +320,291 @@
return SWITCH_STATUS_SUCCESS;
}
-
+//дописать
static switch_status_t ru_say_general_count(switch_core_session_t *session,
char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
{
switch_status_t status;
- sex_t sex;
- question_t question;
-
- if (type== SST_MESSAGES)
- {
- sex=it;
- question=how_much;
- }
- else if (type== SST_NUMBER||type==SST_PERSONS)
- {
- sex=male;
- question=how_much;
- }
- else if (type== SST_ITEMS)
- {
- sex=male;
- question=what_;
- }
- else
- {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown Say type=[%d]\n", type);
- return SWITCH_STATUS_FALSE;
- }
- status=ru_say_count(session,tosay,sex,question,args);
- return SWITCH_STATUS_SUCCESS;
+ casus_t casus; //падеж
+ say_type_t say_type;//тип произношения
+
+ switch (type) {
+ case SST_MESSAGES:
+ say_type=it_c;
+ casus=nominativus;
+ break;
+ default:
+ say_type=male_c;
+ casus=nominativus;
+ break;
+ };
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " type=%d casus=%d\n", say_type,casus);
+ status=ru_say_count(session,tosay,say_type,casus,args);
+ return status;
+// return SWITCH_STATUS_SUCCESS;
}
-
+
static switch_status_t ru_say_money(switch_core_session_t *session, char *tosay, switch_say_type_t type,
- switch_say_method_t method,switch_input_args_t *args)
+ switch_say_method_t method,switch_input_args_t *args)
{
- char sbuf[16] = "";
- char *rubles = NULL;
- char *kopecks = NULL;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n",tosay );
- if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
- return SWITCH_STATUS_GENERR;
- }
- rubles = sbuf;
-
- if ((kopecks = strchr(sbuf, '.'))) {
- *kopecks++ = '\0';
- if (strlen(kopecks) > 2) {
- kopecks[2] = '\0';
- }
- }
- if (sbuf[0] == '+') {
- rubles++;
- }
+ char sbuf[16] = "";
+ char *rubles = NULL;
+ char *kopecks = NULL;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_money %s\n",tosay );
+ if (strlen(tosay) > 15 || !(tosay = strip_nonnumerics(tosay, sbuf, sizeof(sbuf)))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Parse Error!\n");
+ return SWITCH_STATUS_GENERR;
+ }
+ rubles = sbuf;
+ if ((kopecks = strchr(sbuf, '.'))) {
+ *kopecks++ = '\0';
+ if (strlen(kopecks) > 2) {
+ kopecks[2] = '\0';
+ }
+ }
+ if (sbuf[0] == '+') {
+ rubles++;
+ }
+ if (sbuf[0] == '-') {
+ say_file("currency/minus.wav");
+ rubles++;
+ }
+
+ ru_say_count(session,rubles ,male_c,nominativus ,args);
+ int irubles = atoi(rubles)%100;
+ int iruble = atoi(rubles)%10;
+ if (irubles == 1 || (irubles > 20 && iruble == 1)) {/* рубль */
+ say_file("currency/ruble.wav");
+ }
+ else if ((irubles > 1 && irubles < 5) || (irubles > 20 && iruble > 1 && iruble < 5)) { /*рубля */
+ say_file("currency/ruble-a.wav");
+ }
+ else { /*рублей */
+ say_file("currency/rubles.wav");
+ }
- if (sbuf[0] == '-') {
- say_file("currency/minus.wav");
- rubles++;
- }
- ru_say_count(session,rubles ,male,how_much,args);
- int irubles = atoi(rubles)%100;
- int iruble = atoi(rubles)%10;
- if (irubles == 1 || (irubles > 20 && iruble == 1)) {/* рубль */
- say_file("currency/ruble.wav");
- }
- else if ((irubles > 1 && irubles < 5) || (irubles > 20 && iruble > 1 && iruble < 5)) { /*рубля */
- say_file("currency/ruble-a.wav");
- }
- else { /*рублей */
- say_file("currency/rubles.wav");
- }
- /* Say kopecks */
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %s\n",kopecks );
- ru_say_count(session,kopecks ,female,how_much,args);
- int ikopecks = atoi(kopecks)%100;
- int ikopeck = atoi(kopecks)%10;
- if (ikopecks == 1 || (ikopecks > 20 && ikopeck == 1))
- {
- /* копейка */
- say_file("currency/kopeck.wav");
- }
- else if ((ikopecks > 1 && ikopecks < 5) || (ikopecks > 20 && ikopeck > 1 && ikopeck < 5))
- {
- /* копейки */
- say_file("currency/kopeck-i.wav");
- }
- else
- {
- /* копеек */
- say_file("currency/kopecks.wav");
- }
+ /* Say kopecks */
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " %s\n",kopecks );
+ ru_say_count(session,kopecks ,female_c,nominativus ,args);
+
+ int ikopecks = atoi(kopecks)%100;
+ int ikopeck = atoi(kopecks)%10;
+ if (ikopecks == 1 || (ikopecks > 20 && ikopeck == 1))
+ {
+ /* копейка */
+ say_file("currency/kopeck.wav");
+ }
+ else if ((ikopecks > 1 && ikopecks < 5) || (ikopecks > 20 && ikopeck > 1 && ikopeck < 5))
+ {
+ /* копейки */
+ say_file("currency/kopeck-i.wav");
+ }
+ else
+ {
+ /* копеек */
+ say_file("currency/kopecks.wav");
+ }
return SWITCH_STATUS_SUCCESS;
}
+
static switch_status_t ru_say_time(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
- switch_input_args_t *args)
+ switch_input_args_t *args)
{
- int32_t t;
- char tmp[80];
- switch_time_t target = 0, target_now = 0;
- switch_time_exp_t tm, tm_now;
- uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0;
- switch_channel_t *channel = switch_core_session_get_channel(session);
- const char *tz = switch_channel_get_variable(channel, "timezone");
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_time %s type=%d method=%d\n",tosay, type,method );
-
- if (type == SST_TIME_MEASUREMENT) {
- int64_t hours = 0;
- int64_t minutes = 0;
- int64_t seconds = 0;
- int64_t r = 0;
-
- if (strchr(tosay, ':')) {
- char *tme = switch_core_session_strdup(session, tosay);
- char *p;
-
- if ((p = strrchr(tme, ':'))) {
- *p++ = '\0';
- seconds = atoi(p);
- if ((p = strchr(tme, ':'))) {
- *p++ = '\0';
- minutes = atoi(p);
- if (tme) {
- hours = atoi(tme);
- }
- } else {
- minutes = atoi(tme);
- }
- }
- } else {
- if ((seconds = atol(tosay)) <= 0) {
- seconds = (int64_t) switch_epoch_time_now(NULL);
- }
-
- if (seconds >= 60) {
- minutes = seconds / 60;
- r = seconds % 60;
- seconds = r;
- }
-
- if (minutes >= 60) {
- hours = minutes / 60;
- r = minutes % 60;
- minutes = r;
- }
- }
+ int32_t t;
+ char tmp[80];
+ switch_time_t target = 0, target_now = 0;
+ switch_time_exp_t tm, tm_now;
+ uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ const char *tz = switch_channel_get_variable(channel, "timezone");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, " ru_say_time %s type=%d method=%d\n",tosay, type,method );
+
+ if (type == SST_TIME_MEASUREMENT) {
+ int64_t hours = 0;
+ int64_t minutes = 0;
+ int64_t seconds = 0;
+ int64_t r = 0;
+
+ if (strchr(tosay, ':')) {
+ char *tme = switch_core_session_strdup(session, tosay);
+ char *p;
+
+ if ((p = strrchr(tme, ':'))) {
+ *p++ = '\0';
+ seconds = atoi(p);
+ if ((p = strchr(tme, ':'))) {
+ *p++ = '\0';
+ minutes = atoi(p);
+ if (tme) {
+ hours = atoi(tme);
+ }
+ } else {
+ minutes = atoi(tme);
+ }
+ }
+ } else {
+ if ((seconds = atol(tosay)) <= 0) {
+ seconds = (int64_t) switch_epoch_time_now(NULL);
+ }
+
+ if (seconds >= 60) {
+ minutes = seconds / 60;
+ r = seconds % 60;
+ }
+
+ if (minutes >= 60) {
+ hours = minutes / 60;
+ r = minutes % 60;
+ minutes = r;
+ }
+ }
- switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)hours);
- ru_say_count(session,tmp ,male,how_much,args);
- if (((hours%10) == 1) && (hours!=11)) {
+ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)hours);
+ ru_say_count(session,tmp ,male_c,nominativus,args);
+ if (((hours%10) == 1) && (hours!=11)) {
/* час */
- say_file("time/hour.wav");
- }
- else if (((hours%10>1)&&(hours%10<5)) &&((hours<12)||(hours>14))) {
- say_file("time/hours-a.wav"); /* часа */
- }
- else {
- say_file("time/hours.wav"); /* часов*/
- }
+ say_file("time/hour.wav");
+ }
+ else if (((hours%10>1)&&(hours%10<5)) &&((hours<12)||(hours>14))) {
+ say_file("time/hours-a.wav"); /* часа */
+ }
+ else {
+ say_file("time/hours.wav"); /* часов*/
+ }
switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)minutes); //перевести минуты в *char
- ru_say_count(session,tmp ,female,how_much,args);
- if (((minutes%10) == 1) && (minutes!=11)) {
- say_file("time/minute.wav"); //минута
- }
- else if (((minutes%10>1)&&(minutes%10<5))&&((minutes<12)||(minutes>14))){
- say_file("time/minutes-i.wav"); // минуты
- }
- else {
- say_file("time/minutes.wav"); //минут
- }
-
- if (seconds!=0) {
- switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)seconds);
- ru_say_count(session,tmp ,female,how_much,args);
- if (((seconds%10) == 1) && (seconds!=11)) {
- say_file("time/second.wav"); // секунда
- }
- else if (((seconds%10>1)&&(seconds%10<5))&&((seconds<12)||(seconds>14))) {
- say_file("time/seconds-i.wav"); // секуны
- }
- else {
- say_file("time/seconds.wav"); //секунд
- }
- }
+ ru_say_count(session,tmp ,female_c,nominativus,args);
+ if (((minutes%10) == 1) && (minutes!=11)) {
+ say_file("time/minute.wav"); //минута
+ }
+ else if (((minutes%10>1)&&(minutes%10<5))&&((minutes<12)||(minutes>14))){
+ say_file("time/minutes-i.wav"); // минуты
+ }
+ else {
+ say_file("time/minutes.wav"); //минут
+ }
- return SWITCH_STATUS_SUCCESS;
- }
+ if (seconds!=0) {
+ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)seconds);
+ ru_say_count(session,tmp ,female_c,nominativus,args);
+ if (((seconds%10) == 1) && (seconds!=11)) {
+ say_file("time/second.wav"); // секунда
+ }
+ else if (((seconds%10>1)&&(seconds%10<5))&&((seconds<12)||(seconds>14))) {
+ say_file("time/seconds-i.wav"); // секуны
+ }
+ else {
+ say_file("time/seconds.wav"); //секунд
+ }
+ }
- if ((t = atol(tosay)) > 0) {
- target = switch_time_make(t, 0);
- target_now = switch_micro_time_now();
- } else {
- target = switch_micro_time_now();
- target_now = switch_micro_time_now();
- }
-
- if (tz) {
- int check = atoi(tz);
- if (check) {
- switch_time_exp_tz(&tm, target, check);
- switch_time_exp_tz(&tm_now, target_now, check);
- } else {
- switch_time_exp_tz_name(tz, &tm, target);
- switch_time_exp_tz_name(tz, &tm_now, target_now);
- }
- } else {
- switch_time_exp_lt(&tm, target);
- switch_time_exp_lt(&tm_now, target_now);
- }
- switch (type) {
- case SST_CURRENT_DATE_TIME:
- say_date = say_time = 1;
- break;
- case SST_CURRENT_DATE:
- say_date = 1;
- break;
- case SST_CURRENT_TIME:
- say_time = 1;
- break;
- case SST_SHORT_DATE_TIME:
- say_time = 1;
- if (tm.tm_year != tm_now.tm_year) {
- say_date = 1;
- break;
- }
- if (tm.tm_yday == tm_now.tm_yday) {
- say_today = 1;
- break;
- }
- if (tm.tm_yday == tm_now.tm_yday - 1) {
- say_yesterday = 1;
- break;
- }
- if (tm.tm_yday >= tm_now.tm_yday - 5) {
- say_dow = 1;
- break;
- }
- if (tm.tm_mon != tm_now.tm_mon) {
- say_month = say_day = say_dow = 1;
- break;
- }
+ return SWITCH_STATUS_SUCCESS;
+ }
- say_month = say_day = say_dow = 1;
-
- break;
- default:
- break;
- }
+ if ((t = atol(tosay)) > 0) {
+ target = switch_time_make(t, 0);
+ target_now = switch_micro_time_now();
+ } else {
+ target = switch_micro_time_now();
+ target_now = switch_micro_time_now();
+ }
- if (say_today) {
- say_file("time/today.wav");
- }
- if (say_yesterday) {
- say_file("time/yesterday.wav");
- }
- if (say_dow) {
- say_file("time/day-%d.wav", tm.tm_wday);
- }
- if (say_date) {
- say_year = say_month = say_day = say_dow = 1;
- say_today = say_yesterday = 0;
- }
- if (say_day) {
- switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)tm.tm_mday);
- ru_say_count(session,tmp ,male,when,args);
- }
- if (say_month) {
- say_file("time/mon-%d.wav", tm.tm_mon);
- }
- if (say_year) {
- switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)(tm.tm_year + 1900));
- ru_say_count(session,tmp ,male,when,args);
- say_file("time/h-year.wav");
- }
- if (say_month||say_year||say_date||say_dow)
- {
- say_file("time/at.wav");
- }
- if (say_time) {
- switch_snprintf(tmp, sizeof(tmp), "%d:%d:%d",tm.tm_hour+1,tm.tm_min,tm.tm_sec);
- ru_say_time(session, tmp, SST_TIME_MEASUREMENT, method, args);
- }
- return SWITCH_STATUS_SUCCESS;
+ if (tz) {
+ int check = atoi(tz);
+ if (check) {
+ switch_time_exp_tz(&tm, target, check);
+ switch_time_exp_tz(&tm_now, target_now, check);
+ } else {
+ switch_time_exp_tz_name(tz, &tm, target);
+ switch_time_exp_tz_name(tz, &tm_now, target_now);
+ }
+ } else {
+ switch_time_exp_lt(&tm, target);
+ switch_time_exp_lt(&tm_now, target_now);
+ }
+ switch (type) {
+ case SST_CURRENT_DATE_TIME:
+ say_date = say_time = 1;
+ break;
+ case SST_CURRENT_DATE:
+ say_date = 1;
+ break;
+ case SST_CURRENT_TIME:
+ say_time = 1;
+ break;
+ case SST_SHORT_DATE_TIME:
+ say_time = 1;
+ if (tm.tm_year != tm_now.tm_year) {
+ say_date = 1;
+ break;
+ }
+ if (tm.tm_yday == tm_now.tm_yday) {
+ say_today = 1;
+ break;
+ }
+ if (tm.tm_yday == tm_now.tm_yday - 1) {
+ say_yesterday = 1;
+ break;
+ }
+ if (tm.tm_yday >= tm_now.tm_yday - 5) {
+ say_dow = 1;
+ break;
+ }
+ if (tm.tm_mon != tm_now.tm_mon) {
+ say_month = say_day = say_dow = 1;
+ break;
+ }
+
+ say_month = say_day = say_dow = 1;
+
+ break;
+ default:
+ break;
+ }
+
+ if (say_today) {
+ say_file("time/today.wav");
+ }
+ if (say_yesterday) {
+ say_file("time/yesterday.wav");
+ }
+ if (say_dow) {
+ say_file("time/day-%d.wav", tm.tm_wday);
+ }
+ if (say_date) {
+ say_year = say_month = say_day = say_dow = 1;
+ say_today = say_yesterday = 0;
+ }
+ if (say_day) {
+ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)tm.tm_mday);
+ ru_say_count(session,tmp ,male_h,genitivus,args);
+ }
+ if (say_month) {
+ say_file("time/mon-%d.wav", tm.tm_mon);
+ }
+ if (say_year) {
+ switch_snprintf(tmp, sizeof(tmp), "%u", (unsigned)(tm.tm_year + 1900));
+ ru_say_count(session,tmp ,male_h,genitivus,args);
+ say_file("time/h-year.wav");
+ }
+ if (say_month||say_year||say_date||say_dow)
+ {
+ say_file("time/at.wav");
+ }
+ if (say_time) {
+ switch_snprintf(tmp, sizeof(tmp), "%d:%d:%d",tm.tm_hour+1,tm.tm_min,tm.tm_sec);
+ ru_say_time(session, tmp, SST_TIME_MEASUREMENT, method, args);
+ }
+ return SWITCH_STATUS_SUCCESS;
}
+
+
static switch_status_t ru_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method,
switch_input_args_t *args)
{
@@ -1447,37 +612,40 @@
if (!(a = switch_core_session_strdup(session, tosay))) {
return SWITCH_STATUS_FALSE;
}
-
+
if (!(b = strchr(a, '.'))) {
return SWITCH_STATUS_FALSE;
}
-
+
*b++ = '\0';
-
+
if (!(c = strchr(b, '.'))) {
return SWITCH_STATUS_FALSE;
}
-
+
*c++ = '\0';
-
+
if (!(d = strchr(c, '.'))) {
return SWITCH_STATUS_FALSE;
}
-
+
*d++ = '\0';
-
- ru_say_count(session,a ,male,how_much,args);
+
+ ru_say_count(session,a ,male_c,nominativus,args);
say_file("digits/dot.wav");
- ru_say_count(session,b ,male,how_much,args);
+
+ ru_say_count(session,b ,male_c,nominativus,args);
say_file("digits/dot.wav");
- ru_say_count(session,c ,male,how_much,args);
+
+ ru_say_count(session,c ,male_c,nominativus,args);
say_file("digits/dot.wav");
- ru_say_count(session,d ,male,how_much,args);
+
+ ru_say_count(session,d ,male_c,nominativus,args);
return SWITCH_STATUS_SUCCESS;
}
-
-
+
+
static switch_status_t ru_say(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args)
{
switch_say_callback_t say_cb = NULL;
@@ -1524,9 +692,8 @@
}
return SWITCH_STATUS_FALSE;
}
+
-
-
SWITCH_MODULE_LOAD_FUNCTION(mod_say_ru_load)
{
switch_say_interface_t *say_interface;
Added: freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h
==============================================================================
--- (empty file)
+++ freeswitch/trunk/src/mod/say/mod_say_ru/mod_say_ru.h Mon May 11 14:06:08 2009
@@ -0,0 +1,581 @@
+//слишком много падежей поэтому пришлось сделать массив значений
+//пример таблицы склонений для 1 ниже по ссылкам
+//http://ru.wiktionary.org/wiki/%D0%BE%D0%B4%D0%B8%D0%BD
+//http://ru.wiktionary.org/wiki/%D0%BF%D0%B5%D1%80%D0%B2%D1%8B%D0%B9
+
+typedef enum {
+ million,
+ thousand,
+ zero,
+ empty
+} unit_t;
+
+//тип числа порядковое или количественное
+typedef enum{
+ nominativus, // именительный Кто? Что?
+ genitivus, // Родительный Кого? Чего?
+ dativus, // дательный Кого? Что?
+ accusativus_a, // Винительный Кого? animate - одушевлённый
+ accusativus_i, // Винительный Что? inanimate - неодушевлённый
+ instrumentalis, // Творительный Кем? Чем?
+ prepositive // Предложный О ком? О чём?
+} casus_t;
+
+
+typedef enum {
+ //количественный
+ male_c, //мужского пола
+ it_c, //среднего
+ female_c, //женского
+ plural_c, //множественное число
+ //порядковый
+ male_h, //порядковое мужского пола
+ it_h, //порядковое среднего
+ female_h, //порядковое женского
+ plural_h //порядковое множественное число
+} say_type_t;
+
+
+
+struct say_t{
+ char *num[8];
+ char *thousand[14];
+ char *million[14];
+ int all;
+};
+
+
+//именительный
+//именительный количественный/числительное
+
+//мужской род родительный падеж
+
+//первая строка описывае как произносить цифры от 0 до 5 потом пристаставка и окончания для остальных
+// тоже самое для тысяч и миллионов, только ещё с произношением тысяч и миллионов в вонце так же окончание для цифр
+// как произносить тысячи и миллионы берёт с цифры 5
+
+#define m_00 {\
+ {"0","1","2","3","4","5","",""},\
+ {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\
+ {"","","1","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\
+ 0,\
+}\
+//средний род именительный падеж
+#define m_01 {\
+ {"0","1n","2","3","4","5","",""},\
+ {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\
+ {"","","","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\
+ 0,\
+}\
+
+//женский
+#define m_02 {\
+ {"0","1f","2f","3","4","5","",""},\
+ {"","","1f","thousand","2f","thousands-i","3","thousands-i","4","thousands-i","5","thousands","",""},\
+ {"","","1","million","2","million-a","3","million-a","4","million-a","5","millions","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_03 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_04 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_05 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_06 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_07 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//Родительный Кого? Чего?
+//количественный/числительное
+//мужской
+#define m_10 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_11 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_12 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_13 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_14 {\
+ {"h-0x","h-1x","h-2x","h-3x","h-4x","h-4x","h-","x"},\
+ {"","","","h-thousandx","h-2xx","h-thousandx","h-3xx","h-thousandx","h-4xx","h-thousandx","h-5xx","h-thousandx","h-","xx"},\
+ {"","","","h-millionx","h-2xx","h-millionx","h-3xx","h-millionx","h-4xx","h-millionx","h-5xx","h-millionx","h-","xx"},\
+ 0,\
+}\
+//средний
+#define m_15 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_16 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_17 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//дательный Кого? Что?
+//количественный/числительное
+//мужской
+#define m_20 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_21 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_22 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_23 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_24 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_25 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_26 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_27 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//Винительный Кого? animate - одушевлённый
+//количественный/числительное
+//мужской
+#define m_30 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_31 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_32 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_33 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_34 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_35 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_36 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_37 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//Винительный Что? inanimate - неодушевлённый
+//количественный/числительное
+//мужской
+#define m_40 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_41 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_42 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_43 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_44 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_45 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_46 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_47 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//Творительный Кем? Чем?
+//количественный/числительное
+//мужской
+#define m_50 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_51 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_52 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_53 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_54 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_55 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_56 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_57 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//Предложный О ком? О чём?
+//количественный/числительное
+//мужской
+#define m_60 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_61 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_62 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_63 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_64 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_65 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_66 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_67 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
+//именительный
+//именительный количественный/числительное
+//мужской
+#define m_60 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_61 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//женский
+#define m_62 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_63 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//порядковый
+//мужской
+#define m_64 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//средний
+#define m_65 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+//женский
+#define m_66 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+//множественное число
+#define m_67 {\
+ {"","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ {"","","","","","","","","","","","","",""},\
+ 0,\
+}\
+
+
+
1
0
Author: buklov
Date: Mon May 11 13:57:38 2009
New Revision: 13277
Log:
macro voicemail_message_count fix v.2
Modified:
freeswitch/trunk/conf/lang/ru/vm/sounds.xml
Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml
==============================================================================
--- freeswitch/trunk/conf/lang/ru/vm/sounds.xml (original)
+++ freeswitch/trunk/conf/lang/ru/vm/sounds.xml Mon May 11 13:57:38 2009
@@ -61,7 +61,7 @@
</match>
</input>
<!-- от 10 до 19 и ноль --> <!-- от 5до 9 и больше 20-ти 25-29 -->
- <input pattern="^(1[0-9]|0|\d+[0-9][0,5-9]|[2-9][0,5-9]|[0,5-9]):(.*)$">
+ <input pattern="^(\d+1[0-9]|1[0-9]|0|\d+[0-9][0,5-9]|[2-9][0,5-9]|[0,5-9]):(.*)$">
<match>
<action function="play-file" data="voicemail/vm-you_have.wav"/>
<action function="say" data="$1" method="pronounced" type="MESSAGES"/>
1
0
Author: buklov
Date: Mon May 11 13:34:22 2009
New Revision: 13276
Log:
macro voicemail_message_count fix
Modified:
freeswitch/trunk/conf/lang/ru/vm/sounds.xml
Modified: freeswitch/trunk/conf/lang/ru/vm/sounds.xml
==============================================================================
--- freeswitch/trunk/conf/lang/ru/vm/sounds.xml (original)
+++ freeswitch/trunk/conf/lang/ru/vm/sounds.xml Mon May 11 13:34:22 2009
@@ -61,7 +61,7 @@
</match>
</input>
<!-- от 10 до 19 и ноль --> <!-- от 5до 9 и больше 20-ти 25-29 -->
- <input pattern="^(1[0-9]|0|\d+[0,2-9][0,5-9]|[2-9][0,5-9]|[0,5-9]):(.*)$">
+ <input pattern="^(1[0-9]|0|\d+[0-9][0,5-9]|[2-9][0,5-9]|[0,5-9]):(.*)$">
<match>
<action function="play-file" data="voicemail/vm-you_have.wav"/>
<action function="say" data="$1" method="pronounced" type="MESSAGES"/>
1
0
Author: mcollins
Date: Mon May 11 12:55:57 2009
New Revision: 13275
Log:
Update Changelog through r13274
Modified:
freeswitch/trunk/docs/ChangeLog
Modified: freeswitch/trunk/docs/ChangeLog
==============================================================================
--- freeswitch/trunk/docs/ChangeLog (original)
+++ freeswitch/trunk/docs/ChangeLog Mon May 11 12:55:57 2009
@@ -133,7 +133,7 @@
core: add auto-sync idle timers in switch_time.c (r:13161)
core: Add Q850 hangup cause variable (FSCORE-356/r:13163)
core: keep presence up to date (r:13166)
- core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176)
+ core: fix failed_xml_cdr_prefix is processed before all variables for the b-leg have been generated (FSCORE-357/r:13167,13176,13264,13274)
core: failed_xml_cdr_prefix doesn't work for list of destinations separated by pipe (FSCORE-359/r:13209)
core: add support for gcc 4.4.0 (FSCORE-355/r:13210)
core: add resume command to event socket and socket_resume variable (r:13212)
@@ -143,6 +143,7 @@
core: fix memory issue in core file resampling code (r:13233)
core: fix play and get digits when using phrase macros (r:13244)
core: Don't set the caller name to origination_uuid's value (r:13248)
+ core: Add switch_xml_parse_str_dynamic and switch_xml_parse_str_dup (r:13255)
docs: Fix filename references in phrase_en.xml (r:12976)
docs: Update phrase_en.xml to include v1.0.8 sound prompts (r:13041)
docs: Updates to phrase_es.xml (r:13067)
@@ -219,6 +220,9 @@
mod_conference: add execute_application to custom controls (r:13216)
mod_console: Fix mod_console (missing FD_ZERO before FD_SET) (r:13126)
mod_dahdi_codec: delay init of resources until the first time they are actually used to avoid unnecessary waste of resources in hardware codec (r:12962)
+ mod_dahdi_codec: set mod_dahdi_codec dahdi transcoding device sockets to non-blocking to avoid hanging when there is no data and just return 0 bytes frame (MODCODEC-8/r:13257)
+ mod_dahdi_codec: added proper waiting (up to 10ms) for the DAHDI transcoder output frame (r:13262)
+ mod_dahdi_codec: return silence frame in dahdi codec when there is no output from the decoder (r:13265)
mod_dingaling: fix crash when unloading/reload mod_dingaling (LBDING-13/r:12612)
mod_dingaling: fix no sound if phone picked up after 5th dingaling on Gtalk client (MODENDP-198/r:12641)
mod_dingaling: fix core dump when calling Gtalk enabled FS using leg_timeout (MODENDP-199/r:12641)
@@ -249,9 +253,11 @@
mod_fifo: abandon outbound calls when they are not needed, place queue name in the caller id (r:13240)
mod_file_string: add new module, allows for playing ! delimited lists of sound files (r:13182)
mod_flite: three new voices - rms, awb (male), slt (female) (r:12166)
+ mod_flite: mod_flite_shutdown not called/used (MODASRTTS-15/r:13270)
mod_iax: make mod_iax async (r:13021)
mod_iax: autoflush these channels that use queues (r:13057)
mod_lcr: allow channel vars in custom_sql (r:12198)
+ mod_lcr: Add ifdefs around odbc calls in shutdown function (r:13268)
mod_limit: Add events and a shutdown function (r:12497)
mod_limit: close odbc handle (r:12632)
mod_limit: Add more error checking to hash api/app (r:13007)
@@ -361,6 +367,9 @@
mod_sofia: Ignore ptime when missing instead of using @0i (MODENDP-206/r:13231)
mod_sofia: fix evil send myself a refer bug (FSCORE-350/r:13237)
mod_sofia: Add sofia profile params to fine-tune timers (r:13245)
+ mod_sofia: Fix incoming anonymous from MetaSwitch will not bridge (SFSIP-144/r:13266)
+ mod_sofia: Fix command "sofia xmlstatus profile internal reg" returns invalid xml text (SFSIP-145/r:13267)
+ mod_sofia: Allow retrieval of redirect contact uri parameters via channel variable (MODSOFIA-7/r:13271)
mod_spy: add new module, mod_spy (MODAPP-260/r:13035,13036)
mod_syslog: Keep the indent string in memory (LOGGER-1/r:12852)
mod_t38gateway: Introduction of the skeleton of a media bug implementing a T.38 gateway, so the
@@ -375,6 +384,7 @@
mod_voicemail: change len to seconds (r:13127)
mod_voicemail: message-query-exact-match global param in settings section of voicemail to assume profile names match domain names (r:13138)
mod_voicemail: allow unload and reload of mod_voicemail (MODAPP-177/r:13145)
+ mod_voicemail: expand the right variable (r:13272)
mod_xml_curl: fix data fetch (MODXMLINT-48/r:12586)
sofia-sip: su.h - define su_family via struct sockaddr (r:12260)
sofia-sip: sip_parser.c - fixed sip_transport_d() (r:12261)
1
0
Author: anthm
Date: Mon May 11 11:52:01 2009
New Revision: 13274
Log:
FSCORE-357
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/switch_channel.c
freeswitch/trunk/src/switch_ivr_originate.c
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Mon May 11 11:52:01 2009
@@ -886,6 +886,7 @@
CF_FS_RTP,
CF_REPORTING,
CF_PARK,
+ CF_TIMESTAMP_SET,
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
CF_FLAG_MAX
} switch_channel_flag_t;
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Mon May 11 11:52:01 2009
@@ -2507,6 +2507,8 @@
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, legbillusec);
switch_channel_set_variable(channel, "flow_billusec", tmp);
+ switch_channel_set_flag(channel, CF_TIMESTAMP_SET);
+
return status;
}
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Mon May 11 11:52:01 2009
@@ -2048,12 +2048,24 @@
if (cdr_var) {
for (i = 0; i < and_argc; i++) {
+ switch_channel_t *channel;
+
if (!originate_status[i].peer_session) {
continue;
}
+
+ channel = switch_core_session_get_channel(originate_status[i].peer_session);
- switch_channel_wait_for_state_timeout(switch_core_session_get_channel(originate_status[i].peer_session), CS_REPORTING, 5000);
- switch_yield(100000);
+ switch_channel_wait_for_flag(channel,
+ CF_TIMESTAMP_SET,
+ SWITCH_TRUE,
+ 5000,
+ NULL);
+
+ if (!switch_channel_test_flag(channel, CF_TIMESTAMP_SET) || !switch_core_session_running(originate_status[i].peer_session)) {
+ switch_core_session_reporting_state(originate_status[i].peer_session);
+ }
+
if (switch_ivr_generate_xml_cdr(originate_status[i].peer_session, &cdr) == SWITCH_STATUS_SUCCESS) {
if ((xml_text = switch_xml_toxml(cdr, SWITCH_FALSE))) {
switch_snprintf(buf, sizeof(buf), "%s_%d", cdr_var, ++cdr_total);
1
0
11 May '09
Author: mrene
Date: Sun May 10 23:07:01 2009
New Revision: 13273
Log:
Revert 13269
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Sun May 10 23:07:01 2009
@@ -2043,14 +2043,6 @@
sofia_glue_del_gateway(gateway_ptr);
sofia_reg_release_gateway(gateway_ptr);
stream->write_function(stream, "+OK gateway marked for deletion.\n");
-
- if (argc > 3 && !strcasecmp(argv[3], "rescan")) {
- if (reconfig_sofia(profile) == SWITCH_STATUS_SUCCESS) {
- stream->write_function(stream, "+OK scan complete\n");
- } else {
- stream->write_function(stream, "-ERR cannot find config for profile %s\n", profile->name);
- }
- }
} else {
stream->write_function(stream, "-ERR no such gateway.\n");
}
1
0
11 May '09
Author: mrene
Date: Sun May 10 19:27:58 2009
New Revision: 13272
Log:
mod_voicemail: expand the right variable
Modified:
freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
Modified: freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_voicemail/mod_voicemail.c Sun May 10 19:27:58 2009
@@ -2521,7 +2521,7 @@
if (switch_strlen_zero(profile->email_from)) {
from = switch_core_sprintf(pool, "%s@%s", myid, domain_name);
} else {
- from = switch_event_expand_headers(params, profile->email_headers);
+ from = switch_event_expand_headers(params, profile->email_from);
}
1
0