<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">You should already have call center
      events been printed into the console.<br>
      <br>
      simply join the call center module as a agent or member.<br>
      and a new event pops ..<br>
      <br>
      <br>
      <br>
      On 6/21/13 1:32 PM, Ashish gautam wrote:<br>
    </div>
    <blockquote
cite="mid:CADBDwyGeQnyC9==HMewQ9QVkOM9CZsfLd8DAJp38RD7exucVAQ@mail.gmail.com"
      type="cite">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
              moz-do-not-send="true"
              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("callcenter_config
                    queue list members acd@default");</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 = "10.1.30.236";</div>
                      <div>our $port = 8021;</div>
                      <div>our $password = "ClueCon";</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>&nbsp;&nbsp;&nbsp; $fs-&gt;events("plain","all");</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


                          "while\n";</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>
                      &nbsp;&nbsp;&nbsp; //just print the event here <br>
                      &nbsp;&nbsp;&nbsp; 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'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 "normally" 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 moz-do-not-send="true"
                          href="http://wiki.freeswitch.org/wiki/Event_Socket_Library"
                          target="_blank">http://wiki.freeswitch.org/wiki/Event_Socket_Library</a><br>
                        <a moz-do-not-send="true"
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 "libraries" 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 = "10.1.30.236";</div>
                    <div>our $port = 8021;</div>
                    <div>our $password = "ClueCon";</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("plain","all");</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


                        "while\n";</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("CC-Action");</div>
                      <div><span style="white-space:pre-wrap"> </span>if($event_name


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


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


                        $session_cnum =
                        $reply-&gt;getHeader("CC-Member-CID-Number");</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
                            moz-do-not-send="true"
                            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 moz-do-not-send="true"
                                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 moz-do-not-send="true"
                                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 "gimme all the
                              events" or you can narrow it down a bit
                              ...<br>
                              And handle the events on your code<br>
                              <br>
                              " Taken from a old script of mine "<br>
                              <br>
                              con =
                              ESLconnection("192.168.0XXXXXX","8021","ClueCon")<br>
                              <br>
                              if con.connected:<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; // Gimme all the events OR you can
                              narrow this ...<br>
                              &nbsp;&nbsp;&nbsp; con.events("plain", "all");<br>
                              <br>
                              &nbsp;&nbsp;&nbsp; while con.connected():<br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e = con.recvEventTimed(1000)<br>
                              <br>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if e and e.getHeader("Event-Name")
                              == 'CUSTOM' and
                              e.getHeader("Event-Subclass") ==
                              'callcenter::info':
                              <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="socket"
                                    data="<a moz-do-not-send="true"
                                      href="http://127.0.0.1:8022"
                                      target="_blank">127.0.0.1:8022</a>
                                    async full"/&gt;</div>
                                  <div> <br>
                                  </div>
                                  <div>is it going to do something?&nbsp;</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 moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

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

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                            </blockquote>
                            <br>
                          </div>
                          <br>
_________________________________________________________________________<br>
                          Professional FreeSWITCH Consulting Services:<br>
                          <a moz-do-not-send="true"
                            href="mailto:consulting@freeswitch.org"
                            target="_blank">consulting@freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://www.freeswitchsolutions.com"
                            target="_blank">http://www.freeswitchsolutions.com</a><br>
                          <br>
                          FreeSWITCH-powered IP PBX: The CudaTel
                          Communication Server<br>
                          <a moz-do-not-send="true"
                            href="http://www.cudatel.com"
                            target="_blank">http://www.cudatel.com</a><br>
                          <br>
                          Official FreeSWITCH Sites<br>
                          <a moz-do-not-send="true"
                            href="http://www.freeswitch.org"
                            target="_blank">http://www.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://wiki.freeswitch.org"
                            target="_blank">http://wiki.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://www.cluecon.com"
                            target="_blank">http://www.cluecon.com</a><br>
                          <br>
                          FreeSWITCH-users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                            target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                            target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                          UNSUBSCRIBE:<a moz-do-not-send="true"
                            href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                            target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                          <a moz-do-not-send="true"
                            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 moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

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

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
              href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
            <a moz-do-not-send="true" href="http://www.cudatel.com"
              target="_blank">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              target="_blank">http://www.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://wiki.freeswitch.org"
              target="_blank">http://wiki.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://www.cluecon.com"
              target="_blank">http://www.cluecon.com</a><br>
            <br>
            FreeSWITCH-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
            UNSUBSCRIBE:<a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a moz-do-not-send="true" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>