]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
after f7f9a43a4056b7fb238ecfa0b7266b8c844f140f missing a bunch of code changes
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 26 Mar 2012 21:41:49 +0000 (16:41 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 26 Mar 2012 21:41:49 +0000 (16:41 -0500)
libs/esl/ivrd.c

index 406632725766684b6ce9bce2c2a25fdb09358fe0..2a2a607202d876976e32c67a9539c6037e423c42 100644 (file)
 static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr)
 {
        esl_handle_t handle = {{0}};
-       char path_buffer[1024] = { 0 };
        const char *path;
        
        if (esl_attach_handle(&handle, client_sock, addr) != ESL_SUCCESS || !handle.info_event) {
+               close(client_sock);
                esl_log(ESL_LOG_ERROR, "Socket Error\n");
-               exit(0);
+               return;
        }
 
        if (!(path = esl_event_get_header(handle.info_event, "variable_ivr_path"))) {
                esl_disconnect(&handle);
                esl_log(ESL_LOG_ERROR, "Missing ivr_path param!\n");
-               exit(0);
+               return;
        }
 
-       strncpy(path_buffer, path, sizeof(path_buffer) - 1);
-       
        /* hotwire the socket to STDIN/STDOUT */
        dup2(client_sock, STDIN_FILENO);
        dup2(client_sock, STDOUT_FILENO);
 
-       /* close the handle but leak the socket on purpose cos the child will need it open */
-       handle.sock = -1;
+       system(path);
        esl_disconnect(&handle);
        
-       execl(path_buffer, path_buffer, (char *)NULL);
-       //system(path_buffer);
-       close(client_sock);
-       exit(0);
 }
 
 int main(int argc, char *argv[])