Hi Anthony, thanks for your response ...<br><br><br>this is what i have:<br><br> esl_filter(&handle, "unique-id", esl_event_get_header(handle.info_event, "caller-unique-id"));<br>
esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "CHANNEL_DATA CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP");<br>
<br>what do you suggest i put there ?<br><br><br>is the inbound method less costly ?<br><br><br><br><br>I modified testserver.c just a bit...<br><br>#include <sys/types.h> /* include this before any other sys headers */<br>
#include <sys/wait.h> /* header for waitpid() and various macros */<br>#include <signal.h> /* header for signal functions */<br>#include <stdio.h> /* header for fprintf() */<br>#include <unistd.h> /* header for fork() */<br>
#include <stdlib.h><br>#include <esl.h><br><br>void sig_chld(int); /* prototype for our SIGCHLD handler */<br><br>static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr)<br>
{<br> esl_handle_t handle = {{0}};<br> int done = 0;<br> esl_status_t status;<br> time_t exp = 0;<br><br> if (fork() != 0) {<br> close(client_sock);<br> return;<br>
}<br><br> esl_attach_handle(&handle, client_sock, addr);<br><br> esl_log(ESL_LOG_INFO, "Connected! %d\n", handle.sock);<br><br> esl_filter(&handle, "unique-id", esl_event_get_header(handle.info_event, "caller-unique-id"));<br>
esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "CHANNEL_DATA CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP");<br><br> esl_send_recv(&handle, "linger");<br><br> esl_execute(&handle, "answer", NULL, NULL);<br>
//esl_execute(&handle, "conference", "3000@default", NULL);<br> esl_execute(&handle, "playback", "/home/tculjaga/myWavFile.wav", NULL);<br> //esl_execute(&handle, "sleep", "1000", NULL);<br>
//esl_execute(&handle, "hangup", NULL, NULL);<br><br> while((status = esl_recv_timed(&handle, 1000)) != ESL_FAIL) {<br> if (done) {<br> if (time(NULL) >= exp) {<br>
break;<br> }<br> } else if (status == ESL_SUCCESS) {<br> const char *type = esl_event_get_header(handle.last_event, "content-type");<br>
if (type && !strcasecmp(type, "text/disconnect-notice")) {<br> const char *dispo = esl_event_get_header(handle.last_event, "content-disposition");<br>
esl_log(ESL_LOG_INFO, "Got a disconnection notice dispostion: [%s]\n", dispo ? dispo : "");<br> if (!strcmp(dispo, "linger")) {<br>
done = 1;<br> esl_log(ESL_LOG_INFO, "Waiting 5 seconds for any remaining events.\n");<br> exp = time(NULL) + 5;<br>
}<br> }<br> }<br> }<br><br> esl_log(ESL_LOG_INFO, "Disconnected! %d\n", handle.sock);<br> esl_disconnect(&handle);<br>
<br> close(client_sock);<br><br> _exit(0);<br>}<br><br>/*<br> * The signal handler function -- only gets called when a SIGCHLD<br> * is received, ie when a child terminates<br> */<br>void sig_chld(int signo) <br>
{<br> int status;<br><br> /* Wait for any child without blocking */<br> if (waitpid(-1, &status, WNOHANG) < 0) <br> {<br> /*<br> * calling standard I/O functions like fprintf() in a <br> * signal handler is not recommended, but probably OK <br>
* in toy programs like this one.<br> */<br> fprintf(stderr, "waitpid failed\n");<br> return;<br> }<br>}<br><br>int main(void)<br>{<br> struct sigaction act;<br><br> /* Assign sig_chld as our SIGCHLD handler */<br>
act.sa_handler = sig_chld;<br><br> /* We don't want to block any other signals in this example */<br> sigemptyset(&act.sa_mask);<br><br> /*<br> * We're only interested in children that have terminated, not ones<br>
* which have been stopped (eg user pressing control-Z at terminal)<br> */<br> act.sa_flags = SA_NOCLDSTOP;<br><br> /*<br> * Make these values effective. If we were writing a real <br>
* application, we would probably save the old value instead of <br> * passing NULL.<br> */<br>/* if (sigaction(SIGCHLD, &act, NULL) < 0) <br> {<br> fprintf(stderr, "sigaction failed\n");<br>
return 1;<br> }<br>*/<br> signal(SIGCHLD, SIG_IGN);<br><br> esl_global_set_default_logger(0);<br> esl_listen("localhost", 8088, mycallback);<br><br> return 0;<br>
}<br><br><br><br><br><div class="gmail_quote">On Thu, Aug 11, 2011 at 9:59 PM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
try removing the filter and event subscriptions<br>
it's costly to consume all of the events especially at 75cps.<br>
<div><div></div><div class="h5"><br>
<br>
On Thu, Aug 11, 2011 at 5:23 AM, Tihomir Culjaga <<a href="mailto:tculjaga@gmail.com">tculjaga@gmail.com</a>> wrote:<br>
> hello,<br>
><br>
> im wondering how much performance do we loose when using ESL instead of<br>
> running it via dialplan?<br>
><br>
><br>
> without ESL with a fine tuned FS and a short dialplan ( answer, playback<br>
> like 20 seconds file, hangup ) im able to service 75 CPS. On the same FS,<br>
> when i use ESL to answer the call, playback the same file and hangup, im not<br>
> able to run more than 2 CPS... this is a huge impact and i really can't<br>
> believe it.<br>
><br>
> I'm using event-socket outbound e.g.:<br>
><br>
> <action application="socket" data="<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full"/><br>
><br>
> my extension looks like:<br>
><br>
> <extension name="ESL_C"><br>
> <condition field="destination_number" expression="^(6666)$"><br>
> <action application="socket" data="<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full"/><br>
> <action application="sleep" data="1000"/><br>
> <action application="hangup"/><br>
> </condition><br>
> </extension><br>
><br>
><br>
> im using testserver from lib/esl/ and i just removed the conference command<br>
> and added the playback one.... also i moved the esl_debug lvl to 0<br>
><br>
><br>
> anyhow, FS cannot run more than 2 CPS compared to 75 CPS when the playback<br>
> is done from the dialplan.<br>
><br>
><br>
> Please, can someone give me a clue on what is going on?<br>
> Maybe im doing something wrong?<br>
> how to get maximum FS performance using ESL ?<br>
><br>
><br>
><br>
> Regards,<br>
> Tihomir.<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Join us at ClueCon 2011, Aug 9-11, Chicago<br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:<a href="tel:%2B19193869900" value="+19193869900">+19193869900</a><br>
<br>
_______________________________________________<br>
Join us at ClueCon 2011, Aug 9-11, Chicago<br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>