<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE-AT link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hello,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>i’m trying to send custom events using PHP ESL Library.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>(running FreeSWITCH Version 1.0.head (git-c37c029 2012-01-11 21-35-19 -0600))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>My PHP Code:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><?php<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> require_once('ESL.php');<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> $sock = new ESLconnection('192.168.20.73', '8021', 'ClueCon');<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> $e = new ESLevent("CUSTOM","CONFIG::AGENT_LIST");<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> </span>$e->addHeader("Agents","2022");<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> $sock->sendEvent($e);<o:p></o:p></p><p class=MsoNormal><span lang=EN-US>?><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Content-Length: 657<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Content-Type: text/event-json<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Subclass": "CONFIG::AGENT_LIST",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Name": "SOCKET_DATA",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Core-UUID": "b3ac8858-4019-11e1-910a-9b04baf8e5ea",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "FreeSWITCH-Hostname": "freeswitch.local",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "FreeSWITCH-Switchname": "freeswitch.local",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "FreeSWITCH-IPv4": "192.168.20.73",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "FreeSWITCH-IPv6": "::1",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Date-Local": "2012-01-16 15:20:23",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Date-GMT": "Mon, 16 Jan 2012 14:20:23 GMT",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Date-Timestamp": "1326723623776184",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Calling-File": "mod_event_socket.c",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Calling-Function": "read_packet",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Calling-Line-Number": "1188",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Command": "sendevent CUSTOM",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Event-Name": "CUSTOM",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "Agents": "2022",<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "ZMQ-Msg-Cnt": "3508"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Looks ok, but i don’t get why “Event-Name” is sent twice.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Shouldn’t there be an Event-Name: CUSTOM only ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Is there a way to avoid this or am i missing something ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>thx & regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>gw<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>