I have an external script which simply listens on port 9090 on the same server and throws anything received on the console, I want this script to listen to the event generated by mod_callcenter.<div><br></div><div>Can this happen?</div>
<div><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 3:49 PM, Antonio Teixeira <span dir="ltr">&lt;<a href="mailto:eagle.antonio@gmail.com" target="_blank">eagle.antonio@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">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hello Not a Perl fan so i will assume
      everything is OK from a sytanx point of view.<br>
      <br>
      Now dont do <br><div class="im">
      <div> my $result = $fs-&gt;api(&quot;callcenter_config queue list
        members acd@default&quot;);</div>
      </div><div>print $result;<br>
        <br>
        The trick here is that the program will only monitor events it
        will not send .. so<br>
        <div><br>
        </div>
        <div><div class="im">
          <div>#!/usr/bin/perl</div>
          <div>use ESL;</div>
          <div>our $host = &quot;10.1.30.236&quot;;</div>
          <div>our $port = 8021;</div>
          <div>our $password = &quot;ClueCon&quot;;</div>
          <div> <br>
          </div>
          <div>my $fs = new ESL::ESLconnection($host, $port, $password);<br>
            <br>
          </div>
          <div># Listen to All events</div>
          <div>if($fs-&gt;connected()){</div>
          <div>    $fs-&gt;events(&quot;plain&quot;,&quot;all&quot;);</div>
          </div><div>}<br><div class="im">
            <br>
            <div>while($fs-&gt;connected()){<br>
              <br>
            </div>
            <div><span style="white-space:pre-wrap"> </span>print

              &quot;while\n&quot;;</div>
            <div><span style="white-space:pre-wrap"> </span>my

              $reply = $fs-&gt;recvEventTimed(1000);<br>
              <br>
            </div>
            <div><span style="white-space:pre-wrap"> </span>if($reply){<br>
              <br>
            </div></div>
                //just print the event here <br>
                e.serialize()<br>
            <div><span style="white-space:pre-wrap"></span>}</div>
            <div>}<br>
              <br>
              <br>
              Now with a soft phone call the call center you should
              start receiving events then you just need to narrow it
              down<br>
              If this doesn&#39;t work try the following:<br>
              <br>
              You are capturing ALL FS events this means you will get
              stuff like HEARTBEAT and so on if you <b>dont</b> RECEIVE
              anything there is a problem with your script.<br>
              <br>
              First get the basic right , make the program connecr and
              listen for all events.<br>
              Then tackle the callcenter part ..<br>
              <br>
              Todo :<br>
              <br>
              Get the program syntax right<br>
              <br>
              You are registering to get all the events from freeswitch<br>
              <br>
              You are making a loop while($fs-&gt;connected()){ you
              program cant exit &quot;normally&quot; unless you lost the
              connection from FS<br>
              <br>
              You MUST receive something from FS , this is <u>mandatory</u><br>
              <br>
              All the ESL commands are here<br>
              <a href="http://wiki.freeswitch.org/wiki/Event_Socket_Library" target="_blank">http://wiki.freeswitch.org/wiki/Event_Socket_Library</a><br>
<a href="http://wiki.freeswitch.org/wiki/Event_Socket_Library#Simple_Perl_Example" target="_blank">http://wiki.freeswitch.org/wiki/Event_Socket_Library#Simple_Perl_Example</a><br>
              <br>
              <br>
            </div>
            Just keep trying esl requires more work than normal
            &quot;libraries&quot; but its worth it also read the ESL manual.<span class="HOEnZb"><font color="#888888"><br>
            <br>
            Antonio<br>
          </font></span></div>
        </div>
        <br>
      </div><div class="im">
      <br>
      On 6/21/13 10:58 AM, Ashish gautam wrote:<br>
    </div></div>
    <blockquote type="cite"><div class="im">I have done this in a perl script:
      <div><br>
      </div>
      </div><div><div class="im">
        <div>#!/usr/bin/perl</div>
        <div>use ESL;</div>
        <div>our $host = &quot;10.1.30.236&quot;;</div>
        <div>our $port = 8021;</div>
        <div>our $password = &quot;ClueCon&quot;;</div>
        <div> <br>
        </div>
        <div>my $fs = new ESL::ESLconnection($host, $port, $password);</div>
        <div># Listen to All events</div>
        <div>if($fs-&gt;connected()){</div>
        <div>$fs-&gt;events(&quot;plain&quot;,&quot;all&quot;);</div>
        <div>}</div>
        <br>
        <div><br>
        </div>
        </div><div><div class="h5"><div>while($fs-&gt;connected()){</div>
        <div><span style="white-space:pre-wrap"> </span>print

          &quot;while\n&quot;;</div>
        <div><span style="white-space:pre-wrap"> </span>my

          $reply = $fs-&gt;recvEventTimed(1000);</div>
        <div><span style="white-space:pre-wrap"> </span>if($reply){</div>
        <div><span style="white-space:pre-wrap"> </span>my

          $event_name = $reply-&gt;getHeader(&quot;CC-Action&quot;);</div>
        <div><span style="white-space:pre-wrap"> </span>if($event_name

          eq &#39;member-queue-start&#39;){</div>
        <div><span style="white-space:pre-wrap"> </span>my

          $session_uuid =
          $reply-&gt;getHeader(&quot;CC-Member-Session-UUID&quot;);</div>
        <div><span style="white-space:pre-wrap"> </span>my

          $session_cnum = $reply-&gt;getHeader(&quot;CC-Member-CID-Number&quot;);</div>
        <div><span style="white-space:pre-wrap"> </span>}<span style="white-space:pre-wrap"> </span></div>
        <div><span style="white-space:pre-wrap"> </span>}</div>
        <div>}</div>
        <div>1;</div>
        <div><br>
        </div>
        The script ends showing nothing. Where is the problem?<br>
        <div class="gmail_quote">On Fri, Jun 21, 2013 at 2:42 PM,
          Antonio Teixeira <span dir="ltr">&lt;<a href="mailto:eagle.antonio@gmail.com" target="_blank">eagle.antonio@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">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Callcenter Events<br>
                <a href="http://wiki.freeswitch.org/wiki/Mod_callcenter#Events" target="_blank">http://wiki.freeswitch.org/wiki/Mod_callcenter#Events</a><br>
                <br>
                ESL Inbound<br>
                <a href="http://wiki.freeswitch.org/wiki/Mod_event_socket#Inbound" target="_blank">http://wiki.freeswitch.org/wiki/Mod_event_socket#Inbound</a><br>
                <br>
                The trick<br>
                Make a program in *whatever* ( extra points for doing it
                in asm)<br>
                Connect to FS send send &quot;gimme all the events&quot; or you
                can narrow it down a bit ...<br>
                And handle the events on your code<br>
                <br>
                &quot; Taken from a old script of mine &quot;<br>
                <br>
                con = ESLconnection(&quot;192.168.0XXXXXX&quot;,&quot;8021&quot;,&quot;ClueCon&quot;)<br>
                <br>
                if con.connected:<br>
                <br>
                    // Gimme all the events OR you can narrow this ...<br>
                    con.events(&quot;plain&quot;, &quot;all&quot;);<br>
                <br>
                    while con.connected():<br>
                        e = con.recvEventTimed(1000)<br>
                <br>
                        if e and e.getHeader(&quot;Event-Name&quot;) == &#39;CUSTOM&#39;
                and e.getHeader(&quot;Event-Subclass&quot;) == &#39;callcenter::info&#39;:
                <div>
                  <div><br>
                    <br>
                    <br>
                    <br>
                    On 6/21/13 9:56 AM, Ashish gautam wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div>Hi,
                    <div><br>
                    </div>
                    <div>I am working with mod_callcenter. I want FS to
                      send event data to an external script on two
                      events when they happen. first when a caller is
                      just answered and is in waiting state. Second,
                      when he is connected to any agent.</div>
                    <div><br>
                    </div>
                    <div>I have written this line in the dialplan:</div>
                    <div><br>
                    </div>
                    <div>&lt;action application=&quot;socket&quot; data=&quot;<a href="http://127.0.0.1:8022" target="_blank">127.0.0.1:8022</a>
                      async full&quot;/&gt;</div>
                    <div> <br>
                    </div>
                    <div>is it going to do something? </div>
                    <div><br>
                    </div>
                    <div>Please throw some light on it.</div>
                    <div>
                      <div><br>
                      </div>
                      -- <br>
                      <span style="color:rgb(0,0,102);font-family:georgia,serif">Ashish


                        Gautam</span><br>
                      <font color="#000066" face="georgia, serif"><br>
                        <br>
                      </font></div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
_________________________________________________________________________<br>
            Professional FreeSWITCH Consulting Services:<br>
            <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
            <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
            <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
            <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
            <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
            <br>
            FreeSWITCH-users mailing list<br>
            <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">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>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <span style="color:rgb(0,0,102);font-family:georgia,serif">Ashish

          Gautam</span><br>
        <font color="#000066" face="georgia, serif"><br>
          Nucleus Microsystems (Pvt.) Ltd.<br>
          <br>
          Ph. 011 47574758</font> </div></div></div><div><div class="h5">
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
    </div></div></blockquote>
    <br>
  </div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><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></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="color:rgb(0,0,102);font-family:georgia,serif">Ashish Gautam</span><br><font face="georgia, serif" color="#000066"><br>Nucleus Microsystems (Pvt.) Ltd.<br>
<br>Ph. 011 47574758</font>
</div>