englercj / node-esl

FreeSWITCH ESL implementation for Node.js; implements the full Event Socket Library specified in: http://wiki.freeswitch.org/wiki/Esl
http://englercj.github.com/node-esl/
MIT License
170 stars 111 forks source link

Custom event and inbound socket #25

Closed HenriMorlaye closed 10 years ago

HenriMorlaye commented 10 years ago

Hi,

I have a dialplan that does: action application="event" data="Event-Subclass=my::event,Event Name=PARTICIPANT_ARRIVED"/

And a listening inbound socket with client.subscribe("['PARTICIPANT_ARRIVED']") client.on("my::event::PARTICIPANT_ARRIVED", function(){console.log("plop");});

PARTICIPANT_ARRIVED is never received. Is there something I didn't get in how receiving events works ?

Thanks

englercj commented 10 years ago

The client emits a lot of events (not all are from the freeswitch stream). Those that are from the stream are prefixed with esl::event:: (see the event docs). I think you may be looking for esl::event::my::event::PARTICIPANT_ARRIVED. You can always listen for esl::event::** to capture all events and log them to make sure yours is coming through.

HenriMorlaye commented 10 years ago

Thanks a lot. I managed to received this event by removing the subclass my::event:: in the diaplan and doing: client.subscribe('all'); client.on('esl::event::PARTICIPANT_ARRIVED::**', function(){...}); But if I subscribe to 'PARTICIPANT_ARRIVED' instead of 'all' I don't receive the event anymore.

englercj commented 10 years ago

Not sure, at that point node-esl is basically a pass through. It doesn't filter events that come through.