Examples - client and server integration

The following examples show how to build SIP based WebRTC applications in a nutshell with Frafos ABC SBC server and JsSIP client.

JsSIP User Agent

A JsSIP User Agent is associated to a SIP user account. It requires some configuration parameters for its initialization which are provided through a configuration object. Click here for a Full UA Configuration Parameters list

SIP Registration

A single HTML button is used to register and unregister the User Agent. On click, the user agent is registered or unregistered using UA.register() and UA.unregister() methods respectively.

On the server side, many specific options are available for REGISTER management as exposed in the Registration Caching and Handling documentation section.

Outgoing Call

First of all a pair of HTML5 video elements are created, where the local and remote media will be rendered.

The destination is called by using the UA.call() method and the call state is retrieved by defining callbacks to the call events.

An HTML button is used to terminate the call which calls the call.terminate() method on click.

On the server side, a wide range of operations can be performed such as filtering, SIP and media management, transcoding, and a long etcetera, as exposed in the General Configuration Reference.


In addition to the Outgoing Call explained in the previous example, this one provides with a mechanism to send DTMFs on an ongoing call.

HTML buttons emulate a dialpad, which use call.sendDTMF() method on click to send the corresponding DTMFs encapsulated in a SIP INFO message.

On the server side, the DTMFs are bypassed to the other end, but they could also be transformed to inband DTMFs or captured by the server to provide some functionality like call transfer, music on hold, etc.

SIP Message

A simple HTML buton triggers the UA.sendMessage() method to send a text message to the other end.

On the server side, the message can be forwarded to the destination or blocked based on any local policy. Of course SIP routing rules, SIP mediation and much more options are available as for any other SIP message type.

Copyright 2017 | FRAFOS GmbH. Support available by email, contact support@frafos.com Imprint | Disclaimer