New init and debug interface
[lcr.git] / action.cpp
index 352efb4..514c016 100644 (file)
@@ -2003,10 +2003,8 @@ void EndpointAppPBX::action_execute(void)
                        if ((pid2 = fork()) == 0) {
                                execve(command, argv, environ);
                        }
-                       else {
-                               /* Exit immediately and release the waiting parent. The subprocess falls to init because the parent died */
-                               exit(0);
-                       }
+                       /* Exit immediately and release the waiting parent. The subprocess falls to init because the parent died */
+                       exit(0);
                        break;
                default:
                        trace_header("ACTION execute", DIRECTION_NONE);
@@ -2285,11 +2283,12 @@ void EndpointAppPBX::process_dialing(int timeout)
                }
 
                gettimeofday(&current_time, NULL);
-               if (timeout && TIME_SMALLER(&e_match_timeout.timeout, &current_time)) {
+               if (e_match_to_action && TIME_SMALLER(&e_match_timeout.timeout, &current_time)) {
                        /* return timeout rule */
                        PDEBUG(DEBUG_EPOINT, "EPOINT(%d): terminal '%s' dialing: '%s', timeout in ruleset '%s'\n", ea_endpoint->ep_serial, e_ext.number, e_dialinginfo.id, e_ruleset->name);
                        unsched_timer(&e_match_timeout);
                        e_action = e_match_to_action;
+                       e_match_to_action = NULL;
                        e_extdialing = e_match_to_extdialing;
                        trace_header("ROUTING (timeout)", DIRECTION_NONE);
                        add_trace("action", NULL, "%s", action_defs[e_action->index].name);