]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8056: [mod_voicemail] fix segfault on vm_inject, regression from FS-7968
authorMichael Jerris <mike@jerris.com>
Wed, 26 Aug 2015 22:06:28 +0000 (17:06 -0500)
committerMichael Jerris <mike@jerris.com>
Tue, 1 Sep 2015 20:23:03 +0000 (15:23 -0500)
src/mod/applications/mod_voicemail/mod_voicemail.c

index 418e522e46f957f7c9ed2cdd8ef47494d4f2ca1a..9ccb898b493e287b2469be677ef802bf58a97439 100644 (file)
@@ -2730,7 +2730,11 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
        switch_status_t ret = SWITCH_STATUS_SUCCESS;
        char *convert_cmd = profile->convert_cmd;
        char *convert_ext = profile->convert_ext;
-       switch_channel_t *channel = switch_core_session_get_channel(session);
+       switch_channel_t *channel = NULL;
+
+       if (session) {
+               channel = switch_core_session_get_channel(session);
+       }
 
        if (!params) {
                switch_event_create(&local_event, SWITCH_EVENT_REQUEST_PARAMS);
@@ -2883,7 +2887,9 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
                switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-UUID", use_uuid);
                switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Message-Len", "%u", message_len);
                switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Timestamp", "%lu", (unsigned long) switch_epoch_time_now(NULL));
-               switch_channel_event_set_data(channel, message_event);
+               if (channel) {
+                       switch_channel_event_set_data(channel, message_event);
+               }
 
                switch_event_fire(&message_event);