A SIP call made through the WCS server can be captured to an RTMP stream and rebroadcast to the specified RTMP server when the call is created. One usage example is publishing a call to Facebook or Youtube.

Operation flowchart

  1. The browser starts a call by sending the /call/startup REST query.
  2. WCS connects to the SIP server
  3. The SIP server sends the RTP stream of the call to WCS
  4. WCS connects to the RTMP server
  5. The RTMP server receives the RTMP stream

Quick manual on testing

1. For the test we use:

2. Open the REST client. Send /call/startup to the WCS server and specify in the parameters of the query the following data:

3. Receive and answer the call on the softphone:

4. Open the Player web application. Specify the URL of the RTMP server and the name of the RTMP stream the call is redirected to, then click the "Play" button. The call starts playing:

5. Terminate the call in the softphone.

Call flow

Below is the call flow when using the SIP as RTMP example to create a call



1. Sending the /call/startup REST query:

sendREST() code

function startCall() {
    var url = field("restUrl") + "/call/startup";
    callId = generateCallID();
    var RESTCall = {};
    RESTCall.toStream = field("rtmpStream");
    RESTCall.hasAudio = field("hasAudio");
    RESTCall.hasVideo = field("hasVideo");
    RESTCall.callId = callId;
    RESTCall.sipLogin = field("sipLogin");
    RESTCall.sipAuthenticationName = field("sipAuthenticationName");
    RESTCall.sipPassword = field("sipPassword");
    RESTCall.sipPort = field("sipPort");
    RESTCall.sipDomain = field("sipDomain");
    RESTCall.sipOutboundProxy = field("sipOutboundProxy");
    RESTCall.appKey = field("appKey");
    RESTCall.sipRegisterRequired = field("sipRegisterRequired");

    for (var key in RESTCall) {
        setCookie(key, RESTCall[key]);

    RESTCall.callee = field("callee");

    var data = JSON.stringify(RESTCall);

    sendREST(url, data);


2. Establishing a connection to the SIP server

3. Receiving confirmation from the SIP server

4. The RTP stream is sent to the WCS server

5. Publishing of the RTMP stream on the RTMP server

6. The RTMP stream is passed to the RTMP server

7. Sending the /call/terminate REST query:

sendREST() code

function hangup() {
    var url = field("restUrl") + "/call/terminate";
    var currentCallId = { callId: callId };
    var data = JSON.stringify(currentCallId);
    sendREST(url, data);

8. Sending the command to the SIP server

9. Receiving confirmation from the SIP server

Known issues

1. Stream captured from SIP call, can not be played, if RTP session is not initialized for this stream.

Symptoms: SIP stream is published on server, but can not be played.

Solution: enable RTP session initializing with the following parameter


2. SIP callee does not recognize DTMF signals if audio data generation is no enabled

Symptoms: SIP callee does not recognize PIN code sent as DTMF

Solution: enable audio and video data generation for SIP call with the following parameter