mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
fix disconnect issue in event socket and fix a few small bugs
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11234 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -5,23 +5,24 @@
|
||||
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);
|
||||
|
||||
printf("Connected! %d\n", handle.sock);
|
||||
|
||||
|
||||
esl_filter(&handle, "unique-id", esl_event_get_header(handle.info_event, "caller-unique-id"));
|
||||
esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "SESSION_HEARTBEAT CHANNEL_ANSWER CHANNEL_ORIGINATE CHANNEL_PROGRESS CHANNEL_HANGUP "
|
||||
"CHANNEL_BRIDGE CHANNEL_UNBRIDGE CHANNEL_OUTGOING CHANNEL_EXECUTE CHANNEL_EXECUTE_COMPLETE DTMF CUSTOM conference::maintenance");
|
||||
|
||||
esl_execute(&handle, "answer", NULL, NULL);
|
||||
esl_execute(&handle, "playback", "/ram/swimp.raw", NULL);
|
||||
esl_execute(&handle, "conference", "3000@default", NULL);
|
||||
|
||||
sleep(30);
|
||||
while(esl_recv(&handle) == ESL_SUCCESS);
|
||||
|
||||
esl_disconnect(&handle);
|
||||
}
|
||||
|
Reference in New Issue
Block a user