Hi Anthony, thanks for your response ...<br><br><br>this is what i have:<br><br>        esl_filter(&amp;handle, &quot;unique-id&quot;, esl_event_get_header(handle.info_event, &quot;caller-unique-id&quot;));<br>
        esl_events(&amp;handle, ESL_EVENT_TYPE_PLAIN, &quot;CHANNEL_DATA CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP&quot;);<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 &lt;sys/types.h&gt;  /* include this before any other sys headers */<br>
#include &lt;sys/wait.h&gt;   /* header for waitpid() and various macros */<br>#include &lt;signal.h&gt;     /* header for signal functions */<br>#include &lt;stdio.h&gt;      /* header for fprintf() */<br>#include &lt;unistd.h&gt;     /* header for fork() */<br>
#include &lt;stdlib.h&gt;<br>#include &lt;esl.h&gt;<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(&amp;handle, client_sock, addr);<br><br>        esl_log(ESL_LOG_INFO, &quot;Connected! %d\n&quot;, handle.sock);<br><br>        esl_filter(&amp;handle, &quot;unique-id&quot;, esl_event_get_header(handle.info_event, &quot;caller-unique-id&quot;));<br>
        esl_events(&amp;handle, ESL_EVENT_TYPE_PLAIN, &quot;CHANNEL_DATA CHANNEL_EXECUTE_COMPLETE CHANNEL_HANGUP&quot;);<br><br>        esl_send_recv(&amp;handle, &quot;linger&quot;);<br><br>        esl_execute(&amp;handle, &quot;answer&quot;, NULL, NULL);<br>
        //esl_execute(&amp;handle, &quot;conference&quot;, &quot;3000@default&quot;, NULL);<br>        esl_execute(&amp;handle, &quot;playback&quot;, &quot;/home/tculjaga/myWavFile.wav&quot;, NULL);<br>        //esl_execute(&amp;handle, &quot;sleep&quot;, &quot;1000&quot;, NULL);<br>
        //esl_execute(&amp;handle, &quot;hangup&quot;, NULL, NULL);<br><br>        while((status = esl_recv_timed(&amp;handle, 1000)) != ESL_FAIL) {<br>                if (done) {<br>                        if (time(NULL) &gt;= exp) {<br>
                                break;<br>                        }<br>                } else if (status == ESL_SUCCESS) {<br>                        const char *type = esl_event_get_header(handle.last_event, &quot;content-type&quot;);<br>
                        if (type &amp;&amp; !strcasecmp(type, &quot;text/disconnect-notice&quot;)) {<br>                                const char *dispo = esl_event_get_header(handle.last_event, &quot;content-disposition&quot;);<br>
                                esl_log(ESL_LOG_INFO, &quot;Got a disconnection notice dispostion: [%s]\n&quot;, dispo ? dispo : &quot;&quot;);<br>                                if (!strcmp(dispo, &quot;linger&quot;)) {<br>
                                        done = 1;<br>                                        esl_log(ESL_LOG_INFO, &quot;Waiting 5 seconds for any remaining events.\n&quot;);<br>                                        exp = time(NULL) + 5;<br>
                                }<br>                        }<br>                }<br>        }<br><br>        esl_log(ESL_LOG_INFO, &quot;Disconnected! %d\n&quot;, handle.sock);<br>        esl_disconnect(&amp;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, &amp;status, WNOHANG) &lt; 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, &quot;waitpid failed\n&quot;);<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&#39;t want to block any other signals in this example */<br>        sigemptyset(&amp;act.sa_mask);<br><br>        /*<br>         * We&#39;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, &amp;act, NULL) &lt; 0) <br>        {<br>                fprintf(stderr, &quot;sigaction failed\n&quot;);<br>
                return 1;<br>        }<br>*/<br>        signal(SIGCHLD, SIG_IGN);<br><br>        esl_global_set_default_logger(0);<br>        esl_listen(&quot;localhost&quot;, 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">&lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt;</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&#39;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 &lt;<a href="mailto:tculjaga@gmail.com">tculjaga@gmail.com</a>&gt; wrote:<br>
&gt; hello,<br>
&gt;<br>
&gt; im wondering how much performance do we loose when using ESL instead of<br>
&gt; running it via dialplan?<br>
&gt;<br>
&gt;<br>
&gt; without ESL with a fine tuned FS and a short dialplan ( answer, playback<br>
&gt; like 20 seconds file, hangup ) im able to service 75 CPS. On the same FS,<br>
&gt; when i use ESL to answer the call, playback the same file and hangup, im not<br>
&gt; able to run more than 2 CPS... this is a huge impact and i really can&#39;t<br>
&gt; believe it.<br>
&gt;<br>
&gt; I&#39;m using event-socket outbound e.g.:<br>
&gt;<br>
&gt; &lt;action application=&quot;socket&quot; data=&quot;<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full&quot;/&gt;<br>
&gt;<br>
&gt; my extension looks like:<br>
&gt;<br>
&gt; &lt;extension name=&quot;ESL_C&quot;&gt;<br>
&gt;   &lt;condition field=&quot;destination_number&quot; expression=&quot;^(6666)$&quot;&gt;<br>
&gt;     &lt;action application=&quot;socket&quot; data=&quot;<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a> async full&quot;/&gt;<br>
&gt;     &lt;action application=&quot;sleep&quot; data=&quot;1000&quot;/&gt;<br>
&gt;     &lt;action application=&quot;hangup&quot;/&gt;<br>
&gt;   &lt;/condition&gt;<br>
&gt; &lt;/extension&gt;<br>
&gt;<br>
&gt;<br>
&gt; im using testserver from lib/esl/ and i just removed the conference command<br>
&gt; and added the playback one.... also i moved the esl_debug lvl to 0<br>
&gt;<br>
&gt;<br>
&gt; anyhow, FS cannot run more than 2 CPS compared to 75 CPS when the playback<br>
&gt; is done from the dialplan.<br>
&gt;<br>
&gt;<br>
&gt; Please, can someone give me a clue on what is going on?<br>
&gt; Maybe im doing something wrong?<br>
&gt; how to get maximum FS performance using ESL ?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt; Tihomir.<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Join us at ClueCon 2011, Aug 9-11, Chicago<br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a> 877-7-4ACLUE<br>
&gt;<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<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>