What you are missing is that you are parsing the results incorrectly.<br><br>The events that are showing up as CUSTOM only do so because the id of CUSTOM is 0<br>there are no types in the events received with recvEvent the are only used for transport.<br>
<br>When you say "events plain all"<br><br>you are asking for events to be delivered, the FS events are not the same as the events you are using<br>to communicate at the lowest level.<br><br>What you should be doing is checking for content-type of text/event-plain <br>
and then and only then, get the payload with getBody.<br>This will contain a serialized event in it's entirety from FS.<br><br>for clarity sake I have added a new event SOCKET_DATA to tree and from now on you will<br>
see those low level events with that type.<br><br><br><br><div class="gmail_quote">On Sat, Jan 2, 2010 at 12:08 PM, Alberto Escudero <span dir="ltr"><<a href="mailto:aep.lists@it46.se">aep.lists@it46.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I do not know if really helps you but we are facing the same problem in<br>
one of our implementations using the ESL.so for PHP.<br>
<br>
We have only see this problem when subscribing to the CHANNEL_STATE<br>
<br>
getType() should always match EventName... but it does not<br>
./aep<br>
<font color="#888888"><br>
--<br>
Stopping junk mailers is good for the environment<br>
</font><div><div></div><div class="h5"><br>
> Would someone please take a look at this simple PHP event socket script<br>
> and<br>
> tell me what I am doing wrong - or tell me that this could be a bug<br>
> elsewhere? Any help would be appreciated.<br>
><br>
> When I run the script without the call to execute(), everything seems<br>
> fine.<br>
> When I include the call to execute(), the calls to getType() return CUSTOM<br>
> for a while, then later start to return the correct name.<br>
><br>
> #!/usr/bin/php<br>
> <?php<br>
> require_once 'ESL.php';<br>
> $endPoint = 'sofia/internal/695%192.168.100.132';<br>
><br>
> $eventSocket = New ESLconnection('192.168.100.132', '8021', 'ClueCon');<br>
> $event = $eventSocket->events('plain', 'ALL');<br>
><br>
> // call endpoint, get uuid<br>
> $event = $eventSocket->api('originate', $endPoint . ' &park');<br>
> $serializedEvent = explode("\n", $event->serialize());<br>
> foreach ($serializedEvent as $eventLine) {<br>
> list($dummy, $uuid) = explode('+OK ', $eventLine);<br>
> if ($uuid) { break; }<br>
> }<br>
><br>
> // play announcement to endpoint<br>
> $event = $eventSocket->execute('playback', '/opt/ann/user-busy.wav',<br>
> $uuid);<br>
><br>
> // monitor events<br>
> while (TRUE) {<br>
> echo "getType: " . $event->getType() . "\n";<br>
> $serializedEvent = explode("\n", $event->serialize());<br>
> foreach ($serializedEvent as $eventLine) {<br>
> list($header, $value) = explode(': ', $eventLine);<br>
> if ($header == "Event-Name") { printf($eventLine . "\n"); }<br>
> if ($header == "Content-Type") { printf($eventLine . "\n"); }<br>
> }<br>
><br>
> printf("\n");<br>
> $event = $eventSocket->recvEvent();<br>
> }?><br>
><br>
><br>
> Run without the call to execute():<br>
> ==================================<br>
> getType: CUSTOM<br>
> Content-Type: api/response<br>
><br>
> getType: CHANNEL_CREATE<br>
> Event-Name: CHANNEL_CREATE<br>
><br>
> getType: CHANNEL_OUTGOING<br>
> Event-Name: CHANNEL_OUTGOING<br>
><br>
> getType: CHANNEL_ORIGINATE<br>
> Event-Name: CHANNEL_ORIGINATE<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CALL_UPDATE<br>
> Event-Name: CALL_UPDATE<br>
><br>
> getType: CHANNEL_PROGRESS<br>
> Event-Name: CHANNEL_PROGRESS<br>
><br>
> getType: HEARTBEAT<br>
> Event-Name: HEARTBEAT<br>
><br>
> getType: HEARTBEAT<br>
> Event-Name: RE_SCHEDULE<br>
><br>
> getType: CALL_UPDATE<br>
> Event-Name: CALL_UPDATE<br>
><br>
> getType: CODEC<br>
> Event-Name: CODEC<br>
><br>
> getType: CODEC<br>
> Event-Name: CODEC<br>
><br>
> getType: CHANNEL_ANSWER<br>
> Event-Name: CHANNEL_ANSWER<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: API<br>
> Event-Name: API<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CHANNEL_EXECUTE<br>
> Event-Name: CHANNEL_EXECUTE<br>
><br>
> getType: CHANNEL_PARK<br>
> Event-Name: CHANNEL_PARK<br>
><br>
> getType: CHANNEL_HANGUP<br>
> Event-Name: CHANNEL_HANGUP<br>
><br>
> getType: CHANNEL_UNPARK<br>
> Event-Name: CHANNEL_UNPARK<br>
><br>
> getType: CHANNEL_EXECUTE_COMPLETE<br>
> Event-Name: CHANNEL_EXECUTE_COMPLETE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_HANGUP_COMPLETE<br>
> Event-Name: CHANNEL_HANGUP_COMPLETE<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CHANNEL_DESTROY<br>
> Event-Name: CHANNEL_DESTROY<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
><br>
> Run with the call to execute():<br>
> ===============================<br>
> getType: CUSTOM<br>
> Content-Type: command/reply<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_CREATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_OUTGOING<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_ORIGINATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CALL_UPDATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_PROGRESS<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CALL_UPDATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CODEC<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CODEC<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_ANSWER<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: API<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_EXECUTE<br>
><br>
> getType: CUSTOM<br>
> Content-Type: text/event-plain<br>
> Event-Name: CHANNEL_PARK<br>
><br>
> getType: CHANNEL_EXECUTE<br>
> Event-Name: CHANNEL_EXECUTE<br>
><br>
> getType: CHANNEL_HANGUP<br>
> Event-Name: CHANNEL_HANGUP<br>
><br>
> getType: CHANNEL_EXECUTE_COMPLETE<br>
> Event-Name: CHANNEL_EXECUTE_COMPLETE<br>
><br>
> getType: COMMAND<br>
> Event-Name: COMMAND<br>
><br>
> getType: CHANNEL_UNPARK<br>
> Event-Name: CHANNEL_UNPARK<br>
><br>
> getType: CHANNEL_EXECUTE_COMPLETE<br>
> Event-Name: CHANNEL_EXECUTE_COMPLETE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: PRESENCE_IN<br>
> Event-Name: PRESENCE_IN<br>
><br>
> getType: CHANNEL_HANGUP_COMPLETE<br>
> Event-Name: CHANNEL_HANGUP_COMPLETE<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
> getType: CHANNEL_DESTROY<br>
> Event-Name: CHANNEL_DESTROY<br>
><br>
> getType: CHANNEL_STATE<br>
> Event-Name: CHANNEL_STATE<br>
><br>
><br>
> Thanks,<br>
> Ron<br>
><br>
><br>
><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>
><br>
<br>
<br>
<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:+19193869900<br>