]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5290 --resolve
authorJeff Lenk <jeff@jefflenk.com>
Wed, 10 Apr 2013 22:43:27 +0000 (17:43 -0500)
committerTravis Cross <tc@traviscross.com>
Fri, 7 Jun 2013 07:26:16 +0000 (07:26 +0000)
src/mod/applications/mod_sms/mod_sms.c
src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c

index 9fd1d896da199a29e4908c2c3860ca3622f12dd2..f001b09442054c747e7fa98dea60df5618c482e4 100644 (file)
@@ -72,15 +72,16 @@ typedef enum {
 } break_t;
 
 
-#define check_tz() tzoff = switch_event_get_header(event, "tod_tz_offset"); \
-       tzname = switch_event_get_header(event, "timezone");                    \
+#define check_tz()                                                                                                             \
        do {                                                                                                                            \
+               tzoff = switch_event_get_header(event, "tod_tz_offset");                \
+               tzname = switch_event_get_header(event, "timezone");                    \
                if (!zstr(tzoff) && switch_is_number(tzoff)) {                                  \
                        offset = atoi(tzoff);                                                                           \
+                       break;                                                                                                          \
                } else {                                                                                                                \
                        tzoff = NULL;                                                                                           \
                }                                                                                                                               \
-               break;                                                                                                                  \
        } while(tzoff)                                                                                                          
 
 static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_t **extension)
@@ -259,7 +260,7 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
 
                                if (field && strchr(expression, '(')) {
                                        len = (uint32_t) (strlen(data) + strlen(field_data) + 10) * proceed;
-                                       if (!(substituted = malloc(len))) {
+                                       if (!(substituted = (char *) malloc(len))) {
                                                abort();
                                        }
                                        memset(substituted, 0, len);
@@ -450,10 +451,10 @@ static switch_status_t chat_send(switch_event_t *message_event)
 SWITCH_STANDARD_CHAT_APP(system_function)
 {
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Executing command: %s\n", data);
-        if (switch_system(data, SWITCH_TRUE) < 0) {
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Failed to execute command: %s\n", data);
+       if (switch_system(data, SWITCH_TRUE) < 0) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Failed to execute command: %s\n", data);
                return SWITCH_STATUS_FALSE;
-        }
+       }
        return SWITCH_STATUS_SUCCESS;
 }
 
index c0fe707fd03c0fc5424862653d2898858dc6218e..39290f78e795de54ed3eb40937beef62f0d2f0f6 100644 (file)
@@ -83,17 +83,18 @@ static switch_status_t exec_app(switch_core_session_t *session, const char *app,
 #define RECUR_SPACE 4
 #define MAX_RECUR_SPACE 100 * RECUR_SPACE
 
-#define check_tz() tzoff = switch_channel_get_variable(channel, "tod_tz_offset"); \
-       tzname = switch_channel_get_variable(channel, "timezone");                      \
+#define check_tz()                                                                                                             \
        do {                                                                                                                            \
+               tzoff = switch_event_get_header((switch_event_t *)channel, "tod_tz_offset");            \
+               tzname = switch_event_get_header((switch_event_t *)channel, "timezone");                        \
                if (!zstr(tzoff) && switch_is_number(tzoff)) {                                  \
                        offset = atoi(tzoff);                                                                           \
+                       break;                                                                                                          \
                } else {                                                                                                                \
                        tzoff = NULL;                                                                                           \
                }                                                                                                                               \
-               break;                                                                                                                  \
        } while(tzoff)                                                                                                          
-               
+
 static int parse_exten(switch_core_session_t *session, switch_caller_profile_t *caller_profile, switch_xml_t xexten, 
                                           switch_caller_extension_t **extension, const char *exten_name, int recur)
 {