Simple voice's matchmaking server. A VoIP solution just for learning WebRTC. Seems to be working on KaiOS browser(tested on 2.5.1 with Nokia 8110 4G)

Farooq Karimi Zadeh c43065e293 mistake fixed 10 months ago
static 8ce22b2721 is it final? 10 months ago
.gitignore 77587a95cc Initial commit 10 months ago
LICENSE 77587a95cc Initial commit 10 months ago
README.md bebc777819 add link to demo 10 months ago
index.html 8ce22b2721 is it final? 10 months ago
simplevoice_server.py c43065e293 mistake fixed 10 months ago

README.md

simplevoice-server

Simple voice's server written in Python and with CherryPy. This works fine on KaiOS browser tested on KaiOS 2.5.1 browser(Nokia 8110 4G)

Demo with almost broken TURN server(I need one) but works(most likely).

Why?

Just to learn WebRTC and to see how can I make it work on KaiOS. Just this

Thank you

  • Farooq Karimi Zadeh (myself) for coding this
  • Ivan Pasev for a LOT of patience helping me with testing

API

The docs are incomplete and perhaps incorrect.

Definitions

  • <room_name> is... well no standard for this yet.
  • <client_id> is an alphanumberic all lowercase 16 characters ID for client.

The API itself

Input and

/?name=<room_name>

Front-end written with HTML, CSS, Javascript and perhaps <3!

/join?name=<room_name>

Join the given room.

  1. If the client is the first one requesting to join the room, a JSON containing its ID will be given to it as payload and it should use /get_answer to get "SDP answer". A list of STUN and TURN servers will be also given to the client. The JSON will be something like {"ID": "...", "Servers": [...]}

  2. If somebody has already joined this room the client will immediately receive "SDP offer" + a 16 character alphanumberic ID which is client's and the client must respond with /answer API with "SDP answer". Like this: {"ID": "...", "data": {...answer...}}

  3. If there are already 2 clients which has joined the room, a JSON containing an error message will be returned: {"type": "RoomFull", "msg": "The room you are trying to join is already full"}

  4. In the case of any other error, such a JSON the client will get: {"type": "InvalidState", "msg": "State is invalid!"}

/get_answer

Params: client_id:str

Returns the "SDP answer" from the second client in this format:

{"data": {...answer...}}

Or will return exactly this JSON if there was no answer in up to 10 seconds and client should send another request immediately...

{"again": "again"}

/answer

Params: client_id:str
Returns data:JSON/DICT

Send the answer back to the first client, with a JSON like this:

{"data": {...answer...}}

Returns the "SDP offer"

/leave

Params: client_id:str room:str
Returns nothing