]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix regression from previous patch
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 15 Aug 2011 16:21:31 +0000 (11:21 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 15 Aug 2011 16:21:31 +0000 (11:21 -0500)
src/mod/applications/mod_valet_parking/mod_valet_parking.c

index 3e8337d857b3249543b85ceaf3a010d3cde73463..291d6c86a5b51b2adb6d666d8130836202c86e95 100644 (file)
@@ -276,17 +276,19 @@ SWITCH_STANDARD_APP(valet_parking_function)
                        if (token->timeout) {
                                const char *var = switch_channel_get_variable(channel, "valet_ticket");
                                
-                               if (!strcmp(var, token->uuid)) {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Valet ticket %s accepted.\n", var);
-                                       switch_channel_set_variable(channel, "valet_ticket", NULL);
-                               } else {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid token %s\n", token->uuid);
-                                       switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-                                       return;
+                               if (!zstr(var)) {
+                                       if (!strcmp(var, token->uuid)) {
+                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Valet ticket %s accepted.\n", var);
+                                               switch_channel_set_variable(channel, "valet_ticket", NULL);
+                                       } else {
+                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid token %s\n", token->uuid);
+                                               switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                                               return;
+                                       }
                                }
                        }
 
-                       if (token && (b_session = switch_core_session_locate(token->uuid))) {
+                       if (!zstr(token->uuid) && (b_session = switch_core_session_locate(token->uuid))) {
                                if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, VALET_EVENT) == SWITCH_STATUS_SUCCESS) {
                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Lot-Name", lot_name);
                                        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Valet-Extension", ext);