Closed clintberry closed 11 years ago
Did you try making CUSTOM all caps?
conn.on('esl::event::CUSTOM::*', function(evt){
});
I believe I did, but let me check it one more time. When I subscribe, is sofia::registration
the right thing so subscribe to?
Looks like you need both, according to the demo on the docs:
The event command are used to subscribe on events from FreeSWITCH. You may specify any number events on the same line, they should be separated with space. The events are listed in the Event List page. Examples:
event plain ALL event plain CHANNEL_CREATE CHANNEL_DESTROY CUSTOM conference::maintenance sofia::register sofia::expire event xml ALL event json CHANNEL_ANSWER
Subsequent calls to 'event' won't override the previous event sets. Supposing, you've first registered for DTMF
Note that CUSTOM
and sofia::register
are used in that second line of the examples. I would register for both.
conn.subscribe('CUSTOM sofia::register', function() {
conn.on('esl::event::CUSTOM::**', function(evt) {
//something
});
});
ah ha, let me try that.
Okay, I think I might have something wrong in my sofia config. I see debug logging in fs_cli but I don't get registration events at all in node-esl. I obviously have something up. I will close this ticket. Sorry for wasting your time on something that has nothing to do with your library.
Not a problem, glad to help!
FYI, the namesapce esl::event::CUSTOM::**
works once you have sofia logging on. Then I think it is up to you to parse which sub-event it is. Works great though.
If I subscribe to all events on freeswitch, then do an on event for
esl::event::**
I see when I have devices register, but for the life of me I can't figure out how to only subscribe to registration events. I have tried subscribing to sofia::registration, then doing an on event foresl::event::custom::**
but no luck. Is there a way to subscribe to sofia events via this library?