Typical use case
- A video call is established between WCS and a SIP device (SIP MCU, conference server or a SIP softphone)
- WCS receives audio and video data from this SIP device
- The WCS server redirects the received audio and video traffic to an RTMP server or another device capable of receiving and processing an RTMP stream
Supported SIP codecs
- Video: H.264, VP8
- Audio: G.711, Speex, Opus
Supported RTMP codecs
- Video: H.264
- Audio: AAC, G.711, Speex
Capturing and republishing of SIP calls is managed using REST API queries.
- Each SIP call can be associated with just one RTMP stream. If a new SIP call is initiated with the same RTMP URL and stream name (rtmpUrl+rtmpStream) as the existing call, that second call is declined by the server with the HTTP status of 409 Conflict. However, publishing of a call to an RTMP stream using the /push/startup REST query does not limit the number of RTMP streams created for one call.
- SIP Call ID of a call must be unique. An attempt to initiate a new SIP call with an already existing Call ID is declined by the WCS server with the HTTP status of 409 Conflict.
The REST query is an HTTP/HTTPS POST query as follows:
- test.flashphoner.com - is the address of the WCS server
- 8081 - is the standard REST / HTTP port of the WCS server
- 8444 - is the standard HTTPS port
- rest-api - is the required part of the URL
- /call/startup - the REST method used
REST-methods and response statuses
|REST-method||Example of REST-query||Example of REST-response body||Response status|
200 - The call is accepted for processing
409 - Conflict with an existing RTMP URL
200 - call is found
200 - calls are found
200 - call is terminated
200 - DTMF is sent
SIP Call ID - a unique identifier string
|toStream||Name of the stream on the WCS server the call is published to||call_stream1|
|rtmpUrl||RTMP URL - address of the RTMP server|
Here live - is the name of the RTMP application.
|rtmpStream||Name of the RTMP stream on the RTMP server||streamName2|
|hasAudio||If true, SDP will have the 'sendrecv' parameter in audio. If false, it gets 'recvonly'.||true|
|hasVideo||If true, SDP will have the 'sendrecv' parameter in video. If false, it gets 'recvonly'.||true|
|status||Call status on the WCS server|
The complete list of statuses is available in the Call Flow (see the CallStatusEvent method).
|rtmpStreamStatus||Status of the RTMP stream|
RTMP_STREAM_WAIT - RTMP-stream is initializing
|visibleName||Displayed name of the caller|
|mediaProvider||NOT USED||NOT USED|
SDP parameters recvonly and sendrecv
There are two main modes for SIP-REST calls:
In both cases WCS does not send RTP audio and video traffic, because it is the REST client that is the initiator of the call, which is not the source of audio and video streams. WCS can explicitly set in SDP that there will be no audio and video traffic from its side (the 'recvonly' mode).
If your SIP-device is a softphone or another SIP phone, most likely it will drop calls (in the 'sendrecv' mode) within approximately a minute after connection is established. This is because of lack of RTP traffic from WCS.
Some softphones correctly support the 'recvonly' mode, for example, MicroSIP.
In other softphones like Bria, RTP activity timer can be manually increased to provide longer duration of a call in the 'sendrecv' mode.
If your SIP device is an MCU or a SIP conference server, it should work correctly with the 'recvonly' mode, and long calls can be established.
Additional status information
WCS uses the built-in 'callApp' application to send intermediate statuses.
- TRYING, RTMP_STREAM_WAIT
- ESTABLISHED, RTMP_STREAM_ACTIVE
- ESTABLISHED, RTMP_CONNECTION_LOST
These are notifications that are sent only locally on the server side via the internal REST interface. See the Application management section to get more information about internal REST applicaitons. Also, a third-party web application can be created to receive notifications from the WCS server.
By default, the WCS server starts in the dev mode.
To run the server with the 'production' profile, uncomment the following line in the /usr/local/FlashphonerWebCallServer/conf/wcs-manager.properties file:
In the production mode, support for HTTPS for REST is enabled.
is an internal address available by default that receives all intermediate statuses of a call made via REST: RING, TRYING and so on.
Also, intermediate statuses of the RTMP stream associated with this call are sent:
REST works via HTTP at the port 8081 (by default) and via HTTPS at the port 8444.
To enable HTTPS, start the server with the 'production' profile.
By default, WCS uses a self-signed SSL certificate.
To confirm security exception for this certificate:
a) Open this URL
(where sip-as-rtmp.flashphoner.com - is the address of the WCS server)
b) Click 'ADVANCED'
c) Click 'Proceed'
After that WCS self-signed certificate is imported to your browser and the HTTPS URL can be used for REST calls, for example
When the 'production' mode is on, each REST/HTTPS or REST/HTTP query requires HTTP Basic Authentication.
Standard username and password are admin:admin.
You can change the password in WCS CLI. (See more about Command Line Interface here.)
In the REST Console, you can add authorization as follows
- click 'Basic Auth' in Authorization / Authorization Header,
- add admin:admin as username and password,
- click 'Set Header'
As a result, the authorization header is set.
1. When republishing SIP as RTMP to Wowza servers and when receiving a stream from Wowza via HLS, a spectator can see freezes, short time non-synchronous playback.
Solution: enable transcoding on the server by setting in the flashphoner.properties file the following parameter:
Solution: the audio only call stream should be played as audio only stream in a browser by explicitly constraints setting in player script when stream is created, for example
3. It's impossible to make a SIP call if 'SIP Login' and 'SIP Authentification name' fields are incorrect
Symptoms: SIP call cannot be created, /call/startup REST API query returns
Solution: according to the standard, 'SIP Login' and 'SIP Authentication name' should not contain any of unescaped spaces and special symbols and should not be enclosed in angle brackets '<>'.
For example, this is not allowed by the standard
and this is allowed