Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange States on Endpoint CallStates with Bridge/Unbridge #14

Open
haeferer opened this issue Dec 6, 2018 · 3 comments
Open

Strange States on Endpoint CallStates with Bridge/Unbridge #14

haeferer opened this issue Dec 6, 2018 · 3 comments

Comments

@haeferer
Copy link

haeferer commented Dec 6, 2018

We have hook to the event "channelCallState" on an Endpoint.

On normal operations (calling a number und Hangup) only the HangUp arrives as an event.
If you bridge 2 calls together and then call unbridge you will get within milliseconds on both endpoints?

Endpoint Stated Changed RINGING
Endpoint Stated Changed ACTIVE

Endpoint Stated Changed RINGING
Endpoint Stated Changed ACTIVE

and later (after Destroy the endpoint) a HANGUP

@haeferer
Copy link
Author

haeferer commented Dec 6, 2018

Note: after Bridge booth calls are connected and you can speak with each other, so ringing and active are finished at all

@byoungdale
Copy link
Collaborator

To clarify, is the issue that you are expecting to see an event for the endpoint changing call state to RINGING before the hangup? Per what you said:

On normal operations (calling a number und Hangup)

You are calling a number and hanging up before an answer?

@davehorton
Copy link
Collaborator

davehorton commented Jan 30, 2019

The only events that the endpoint registers for by default are these:

const EVENTS_OF_INTEREST = [
  'CHANNEL_EXECUTE',
  'CHANNEL_EXECUTE_COMPLETE',
  'CHANNEL_PROGRESS_MEDIA',
  'CHANNEL_CALLSTATE',
  'CHANNEL_ANSWER',
  'CUSTOM conference::maintenance'
];

However, I recently added the ability to add additional events that you want to be notified of. I have used it to register for custom events from some Freeswitch modules I am working on (see here for some open source freeswitch modules that you might find interesting).

You would pass the additional events you want to register to the endpoint, like this:

    ep.addCustomEventListener("mymodule::myevent", myEventHandler);

However, in your case, it sounds like you are looking to get notified of CHANNEL_CALLSTATE, which we are already subscribing for. We just aren't passing it up to application code. If you want to get notified of all of those events (there might be many!) try doing this:

ep.conn.on(`esl::event::CHANNEL_CALLSTATE::${ep.uuid}`, myEventHandler) ;

Your handler will be called with one argument, the 'event' object. For instance, you can check callstate like this:

function myEventHandler(evt) {
    const channelCallState = evt.getHeader('Channel-Call-State')  ;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants