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

Add Call Control and other call ids to call state #46

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

hugooliveirad
Copy link
Contributor

@hugooliveirad hugooliveirad commented Oct 6, 2020

The RTC backend is going to send telnyx_call_control_id,
telnyx_session_id and telnyx_leg_id params in the
telnyx_rtc.invite message. We then save it inside the Call object so
that it is accessible in upcoming notification events.

This should enable customers to cross-reference calls between the Call
Control backend and the WebRTC client.

This PR includes a few fixes to the VertoHandler tests.

📝 To Do

  • All linters pass
  • All tests pass
  • Change documentation based on my changes

✋ Manual testing

  1. npm link in this repository
  2. npm link @telnyx/webrtc in the repository you will run this code on (e.g. call-center/web-client)
  3. Open the network inspector and inspect rtc.telnyx.com messages
  4. Call your webrtc client
  5. Inspect the incoming telnyx_rtc.invite message params. Confirm it has telnyx_session_id and telnyx_leg_id. telnyx_call_control_id to be implemented.
  6. Confirm you got a notification event with telnyxSessionId and telnyxLegId as call options.

🦊 Browser testing

Desktop

  • Edge (latest)
  • Chrome
  • Firefox
  • Safari

📸 Screenshots

Description Screenshot
Desktop
usage.gif

The RTC backend is going to send `telnyx_call_control_id`,
`telnyx_session_id` and `telnyx_leg_id` params in the
`telnyx_rtc.invite` message. We then save it inside the Call object so
that it is accessible in upcoming `notification` events.

This should enable customers to cross-reference calls between the Call
Control backend and the WebRTC client.

This commit includes a few fixes to the VertoHandler tests.
@hugooliveirad hugooliveirad marked this pull request as ready for review October 19, 2020 16:40
@@ -1,275 +1,413 @@
import behaveLikeBaseSession from './behaveLike/BaseSession.spec'
import VertoHandler from './webrtc/VertoHandler'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this VertoHandler import

Comment on lines -22 to -23
VertoHandler.call(this, Verto)
LayoutHandler.call(this, Verto)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed these calls

Comment on lines +59 to +69
if (params.telnyx_call_control_id) {
callOptions.telnyxCallControlId = params.telnyx_call_control_id;
}

if (params.telnyx_session_id) {
callOptions.telnyxSessionId = params.telnyx_session_id;
}

if (params.telnyx_leg_id) {
callOptions.telnyxLegId = params.telnyx_leg_id;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code to expose telnyxSessionId and other ids

Comment on lines +33 to +36
// Optional, sent by Telnyx RTC
telnyxCallControlId?: string;
telnyxSessionId?: string;
telnyxLegId?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added options call options from invite

@hugooliveirad hugooliveirad merged commit a8441a4 into master Oct 19, 2020
@hugooliveirad hugooliveirad deleted the webrtc-179-cc-ids-on-events branch October 19, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants