Initiating a call

From here on, our code does not get any more complex than the login handler. We will create a set of handlers to pass our message correctly for each step of the way. One of the first calls that is made after logging in is the offer handler, which designates that one user would like to call another.

It is a good idea not to get call initiations mixed up with the offer step of WebRTC. In this example, we have combined the two to make our API easier to work with. In most settings, these steps will be separated. This can be seen in an application, such as Skype, where the other user has to accept the incoming call before a connection is established between the two users.

We can now add the offer handler into this code:

case ""offer"": ...

Get Learning WebRTC now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.