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