[Freeswitch-svn] [commit] r10902 - freeswitch/trunk/libs/esl
FreeSWITCH SVN
anthm at freeswitch.org
Sun Dec 21 15:31:39 PST 2008
Author: anthm
Date: Sun Dec 21 18:31:39 2008
New Revision: 10902
Log:
update
Added:
freeswitch/trunk/libs/esl/testserver.c
Added: freeswitch/trunk/libs/esl/testserver.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/testserver.c Sun Dec 21 18:31:39 2008
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <esl.h>
+
+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;
+}
More information about the Freeswitch-svn
mailing list