CloudServices/Loop

From MozillaWiki
Jump to navigation Jump to search
Last updated: 2014/03/13
Draft-template-image.png THIS PAGE IS A WORKING DRAFT Pencil-emoji U270F-gray.png
The page may be difficult to navigate, and some information on its subject might be incomplete and/or evolving rapidly.
If you have any questions or ideas, please add them as a new topic on the discussion page.

Overview

The loop project aims to provide a WebRTC application firefox users can use from within Firefox. The server part handles registration of the clients, generation of temporary links and communication with the WebRTC infrastructure provider.

Definitions

- Simple Push URL: an URL the server can ping in order to wake up the client. - FxA assertion: a Firefox Account assertion (read token) containing a way to identify the user on the server - Provider tokens: In order to initiate a call between two parties, the provider issues tokens, session ids and client need to have an API key.

APIs

A "*" means this URI requires authentication (Ideally you should pass a valid BrowserID assertion, current implementation does that with a session cookie).

POST /registration Associates a Simple Push Endpoint (URL) with the authenticated user. (Requires a "simple_push_url" parameter.)


POST /call-url Create the call url a callee can click on. (Requires "remote_id" and "valid_duration" parameters).


GET /calls/{token} Get the app (that's the url in question, which displays an app) (No parameter required.)


POST /calls/{token} Add an incoming call (does a simple push notif and gets room tokens), return participant tokens. (No parameter required.)


GET /calls/

List incoming calls for the authenticated user. (No parameter required.)

User Flow

Let's say Bob wants to be called by Alice. The workflow is as follows:

1. Bob registers with SimplePush, he gets a simple push url back and listens to the WebSocket connection; 2. Bob asks the server to generate a call url for him; 3. Bob gives this URL to Alice; 4. Alice clicks on the link, server validates the URL and displays a WebApp with a message "do you want to call Bob"? 5. Alice decides to call Bob, server validates the URL 6. Server gets provider tokens; 7. Server stores the callee token and session id in database; 8. Server pings the Simple Push Server to wake up Bob's client; 9. Server returns caller token, session id and API Key to Alice's client 10. Bob client wakes up, go on the server to look at the list of incoming calls; 11. Server returns the list of calls (containing provider information) to Bob's client. 12. Connection can be done between Alice and Bob!