{202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
EndProjectSection\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_timezone", "src\mod\applications\mod_timezone\mod_timezone.2008.vcproj", "{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
- EndProjectSection\r
-EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_mono", "src\mod\languages\mod_mono\mod_mono.vcproj", "{13DB4131-0142-4CAE-A14B-D6726B14A1BC}"\r
ProjectSection(ProjectDependencies) = postProject\r
{834E2B2F-5483-4B80-8FE3-FE48FF76E5C0} = {834E2B2F-5483-4B80-8FE3-FE48FF76E5C0}\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32\r
{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Any CPU.ActiveCfg = Debug|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.ActiveCfg = Debug|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|Win32.Build.0 = Debug|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Debug|x64.ActiveCfg = Debug|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Any CPU.ActiveCfg = Release|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.ActiveCfg = Release|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|Win32.Build.0 = Release|Win32\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224}.Release|x64.ActiveCfg = Release|Win32\r
{13DB4131-0142-4CAE-A14B-D6726B14A1BC}.Debug|Any CPU.ActiveCfg = Debug|Win32\r
{13DB4131-0142-4CAE-A14B-D6726B14A1BC}.Debug|Win32.ActiveCfg = Debug|Win32\r
{13DB4131-0142-4CAE-A14B-D6726B14A1BC}.Debug|x64.ActiveCfg = Debug|Win32\r
{65A6273D-FCAB-4C55-B09E-65100141A5D4} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{E3246D17-E29B-4AB5-962A-C69B0C5837BB} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{2A3D00C6-588D-4E86-81AC-9EF5EDE86E03} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
- {5CA0F863-CB0F-4250-A863-A5355BDAE224} = {E72B5BCB-6462-4D23-B419-3AF1A4AC3D78}\r
{07113B25-D3AF-4E04-BA77-4CD1171F022C} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
{A27CCA23-1541-4337-81A4-F0A6413078A0} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
{E7BC026C-7CC5-45A3-BC7C-3B88EEF01F24} = {C5F182F9-754A-4EC5-B50F-76ED02BE13F4}\r
loggers/mod_logfile
loggers/mod_syslog
applications/mod_commands
-applications/mod_timezone
applications/mod_conference
applications/mod_dptools
applications/mod_enum
opt/freeswitch/mod/mod_fsv.so*
opt/freeswitch/mod/mod_tone_stream.so*
opt/freeswitch/mod/mod_fax.so*
-opt/freeswitch/mod/mod_timezone.so*
opt/freeswitch/mod/mod_loopback.so*
opt/freeswitch/conf/vars.xml
opt/freeswitch/conf/mime.types
export APPLICATIONS_MODULES=applications/mod_commands applications/mod_conference applications/mod_dptools applications/mod_enum \
applications/mod_esf applications/mod_expr applications/mod_fifo applications/mod_limit \
applications/mod_rss applications/mod_voicemail applications/mod_fsv \
- applications/mod_timezone applications/mod_fax
+ applications/mod_fax
export ASR_TTS_MODULES=asr_tts/mod_openmrcp
export CODECS_MODULES=codecs/mod_ilbc codecs/mod_h26x codecs/mod_speex codecs/mod_voipcodecs
export DIALPLANS_MODULES=dialplans/mod_dialplan_asterisk dialplans/mod_dialplan_directory dialplans/mod_dialplan_xml
* Marcel Barbulescu <marcelbarbulescu@gmail.com>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Cesar Cepeda <cesar@auronix.com>
+ * Massimo Cetra <devel@navynet.it>
*
*
* mod_commands.c -- Misc. Command Module
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_STANDARD_API(strftime_tz_api_function)
+{
+ char *format = NULL;
+ const char *tz_name = NULL;
+ char date[80] = "";
+
+ if (!switch_strlen_zero(cmd)) {
+ format = strchr(cmd, ' ');
+ tz_name = cmd;
+ if (format) {
+ *format++ = '\0';
+ }
+ }
+
+ if (switch_strftime_tz(tz_name, format, date, sizeof(date)) == SWITCH_STATUS_SUCCESS) { /* The lookup of the zone may fail. */
+ stream->write_function(stream, "%s", date);
+ } else {
+ stream->write_function(stream, "-ERR Invalid Timezone\n");
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
{
switch_api_interface_t *commands_api_interface;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+ SWITCH_ADD_API(api_interface, "strftime_tz", "strftime_tz", strftime_tz_api_function, "<Timezone_name> [format string]");
SWITCH_ADD_API(commands_api_interface, "originate", "Originate a Call", originate_function, ORIGINATE_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "tone_detect", "Start Tone Detection on a channel", tone_detect_session_function, TONE_DETECT_SYNTAX);
SWITCH_ADD_API(commands_api_interface, "uuid_kill", "Kill Channel", kill_function, KILL_SYNTAX);
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>\r
-<VisualStudioProject\r
- ProjectType="Visual C++"\r
- Version="9.00"\r
- Name="mod_timezone"\r
- ProjectGUID="{5CA0F863-CB0F-4250-A863-A5355BDAE224}"\r
- RootNamespace="mod_timezone"\r
- Keyword="Win32Proj"\r
- TargetFrameworkVersion="131072"\r
- >\r
- <Platforms>\r
- <Platform\r
- Name="Win32"\r
- />\r
- </Platforms>\r
- <ToolFiles>\r
- </ToolFiles>\r
- <Configurations>\r
- <Configuration\r
- Name="Debug|Win32"\r
- ConfigurationType="2"\r
- InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"\r
- CharacterSet="2"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
- UsePrecompiledHeader="0"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- RandomizedBaseAddress="1"\r
- DataExecutionPrevention="0"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- <Configuration\r
- Name="Release|Win32"\r
- ConfigurationType="2"\r
- InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"\r
- CharacterSet="2"\r
- >\r
- <Tool\r
- Name="VCPreBuildEventTool"\r
- />\r
- <Tool\r
- Name="VCCustomBuildTool"\r
- />\r
- <Tool\r
- Name="VCXMLDataGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCWebServiceProxyGeneratorTool"\r
- />\r
- <Tool\r
- Name="VCMIDLTool"\r
- />\r
- <Tool\r
- Name="VCCLCompilerTool"\r
- PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"\r
- UsePrecompiledHeader="0"\r
- />\r
- <Tool\r
- Name="VCManagedResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCResourceCompilerTool"\r
- />\r
- <Tool\r
- Name="VCPreLinkEventTool"\r
- />\r
- <Tool\r
- Name="VCLinkerTool"\r
- RandomizedBaseAddress="1"\r
- DataExecutionPrevention="0"\r
- />\r
- <Tool\r
- Name="VCALinkTool"\r
- />\r
- <Tool\r
- Name="VCManifestTool"\r
- />\r
- <Tool\r
- Name="VCXDCMakeTool"\r
- />\r
- <Tool\r
- Name="VCBscMakeTool"\r
- />\r
- <Tool\r
- Name="VCFxCopTool"\r
- />\r
- <Tool\r
- Name="VCAppVerifierTool"\r
- />\r
- <Tool\r
- Name="VCPostBuildEventTool"\r
- />\r
- </Configuration>\r
- </Configurations>\r
- <References>\r
- </References>\r
- <Files>\r
- <File\r
- RelativePath=".\mod_timezone.c"\r
- >\r
- </File>\r
- </Files>\r
- <Globals>\r
- </Globals>\r
-</VisualStudioProject>\r
+++ /dev/null
-/*
- * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
- * Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
- *
- * Version: MPL 1.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is FreeSWITCH mod_timezone.
- *
- * The Initial Developer of the Original Code is
- * Massimo Cetra <devel@navynet.it>
- * Portions created by the Initial Developer are Copyright (C)
- * the Initial Developer. All Rights Reserved.
- *
- * mod_timezone.c -- Access to timezone informations and time string formatting
- *
- */
-
-#include <switch.h>
-
-
-/* **************************************************************************
- API FUNCTIONS AND COMMANDS
- ************************************************************************** */
-
-SWITCH_STANDARD_API(strftime_tz_api_function)
-{
- char *format = NULL;
- const char *tz_name = NULL;
- char date[80] = "";
-
- if (!switch_strlen_zero(cmd)) {
- format = strchr(cmd, ' ');
- tz_name = cmd;
- if (format) {
- *format++ = '\0';
- }
- }
-
- if (switch_strftime_tz(tz_name, format, date, sizeof(date)) == SWITCH_STATUS_SUCCESS) { /* The lookup of the zone may fail. */
- stream->write_function(stream, "%s", date);
- } else {
- stream->write_function(stream, "-ERR Invalid Timezone\n");
- }
-
- return SWITCH_STATUS_SUCCESS;
-}
-
-
-/* **************************************************************************
-
-************************************************************************** */
-
-
-SWITCH_MODULE_LOAD_FUNCTION(mod_timezone_load);
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_timezone_shutdown);
-SWITCH_MODULE_DEFINITION(mod_timezone, mod_timezone_load, mod_timezone_shutdown, NULL);
-
-SWITCH_MODULE_LOAD_FUNCTION(mod_timezone_load)
-{
- switch_api_interface_t *api_interface;
-
- *module_interface = switch_loadable_module_create_module_interface(pool, modname);
-
- SWITCH_ADD_API(api_interface, "strftime_tz", "strftime_tz", strftime_tz_api_function, "<Timezone name>,<format string>");
-
- return SWITCH_STATUS_SUCCESS;
-}
-
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_timezone_shutdown)
-{
-
- return SWITCH_STATUS_UNLOAD;
-}
-
-/* For Emacs:
- * Local Variables:
- * mode:c
- * indent-tabs-mode:t
- * tab-width:4
- * c-basic-offset:4
- * End:
- * For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
- */
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_file_path", file_path);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_read_flags", read_flags);
- if(switch_loadable_module_exists("mod_timezone") == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_timezone is loaded... let's try to convert\n");
- if(!switch_strlen_zero(vm_timezone)) {
- switch_status_t status;
- switch_stream_handle_t time_stream = { 0 };
- char *reply;
- char *args = switch_mprintf("%s %s", vm_timezone, profile->date_fmt);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "User's timezone is %s\n", vm_timezone);
- SWITCH_STANDARD_STREAM(time_stream);
- if ((status = switch_api_execute("strftime_tz", args, NULL, &time_stream)) == SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Successfully Converted Timezone\n");
- reply = time_stream.data;
- if(strncasecmp(reply, "-ERR", 4)) {
- if(strlen(reply)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "old time was: %s, new time is: %s\n", date, reply);
- switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", reply);
- } else {
- switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", date);
- }
- switch_safe_free(reply);
- }
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed To Successfully Convert Timezone\n");
- switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", date);
- }
- switch_safe_free(args);
+ if(!switch_strlen_zero(vm_timezone)) {
+ char tz_date[80] = "";
+ if ((switch_strftime_tz(vm_timezone, profile->date_fmt, tz_date, sizeof(tz_date)) == SWITCH_STATUS_SUCCESS) && !switch_strlen_zero(tz_date)) {
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", tz_date);
+ } else {
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", date);
}
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "mod_timezone isn't loaded... we'll only be using system time\n");
- switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", date);
}
+
switch_snprintf(tmpvar, sizeof(tmpvar), "%d", priority);
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_priority", tmpvar);
if (vm_email) {