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

no issue, just help needed #41

Closed celevra closed 9 years ago

celevra commented 9 years ago

Hi,

i'm trying to listen to the conference::maintenance (https://wiki.freeswitch.org/wiki/Mod_conference#Event_Socket_Use) events like this


var esl = require('modesl'),
conn = new esl.Connection('127.0.0.1', 8021, 'ClueCon', function() {
    conn.api('status', function(res) {
        //res is an esl.Event instance
        console.log(res.getBody());
    });
    conn.subscribe('conference::maintenance');
});

conn.on('esl::event::conference::maintenance::**', function(evt) {
     console.log('Event:', evt.getHeader('Event-Name'));
});

but i don't get anything back, also just esl:event::\ gives only channel events, is there anything special i have todo?

thank you for your help

regards

englercj commented 9 years ago

Interesting, I wonder if the event name having :: is doing something weird? It has been years since I worked with fsw and this lib actively (sorry!).

I would try conn.subscribe(); (subscribes to all messages) and see what listening to esl::event::** gives you.

Aside from that you can use something like node-inspector and breakpoint on this line and see if your message is coming in at all?

celevra commented 9 years ago

that is working it is type CUSTOM and subclass conference::maintenance so i subscribe to custom and filter with js on the subclass thank you very much for your help

englercj commented 9 years ago

@celevra Ah! No problem!