PHP ESL Custom Events Event-Name sent twice
Hello, i'm trying to send custom events using PHP ESL Library. (running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600)) My PHP Code: <?php require_once('ESL.php'); $sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon'); $e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST"); $e->addHeader("Agents","2022"); $sock->sendEvent($e); ?> When I connect to fs using telnet and run the php script from another xterm, I can see the following output: Content-Length: 657 Content-Type: text/event-json { "Event-Subclass": "CONFIG::AGENT_LIST", "Event-Name": "SOCKET_DATA", "Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea", "FreeSWITCH-Hostname": "freeswitch.local", "FreeSWITCH-Switchname": "freeswitch.local", "FreeSWITCH-IPv4": "192.168.20.73", "FreeSWITCH-IPv6": "::1", "Event-Date-Local": "2012-01-16 15:20:23", "Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT", "Event-Date-Timestamp": "1326723623776184", "Event-Calling-File": "mod_event_socket.c", "Event-Calling-Function": "read_packet", "Event-Calling-Line-Number": "1188", "Command": "sendevent CUSTOM", "Event-Name": "CUSTOM", "Agents": "2022", "ZMQ-Msg-Cnt": "3508" } Looks ok, but i don't get why "Event-Name" is sent twice. Shouldn't there be an Event-Name: CUSTOM only ? Is there a way to avoid this or am i missing something ? thx & regards, gw
I am not seeing that, perhaps you are on an older version? On Mon, Jan 16, 2012 at 9:39 AM, Gerald Weber <gerald.weber@besharp.at>wrote:
Hello,****
** **
i’m trying to send custom events using PHP ESL Library.****
(running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600))****
My PHP Code:****
** **
<?php****
require_once('ESL.php');****
** **
$sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon');****
** **
$e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST");****
$e->addHeader("Agents","2022");****
** **
$sock->sendEvent($e);****
?>****
** **
When I connect to fs using telnet and run the php script from another xterm, I can see the following output:****
** **
Content-Length: 657****
Content-Type: text/event-json****
** **
{****
"Event-Subclass": "CONFIG::AGENT_LIST",****
"Event-Name": "SOCKET_DATA",****
"Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea",****
"FreeSWITCH-Hostname": "freeswitch.local",****
"FreeSWITCH-Switchname": "freeswitch.local",****
"FreeSWITCH-IPv4": "192.168.20.73",****
"FreeSWITCH-IPv6": "::1",****
"Event-Date-Local": "2012-01-16 15:20:23",****
"Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT",****
"Event-Date-Timestamp": "1326723623776184",****
"Event-Calling-File": "mod_event_socket.c",****
"Event-Calling-Function": "read_packet",****
"Event-Calling-Line-Number": "1188",****
"Command": "sendevent CUSTOM",****
"Event-Name": "CUSTOM",****
"Agents": "2022",****
"ZMQ-Msg-Cnt": "3508"****
}****
** **
Looks ok, but i don’t get why “Event-Name” is sent twice.****
Shouldn’t there be an Event-Name: CUSTOM only ?****
Is there a way to avoid this or am i missing something ?****
** **
thx & regards,****
gw****
** **
** **
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Just for testing, try this at the fs_cli and see if you receive two different "Event-Name" headers: /log 0 /event plain custom Run your php script in another terminal window and see what shows up on the console. This is a straight ESL connection between fs_cli and the FS server so whatever you see displayed on the console is "real". Let us know what happens. -MC P.S. - Just curious, what's up with the ZMQ stuff? On Mon, Jan 16, 2012 at 7:39 AM, Gerald Weber <gerald.weber@besharp.at>wrote:
Hello,****
** **
i’m trying to send custom events using PHP ESL Library.****
(running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600))****
My PHP Code:****
** **
<?php****
require_once('ESL.php');****
** **
$sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon');****
** **
$e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST");****
$e->addHeader("Agents","2022");****
** **
$sock->sendEvent($e);****
?>****
** **
When I connect to fs using telnet and run the php script from another xterm, I can see the following output:****
** **
Content-Length: 657****
Content-Type: text/event-json****
** **
{****
"Event-Subclass": "CONFIG::AGENT_LIST",****
"Event-Name": "SOCKET_DATA",****
"Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea",****
"FreeSWITCH-Hostname": "freeswitch.local",****
"FreeSWITCH-Switchname": "freeswitch.local",****
"FreeSWITCH-IPv4": "192.168.20.73",****
"FreeSWITCH-IPv6": "::1",****
"Event-Date-Local": "2012-01-16 15:20:23",****
"Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT",****
"Event-Date-Timestamp": "1326723623776184",****
"Event-Calling-File": "mod_event_socket.c",****
"Event-Calling-Function": "read_packet",****
"Event-Calling-Line-Number": "1188",****
"Command": "sendevent CUSTOM",****
"Event-Name": "CUSTOM",****
"Agents": "2022",****
"ZMQ-Msg-Cnt": "3508"****
}****
** **
Looks ok, but i don’t get why “Event-Name” is sent twice.****
Shouldn’t there be an Event-Name: CUSTOM only ?****
Is there a way to avoid this or am i missing something ?****
** **
thx & regards,****
gw****
** **
** **
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hi, thanks for your answers @Anthony: I did a "make current" mins ago, fs starts with version FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600) @MC I connect using ./fs_cli -H 192.168.20.73 -P 8021 /log 0 /event plain custom (additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued "event plain all") Starting my php script, fs_cli shows nothing, telnet shows the event: Content-Length: 583 Content-Type: text/event-plain Event-Subclass: CONFIG%3A%3AAGENT_LIST Event-Name: SOCKET_DATA ... Event-Date-Timestamp: 1326785361276007 ... Event-Name: CUSTOM Agents: 2022 ZMQ-Msg-Cnt: 244 /event plain CUSTOM in fs_cli and restart php script -> no output. (first event subscription except all doesn't work ?) /event plain all in fs_cli and restart php script shows: RECV EVENT Event-Subclass: CONFIG::AGENT_LIST Core-UUID: ca0f2950-40d9-11e1-8145-99e6c2b17445 ... Event-Date-Timestamp: 1326785361276007 ... Command: sendevent CUSTOM Event-Name: CUSTOM Agents: 2022 ZMQ-Msg-Cnt: 244 "/event plain custom" (or /event plain CUSTOM) in fs_cli and restart php script shows the event and other events too (like RE_SCHEDULE and HEARTBEAT) This leads me to the following question: - Why does /event plain custom (/event plain CUSTOM) in fs_cli show other events too ? Then I played a bit in telnet: telnet 192.168.20.73 8021 .. auth stuff... event plain custom (or events plain CUSTOM) and restart php -> no output event plain all and restart php -> event shown filter Event-Name CUSTOM (or custom) and restart php -> no output filter delete Event-Name CUSTOM filter Event-Subclass CONFIG::AGENT_LIST and restart php -> event shown Played more with telnet: Fresh connect event plain CUSTOM -> callcenter_config agent set status .... -> no output event plain ALL -> callcenter_config agent set status .... -> event shown event filter Event-Name CUSTOM -> callcenter_config agent set status .... -> event shown (and only custom events) Seems that sending Events using the esl library adds SOCKET_DATA and event all CUSTOM / filter Event-Name custom can't handle that ? Regarding the ZMQ stuff: I use mod_event_zmq and was missing a couple of events, so I added a sequence to every event zmq publishes. Later I discovered a bug in my code, I was calling the recv function twice and didn't recognize it for a whole day..... Regards, gw Von: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] Im Auftrag von Michael Collins Gesendet: Dienstag, 17. Jänner 2012 01:36 An: FreeSWITCH Users Help Betreff: Re: [Freeswitch-users] PHP ESL Custom Events Event-Name sent twice Just for testing, try this at the fs_cli and see if you receive two different "Event-Name" headers: /log 0 /event plain custom Run your php script in another terminal window and see what shows up on the console. This is a straight ESL connection between fs_cli and the FS server so whatever you see displayed on the console is "real". Let us know what happens. -MC P.S. - Just curious, what's up with the ZMQ stuff? On Mon, Jan 16, 2012 at 7:39 AM, Gerald Weber <gerald.weber@besharp.at<mailto:gerald.weber@besharp.at>> wrote: Hello, i'm trying to send custom events using PHP ESL Library. (running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600)) My PHP Code: <?php require_once('ESL.php'); $sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon'); $e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST"); $e->addHeader("Agents","2022"); $sock->sendEvent($e); ?> When I connect to fs using telnet and run the php script from another xterm, I can see the following output: Content-Length: 657 Content-Type: text/event-json { "Event-Subclass": "CONFIG::AGENT_LIST", "Event-Name": "SOCKET_DATA", "Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea", "FreeSWITCH-Hostname": "freeswitch.local", "FreeSWITCH-Switchname": "freeswitch.local", "FreeSWITCH-IPv4": "192.168.20.73", "FreeSWITCH-IPv6": "::1", "Event-Date-Local": "2012-01-16 15<tel:2012-01-16%2015>:20:23", "Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT", "Event-Date-Timestamp": "1326723623776184", "Event-Calling-File": "mod_event_socket.c", "Event-Calling-Function": "read_packet", "Event-Calling-Line-Number": "1188", "Command": "sendevent CUSTOM", "Event-Name": "CUSTOM", "Agents": "2022", "ZMQ-Msg-Cnt": "3508" } Looks ok, but i don't get why "Event-Name" is sent twice. Shouldn't there be an Event-Name: CUSTOM only ? Is there a way to avoid this or am i missing something ? thx & regards, gw _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Tue, Jan 17, 2012 at 12:17 AM, Gerald Weber <gerald.weber@besharp.at>wrote:
Hi,****
thanks for your answers****
** **
@Anthony:****
I did a “make current” mins ago, fs starts with version****
FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600)****
** **
@MC****
I connect using ./fs_cli –H 192.168.20.73 –P 8021****
/log 0****
/event plain custom****
** **
(additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued “event plain all”)****
** **
Starting my php script, fs_cli shows nothing, telnet shows the event:****
** **
Content-Length: 583****
Content-Type: text/event-plain****
** **
Event-Subclass: CONFIG%3A%3AAGENT_LIST****
Event-Name: SOCKET_DATA****
…****
Event-Date-Timestamp: 1326785361276007****
…****
Event-Name: CUSTOM****
Agents: 2022****
ZMQ-Msg-Cnt: 244****
** **
/event plain CUSTOM in fs_cli and restart php script -> no output.****
(first event subscription except all doesn’t work ?)****
/event plain all in fs_cli and restart php script shows:****
Hmm, I guess it does not work. You can do a filter: /event plain all /filter Event-Name CUSTOM In any case I'll have to defer to Tony as to why you're seeing two different header's named "Event-Name" -MC
you cannot do *all* custom events with /event plain custom that command is expecting also a subclass param /event plain custom CONFIG::AGENT_LIST you have made a mistake if you think this unlocks heartbeat etc, probably you did events plain all and forgot. When I do it from perl I do not see what you reported, perl test.pl [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [auth/request] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: auth/request [DEBUG] esl.c:1381 esl_send() SEND auth ClueCon [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK accepted] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK accepted [DEBUG] esl.c:502 esl_sendevent() SEND EVENT Event-Name: CUSTOM Event-Subclass: CONFIG::AGENT_LIST [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK +OK log level [7] freeswitch@internal> /event plain custom CONFIG::AGENT_LIST +OK event listener enabled plain RECV EVENT Event-Subclass: CONFIG::AGENT_LIST Core-UUID: 23c2fe9b-f686-45e6-b43b-a3431d32d3e2 FreeSWITCH-Hostname: deathstar.freeswitch.org FreeSWITCH-Switchname: DeathSTAR FreeSWITCH-IPv4: 8.19.97.170 FreeSWITCH-IPv6: ::1 Event-Date-Local: 2012-01-17 11:33:51 Event-Date-GMT: Tue, 17 Jan 2012 17:33:51 GMT Event-Date-Timestamp: 1326821631120687 Event-Calling-File: mod_event_socket.c Event-Calling-Function: read_packet Event-Calling-Line-Number: 1188 Command: sendevent CUSTOM Event-Name: CUSTOM freeswitch@internal> cat test.pl require ESL; ESL::eslSetLogLevel(7); my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon"); $e = new ESL::ESLevent("CUSTOM","CONFIG::AGENT_LIST"); $con->sendEvent($e); On Tue, Jan 17, 2012 at 10:37 AM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, Jan 17, 2012 at 12:17 AM, Gerald Weber <gerald.weber@besharp.at>wrote:
Hi,****
thanks for your answers****
** **
@Anthony:****
I did a “make current” mins ago, fs starts with version****
FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600)****
** **
@MC****
I connect using ./fs_cli –H 192.168.20.73 –P 8021****
/log 0****
/event plain custom****
** **
(additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued “event plain all”)****
** **
Starting my php script, fs_cli shows nothing, telnet shows the event:*** *
** **
Content-Length: 583****
Content-Type: text/event-plain****
** **
Event-Subclass: CONFIG%3A%3AAGENT_LIST****
Event-Name: SOCKET_DATA****
…****
Event-Date-Timestamp: 1326785361276007****
…****
Event-Name: CUSTOM****
Agents: 2022****
ZMQ-Msg-Cnt: 244****
** **
/event plain CUSTOM in fs_cli and restart php script -> no output.****
(first event subscription except all doesn’t work ?)****
/event plain all in fs_cli and restart php script shows:****
Hmm, I guess it does not work. You can do a filter:
/event plain all /filter Event-Name CUSTOM
In any case I'll have to defer to Tony as to why you're seeing two different header's named "Event-Name"
-MC
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
I get the same results with your script. (maybe I was not clear in my last reply and mixed things up, still new to fs) I was just curious why a plain telnet connect to fs shows "Event-Name CUSTOM" AND "Event-Name SOCKET_DATA" and fs_cli only shows Event-Name CUSTOM Seems there is a difference between fs_cli and a plain telnet connect to fs ? My real problem: When I want to receive all CUSTOM events (not being specific to a Event-Subclass) I don't receive them using $sock->sendRecv("event plain custom"); and $sock->recvEvent() in e.g. get.php when generating this events using ESLevent("CUSTOM","CONFIG::AGENT_LIST"); and sendEvent in send.php. I guess recvEvent is listening for the first Event-Name entry. If it doesn't match -> go ahead. It works using $sock->sendRecv("event plain custom CONFIG::AGENT_LIST"); But this means I have to know where the event is injected. Or am I on the wrong way, again ? Thx & regards, gw Von: freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org> [mailto:freeswitch-users-bounces@lists.freeswitch.org]<mailto:[mailto:freeswitch-users-bounces@lists.freeswitch.org]> Im Auftrag von Anthony Minessale Gesendet: Dienstag, 17. Jänner 2012 18:11 An: FreeSWITCH Users Help Betreff: Re: [Freeswitch-users] PHP ESL Custom Events Event-Name sent twice you cannot do *all* custom events with /event plain custom that command is expecting also a subclass param /event plain custom CONFIG::AGENT_LIST you have made a mistake if you think this unlocks heartbeat etc, probably you did events plain all and forgot. When I do it from perl I do not see what you reported, perl test.pl<http://test.pl> [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [auth/request] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: auth/request [DEBUG] esl.c:1381 esl_send() SEND auth ClueCon [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK accepted] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK accepted [DEBUG] esl.c:502 esl_sendevent() SEND EVENT Event-Name: CUSTOM Event-Subclass: CONFIG::AGENT_LIST [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK +OK log level [7] freeswitch@internal> /event plain custom CONFIG::AGENT_LIST +OK event listener enabled plain RECV EVENT Event-Subclass: CONFIG::AGENT_LIST Core-UUID: 23c2fe9b-f686-45e6-b43b-a3431d32d3e2 FreeSWITCH-Hostname: deathstar.freeswitch.org<http://deathstar.freeswitch.org> FreeSWITCH-Switchname: DeathSTAR FreeSWITCH-IPv4: 8.19.97.170 FreeSWITCH-IPv6: ::1 Event-Date-Local: 2012-01-17 11:33:51 Event-Date-GMT: Tue, 17 Jan 2012 17:33:51 GMT Event-Date-Timestamp: 1326821631120687 Event-Calling-File: mod_event_socket.c Event-Calling-Function: read_packet Event-Calling-Line-Number: 1188 Command: sendevent CUSTOM Event-Name: CUSTOM freeswitch@internal> cat test.pl<http://test.pl> require ESL; ESL::eslSetLogLevel(7); my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon"); $e = new ESL::ESLevent("CUSTOM","CONFIG::AGENT_LIST"); $con->sendEvent($e); On Tue, Jan 17, 2012 at 10:37 AM, Michael Collins <msc@freeswitch.org<mailto:msc@freeswitch.org>> wrote: On Tue, Jan 17, 2012 at 12:17 AM, Gerald Weber <gerald.weber@besharp.at<mailto:gerald.weber@besharp.at>> wrote: Hi, thanks for your answers @Anthony: I did a "make current" mins ago, fs starts with version FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600) @MC I connect using ./fs_cli -H 192.168.20.73 -P 8021 /log 0 /event plain custom (additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued "event plain all") Starting my php script, fs_cli shows nothing, telnet shows the event: Content-Length: 583 Content-Type: text/event-plain Event-Subclass: CONFIG%3A%3AAGENT_LIST Event-Name: SOCKET_DATA ... Event-Date-Timestamp: 1326785361276007 ... Event-Name: CUSTOM Agents: 2022 ZMQ-Msg-Cnt: 244 /event plain CUSTOM in fs_cli and restart php script -> no output. (first event subscription except all doesn't work ?) /event plain all in fs_cli and restart php script shows: Hmm, I guess it does not work. You can do a filter: /event plain all /filter Event-Name CUSTOM In any case I'll have to defer to Tony as to why you're seeing two different header's named "Event-Name" -MC _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com<mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net<http://irc.freenode.net> #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
You are confusing the envelope event of type socket data which contains the encapsulated custom event. As I said, we do not support blindly subscribing to every custom events, you must supply every subclass name. On Wed, Jan 18, 2012 at 3:58 AM, Gerald Weber <gerald.weber@besharp.at>wrote:
I get the same results with your script. (maybe I was not clear in my last reply and mixed things up, still new to fs)****
** **
I was just curious why a plain telnet connect to fs shows “Event-Name CUSTOM” AND “Event-Name SOCKET_DATA”****
and fs_cli only shows Event-Name CUSTOM ****
Seems there is a difference between fs_cli and a plain telnet connect to fs ?****
** **
My real problem:****
When I want to receive all CUSTOM events (not being specific to a Event-Subclass) I don’t receive them using****
$sock->sendRecv("event plain custom"); and $sock->recvEvent() in e.g. get.php****
when generating this events using ESLevent("CUSTOM","CONFIG::AGENT_LIST"); and sendEvent in send.php.****
** **
I guess recvEvent is listening for the first Event-Name entry. If it doesn’t match -> go ahead.****
** **
It works using $sock->sendRecv("event plain custom CONFIG::AGENT_LIST");** **
** **
But this means I have to know where the event is injected.****
Or am I on the wrong way, again ?****
** **
Thx & regards,****
gw****
** **
** **
*Von:* freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] *Im Auftrag von *Anthony Minessale *Gesendet:* Dienstag, 17. Jänner 2012 18:11
*An:* FreeSWITCH Users Help *Betreff:* Re: [Freeswitch-users] PHP ESL Custom Events Event-Name sent twice****
** **
you cannot do *all* custom events with /event plain custom****
that command is expecting also a subclass param ****
** **
/event plain custom CONFIG::AGENT_LIST****
you have made a mistake if you think this unlocks heartbeat etc, probably you did events plain all and forgot.****
** **
When I do it from perl I do not see what you reported, ****
** **
** **
perl test.pl****
[DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [auth/request]****
[DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE****
Event-Name: SOCKET_DATA****
Content-Type: auth/request****
** **
** **
[DEBUG] esl.c:1381 esl_send() SEND****
auth ClueCon****
** **
** **
[DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply]****
[DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK accepted]****
[DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE****
Event-Name: SOCKET_DATA****
Content-Type: command/reply****
Reply-Text: +OK accepted****
** **
** **
[DEBUG] esl.c:502 esl_sendevent() SEND EVENT****
Event-Name: CUSTOM****
Event-Subclass: CONFIG::AGENT_LIST****
** **
** **
[DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply]****
[DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK]****
[DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE****
Event-Name: SOCKET_DATA****
Content-Type: command/reply****
Reply-Text: +OK****
** **
** **
** **
+OK log level [7]****
freeswitch@internal> /event plain custom CONFIG::AGENT_LIST****
+OK event listener enabled plain****
RECV EVENT****
Event-Subclass: CONFIG::AGENT_LIST****
Core-UUID: 23c2fe9b-f686-45e6-b43b-a3431d32d3e2****
FreeSWITCH-Hostname: deathstar.freeswitch.org****
FreeSWITCH-Switchname: DeathSTAR****
FreeSWITCH-IPv4: 8.19.97.170****
FreeSWITCH-IPv6: ::1****
Event-Date-Local: 2012-01-17 11:33:51****
Event-Date-GMT: Tue, 17 Jan 2012 17:33:51 GMT****
Event-Date-Timestamp: 1326821631120687****
Event-Calling-File: mod_event_socket.c****
Event-Calling-Function: read_packet****
Event-Calling-Line-Number: 1188****
Command: sendevent CUSTOM****
Event-Name: CUSTOM****
** **
** **
freeswitch@internal>****
** **
** **
** **
** **
cat test.pl****
** **
require ESL;****
** **
** **
ESL::eslSetLogLevel(7);****
** **
my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon");****
** **
$e = new ESL::ESLevent("CUSTOM","CONFIG::AGENT_LIST");****
$con->sendEvent($e);****
** **
** **
** **
** **
On Tue, Jan 17, 2012 at 10:37 AM, Michael Collins <msc@freeswitch.org> wrote:****
** **
On Tue, Jan 17, 2012 at 12:17 AM, Gerald Weber <gerald.weber@besharp.at> wrote:****
Hi,****
thanks for your answers****
****
@Anthony:****
I did a “make current” mins ago, fs starts with version****
FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600)****
****
@MC****
I connect using ./fs_cli –H 192.168.20.73 –P 8021****
/log 0****
/event plain custom****
****
(additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued “event plain all”)****
****
Starting my php script, fs_cli shows nothing, telnet shows the event:****
****
Content-Length: 583****
Content-Type: text/event-plain****
****
Event-Subclass: CONFIG%3A%3AAGENT_LIST****
Event-Name: SOCKET_DATA****
…****
Event-Date-Timestamp: 1326785361276007****
…****
Event-Name: CUSTOM****
Agents: 2022****
ZMQ-Msg-Cnt: 244****
****
/event plain CUSTOM in fs_cli and restart php script -> no output.****
(first event subscription except all doesn’t work ?)****
/event plain all in fs_cli and restart php script shows:****
Hmm, I guess it does not work. You can do a filter:
/event plain all /filter Event-Name CUSTOM
In any case I'll have to defer to Tony as to why you're seeing two different header's named "Event-Name"
-MC ****
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org****
****
** **
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900****
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Ok thanks, that makes sense to me now ! :) Von: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] Im Auftrag von Anthony Minessale Gesendet: Mittwoch, 18. Jänner 2012 19:28 An: FreeSWITCH Users Help Betreff: Re: [Freeswitch-users] PHP ESL Custom Events Event-Name sent twice You are confusing the envelope event of type socket data which contains the encapsulated custom event. As I said, we do not support blindly subscribing to every custom events, you must supply every subclass name. On Wed, Jan 18, 2012 at 3:58 AM, Gerald Weber <gerald.weber@besharp.at<mailto:gerald.weber@besharp.at>> wrote: I get the same results with your script. (maybe I was not clear in my last reply and mixed things up, still new to fs) I was just curious why a plain telnet connect to fs shows "Event-Name CUSTOM" AND "Event-Name SOCKET_DATA" and fs_cli only shows Event-Name CUSTOM Seems there is a difference between fs_cli and a plain telnet connect to fs ? My real problem: When I want to receive all CUSTOM events (not being specific to a Event-Subclass) I don't receive them using $sock->sendRecv("event plain custom"); and $sock->recvEvent() in e.g. get.php when generating this events using ESLevent("CUSTOM","CONFIG::AGENT_LIST"); and sendEvent in send.php. I guess recvEvent is listening for the first Event-Name entry. If it doesn't match -> go ahead. It works using $sock->sendRecv("event plain custom CONFIG::AGENT_LIST"); But this means I have to know where the event is injected. Or am I on the wrong way, again ? Thx & regards, gw Von: freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org> [mailto:freeswitch-users-bounces@lists.freeswitch.org]<mailto:[mailto:freeswitch-users-bounces@lists.freeswitch.org]> Im Auftrag von Anthony Minessale Gesendet: Dienstag, 17. Jänner 2012 18:11 An: FreeSWITCH Users Help Betreff: Re: [Freeswitch-users] PHP ESL Custom Events Event-Name sent twice you cannot do *all* custom events with /event plain custom that command is expecting also a subclass param /event plain custom CONFIG::AGENT_LIST you have made a mistake if you think this unlocks heartbeat etc, probably you did events plain all and forgot. When I do it from perl I do not see what you reported, perl test.pl<http://test.pl> [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [auth/request] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: auth/request [DEBUG] esl.c:1381 esl_send() SEND auth ClueCon [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK accepted] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK accepted [DEBUG] esl.c:502 esl_sendevent() SEND EVENT Event-Name: CUSTOM Event-Subclass: CONFIG::AGENT_LIST [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Content-Type] = [command/reply] [DEBUG] esl.c:1183 esl_recv_event() RECV HEADER [Reply-Text] = [+OK] [DEBUG] esl.c:1353 esl_recv_event() RECV MESSAGE Event-Name: SOCKET_DATA Content-Type: command/reply Reply-Text: +OK +OK log level [7] freeswitch@internal> /event plain custom CONFIG::AGENT_LIST +OK event listener enabled plain RECV EVENT Event-Subclass: CONFIG::AGENT_LIST Core-UUID: 23c2fe9b-f686-45e6-b43b-a3431d32d3e2 FreeSWITCH-Hostname: deathstar.freeswitch.org<http://deathstar.freeswitch.org> FreeSWITCH-Switchname: DeathSTAR FreeSWITCH-IPv4: 8.19.97.170 FreeSWITCH-IPv6: ::1 Event-Date-Local: 2012-01-17 11<tel:2012-01-17%2011>:33:51 Event-Date-GMT: Tue, 17 Jan 2012 17:33:51 GMT Event-Date-Timestamp: 1326821631120687 Event-Calling-File: mod_event_socket.c Event-Calling-Function: read_packet Event-Calling-Line-Number: 1188 Command: sendevent CUSTOM Event-Name: CUSTOM freeswitch@internal> cat test.pl<http://test.pl> require ESL; ESL::eslSetLogLevel(7); my $con = new ESL::ESLconnection("localhost", "8021", "ClueCon"); $e = new ESL::ESLevent("CUSTOM","CONFIG::AGENT_LIST"); $con->sendEvent($e); On Tue, Jan 17, 2012 at 10:37 AM, Michael Collins <msc@freeswitch.org<mailto:msc@freeswitch.org>> wrote: On Tue, Jan 17, 2012 at 12:17 AM, Gerald Weber <gerald.weber@besharp.at<mailto:gerald.weber@besharp.at>> wrote: Hi, thanks for your answers @Anthony: I did a "make current" mins ago, fs starts with version FreeSWITCH Version 1.0.head (git-ef097a1 2012-01-16 17-26-35 -0600) @MC I connect using ./fs_cli -H 192.168.20.73 -P 8021 /log 0 /event plain custom (additionally I connect to fs using telnet 192.168.20.73 8021 on another terminal and issued "event plain all") Starting my php script, fs_cli shows nothing, telnet shows the event: Content-Length: 583 Content-Type: text/event-plain Event-Subclass: CONFIG%3A%3AAGENT_LIST Event-Name: SOCKET_DATA ... Event-Date-Timestamp: 1326785361276007 ... Event-Name: CUSTOM Agents: 2022 ZMQ-Msg-Cnt: 244 /event plain CUSTOM in fs_cli and restart php script -> no output. (first event subscription except all doesn't work ?) /event plain all in fs_cli and restart php script shows: Hmm, I guess it does not work. You can do a filter: /event plain all /filter Event-Name CUSTOM In any case I'll have to defer to Tony as to why you're seeing two different header's named "Event-Name" -MC _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com<mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net<http://irc.freenode.net> #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900<tel:%2B19193869900> _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org -- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com<mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net<http://irc.freenode.net> #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org<mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
participants (3)
-
Anthony Minessale
-
Gerald Weber
-
Michael Collins