question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only getting CHANNEL_EXECUTE_COMPLETE events

See original GitHub issue

We have been using node-esl on Debian without any issues, however, we needed to run one up on Ubuntu and when we do we are only getting back CHANNEL_EXECUTE_COMPLETE events from Freeswtich.

To start with am just trying to output all events to console via:

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

The installed nodejs version is 4.2.6, Freeswitch 1.6 and Ubuntu 16.04

Any ideas as to what could be the issue?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
englercjcommented, Aug 17, 2017

Setting up the listeners (connection.on) outside the callback is totally fine as all that does is register a callback in JS land (no fsw interaction), but connection.events() send messages to freeswitch. If you aren’t connected, it can’t send those events, and therefore will not work before the ready callback is called.

0reactions
byoungdalecommented, Aug 17, 2017

So, the issue I was having was that I was trying to subscribe or do an events call outside the scope of the new esl.Connection callback. Not sure if this is the same problem @kieranhackshall was having. But, this might help someone else.

If I do this:

const connection = new esl.Connection('127.0.0.1', 8021, 'ClueCon', () => {
  console.log('eslServer connected');
}); // connection

connection.events('json', 'HEARTBEAT');
connection.events('json', 'SESSION_HEARTBEAT');

connection.on('esl::event::HEARTBEAT::*', (evt) => {
  console.log(evt.getType());
});

connection.on('esl::event::SESSION_HEARTBEAT::*', (evt) => {
  console.log(evt.getType());
});

only CHANNEL_EXECUTE_COMPLETE shows up.

But, if I leave my events call inside the scope of the callback for the new esl.Connection connection, everything works. No need to change this.reqEvents to ['ALL'].

const connection = new esl.Connection('127.0.0.1', 8021, 'ClueCon', () => {
  console.log('eslServer connected');

  connection.events('json', 'HEARTBEAT');
  connection.events('json', 'SESSION_HEARTBEAT');

  connection.on('esl::event::HEARTBEAT::*', (evt) => {
    console.log(evt.getType());
  });

  connection.on('esl::event::SESSION_HEARTBEAT::*', (evt) => {
    console.log(evt.getType());
  });

}); // connection
Read more comments on GitHub >

github_iconTop Results From Across the Web

Go: one channel with multiple listeners - Stack Overflow
When I issue an API call to create an event I just get output from the processEmail function. Its whatever go routine is...
Read more >
Getting Started with Channels and Events
Now start a process instance, select the Gather Data task, fill in the form and click on Complete . Now go to the...
Read more >
Make active channel display events from 90 days ago?
For this purpose, we need to make it so that our "Critical events" active channel can display events from 90 days ago. However,...
Read more >
Receiving data multiple times · Issue #273 · pusher/pusher-js
It would seem that channel can get instantiated multiple times during the lifecycle of our app. It does not exist more than one...
Read more >
Pusher Channels Docs | What is an event?
Events can be bound to directly on a channel. This means you will only receive an event if it is sent on that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found