Skip to content

CiprianDaniel/webrtc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skill Calling WebRTC Demo Server

This is a sample server and web app for using network skills for WebRTC integration on Alexa.

Requirements

The server must be hosted somewhere accessible to your Skill and Browser and fronted by a load balancer that terminates HTTPS. Additionally, it must have Node.js 16 or later installed. For simplicity a Node.js Elastic Beanstalk Environment is a great option.

Usage

Select a suitable hosting environment matching the above requirements.

Replace the following locations with your specific details

  1. ALEXA_REFRESH_TOKEN with the value of your refresh token from account linking
  2. ALEXA_CLIENT_ID with your Skill's Client ID
  3. ALEXA_CLIENT_SECRET with your Skill's Client Secret

Running manually

Setup and start the server

> npm i
> npm start

Through Elastic Beanstalk

Create a zip of the directory

> zip ../webrtc_server.zip -r * 

Upload the created webrtc_server.zip archive to a Node.js Elastic Beanstalk environment.

Placing a call

Once everything is deployed, you should now be able to open the WebApp at your server's URL and follow the instructions to place or receive a call to/from your Alexa devices.

How it works

The server setups up two different endpoints both on port 8080, one for standard REST HTTP requests accepting events from the skill and another WebSocket endpoint on /ws for having a bidirectional signaling channel with the browser. Events sent on these channels are an overloaded form of the standard RTCSessionDescription with the general structure of

{
    type: "register|offer|answer|ringing|end|error",
    sdp: "<sdp blob>",
    sessionId: "<sessionId from Alexa>",
    target: "<Id of target, ony on offers>",
    source: "<Id of source, only on offers>",
    message: "<status message>"
}

Outbound call flow

Outbound Call Flow

Inbound call flow

Inbound Call Flow

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published