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?
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