From be1bb06be42c9d6d71a60cb5db06354dae8a6b4b Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 21 Dec 2008 23:31:39 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10902 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/esl/testserver.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libs/esl/testserver.c diff --git a/libs/esl/testserver.c b/libs/esl/testserver.c new file mode 100644 index 0000000000..eec6ba50da --- /dev/null +++ b/libs/esl/testserver.c @@ -0,0 +1,36 @@ +#include +#include +#include + +static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in addr) +{ + esl_handle_t handle = {{0}}; + + if (fork()) { + close(client_sock); + return; + } + + + esl_attach_handle(&handle, client_sock, addr); + handle.debug = 2; + + printf("Connected! %d\n", handle.sock); + + + + esl_execute(&handle, "answer", NULL, NULL); + esl_execute(&handle, "playback", "/ram/swimp.raw", NULL); + + sleep(30); + + esl_disconnect(&handle); +} + +int main(void) +{ + esl_global_set_default_logger(7); + esl_listen("localhost", 8084, mycallback); + + return 0; +}