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

Signal is not sent #124

@abdul-elah-js

Description

@abdul-elah-js

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions