Just for testing, try this at the fs_cli and see if you receive two different "Event-Name" headers:<br><br>/log 0<br>/event plain custom<br><br>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.<br>
<br>-MC<br><br>P.S. - Just curious, what's up with the ZMQ stuff? <br><br><div class="gmail_quote">On Mon, Jan 16, 2012 at 7:39 AM, Gerald Weber <span dir="ltr"><<a href="mailto:gerald.weber@besharp.at">gerald.weber@besharp.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="DE-AT"><div><p class="MsoNormal"><span lang="EN-US">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">i’m trying to send custom events using PHP ESL Library.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">(running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600))<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">My PHP Code:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"><?php<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US"> require_once('ESL.php');<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"> $sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon');<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US"> $e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST");<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US"> </span>$e->addHeader("Agents","2022");<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> $sock->sendEvent($e);<u></u><u></u></p><p class="MsoNormal">
<span lang="EN-US">?><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">When I connect to fs using telnet and run the php script from another xterm, I can see the following output:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Content-Length: 657<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Content-Type: text/event-json<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">{<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Event-Subclass": "CONFIG::AGENT_LIST",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "Event-Name": "SOCKET_DATA",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "FreeSWITCH-Hostname": "freeswitch.local",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "FreeSWITCH-Switchname": "freeswitch.local",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "FreeSWITCH-IPv4": "192.168.20.73",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "FreeSWITCH-IPv6": "::1",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "Event-Date-Local": "<a href="tel:2012-01-16%2015" value="+12012011615" target="_blank">2012-01-16 15</a>:20:23",<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US"> "Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Event-Date-Timestamp": "1326723623776184",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "Event-Calling-File": "mod_event_socket.c",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Event-Calling-Function": "read_packet",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "Event-Calling-Line-Number": "1188",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Command": "sendevent CUSTOM",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "Event-Name": "CUSTOM",<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> "Agents": "2022",<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> "ZMQ-Msg-Cnt": "3508"<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">}<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Looks ok, but i don’t get why “Event-Name” is sent twice.<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Shouldn’t there be an Event-Name: CUSTOM only ?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to avoid this or am i missing something ?<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">thx & regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">gw<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p></div></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>