Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Signal is not sent #124

Open
abdul-elah-js opened this issue Feb 10, 2019 · 0 comments
Open

Signal is not sent #124

abdul-elah-js opened this issue Feb 10, 2019 · 0 comments

Comments

@abdul-elah-js
Copy link

I want to send a signal from a connected user and i keep getting 'signal was not sent' error which is driving me crazy, i couldn't even find a solution on the web i've been googling around for hours,

in my case i want to mimic a call so the first user presses a call button which notifies the other user about a phone call, and there i connect to a session and try to signal the first one BUT IT"S NOT WORKING,

here is what i've tried

  componentDidMount = async () => {

    await this.initiate_opentok();

  }

  initiate_opentok = async () => {

    try {

      await OpenTok.connect(this.state.appointment.call_session, this.state.appointment.call_token)

      OpenTok.on(OpenTok.events.ON_SIGNAL_RECEIVED, e => {
      
        if (e.type == 'answered') this.connect();
      
        if (e.type == 'rejected') this.disconnect();
      
      })

    } catch (e) {

      console.warn(e);

    }

  }

  answer = async () => {

    try {

      await OpenTok.sendSignal(this.state.appointment.call_session, 'answered')

    } catch (e) {

      console.warn(e);

    }

  }

what am i doing wrong here ???

help is so appreciated .. Thanks in advance

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

No branches or pull requests

1 participant