Type alias CallEventHandlerMap

CallEventHandlerMap: {
    asserted_identity_changed: ((call) => void);
    datachannel: ((channel, call) => void);
    error: ((error, call) => void);
    feeds_changed: ((feeds, call) => void);
    hangup: ((call) => void);
    hold_unhold: ((onHold) => void);
    length_changed: ((length, call) => void);
    local_hold_unhold: ((onHold, call) => void);
    peer_connection_created: ((peerConn, call) => void);
    remote_hold_unhold: ((onHold, call) => void);
    replaced: ((newCall, oldCall) => void);
    send_voip_event: ((event, call) => void);
    state: ((state, oldState, call) => void);
}

These now all have the call object as an argument. Why? Well, to know which call a given event is about you have three options:

  1. Use a closure as the callback that remembers what call it's listening to. This can be a pain because you need to pass the listener function again when you remove the listener, which might be somewhere else.
  2. Use not-very-well-known fact that EventEmitter sets 'this' to the emitter object in the callback. This doesn't really play well with modern Typescript and eslint and doesn't work with our pattern of re-emitting events.
  3. Pass the object in question as an argument to the callback.

Now that we have group calls which have to deal with multiple call objects, this will become more important, and I think methods 1 and 2 are just going to cause issues.

Type declaration

  • asserted_identity_changed: ((call) => void)
      • (call): void
      • Parameters

        Returns void

  • datachannel: ((channel, call) => void)
  • error: ((error, call) => void)
  • feeds_changed: ((feeds, call) => void)
  • hangup: ((call) => void)
      • (call): void
      • Parameters

        Returns void

  • hold_unhold: ((onHold) => void)
      • (onHold): void
      • Parameters

        • onHold: boolean

        Returns void

  • length_changed: ((length, call) => void)
      • (length, call): void
      • Parameters

        Returns void

  • local_hold_unhold: ((onHold, call) => void)
      • (onHold, call): void
      • Parameters

        Returns void

  • peer_connection_created: ((peerConn, call) => void)
  • remote_hold_unhold: ((onHold, call) => void)
      • (onHold, call): void
      • Parameters

        Returns void

  • replaced: ((newCall, oldCall) => void)
  • send_voip_event: ((event, call) => void)
  • state: ((state, oldState, call) => void)

Generated using TypeDoc