forked from Mirrors/freeswitch
be1bb06be4
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10902 d0543943-73ff-0310-b7d9-9358b9ac24b2
37 lines
614 B
C
37 lines
614 B
C
#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;
|
|
}
|