Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

WCS can work as a WebRTC-SIP gateway. In this case, audio and video stream of a SIP call made through WCS can be captured and played in a browser or republished to another server.

Typical use case

  1. A video call is established between WCS and a SIP device (SIP MCU, conference server or a SIP softphone)
  2. WCS receives audio and video data from this SIP device
  3. 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

...

REST-methods and response statuses

REST-methodExample of REST-queryExample of REST-response bodyResponse status
/call/startup
Code Block
languagejs
themeRDark
{  
   "callId":"123456711",
   "callee":"10000",
   "toStream":"stream1",
   "rtmpUrl":"rtmp://localhost:1935/live/",
   "rtmpStream":"rtmp_stream1",
   "hasAudio":"true",
   "hasVideo":"true",
   "sipLogin":"10009",  "sipAuthenticationName":"10009",
 "sipPassword":"1234",
"sipDomain":"226.226.225.226",
"sipOutboundProxy":"226.226.225.226",
   "sipPort":"5060",
"appKey":"defaultApp",
"sipRegisterRequired":"false"
}

{}


200 - The call is accepted for processing

409 - Conflict with an existing RTMP URL

/call/find
Code Block
languagejs
themeRDark
{"status" : "ESTABLISHED"}

or

{"callId":"R08NQya-5NMe5v7q-JNkboaS-CGMlFi"}
Code Block
languagejs
themeRDark
[{
"custom": {},
"nodeId": null,
"appKey": null,
"sessionId": null,
"callId": "R08NQya-5NMe5v7q-JNkboaS-CGMlFi",
"parentCallId": null,
"incoming": false,
"status": "ESTABLISHED",
"sipStatus": 200,
"rtmpUrl": null,
"rtmpStream": null,
"streamName": null,
"rtmpStreamStatus": null,
"caller": "001",
"callee": "002",
"hasAudio": true,
"hasVideo": false,
"sdp": null,
"visibleName": "001",
"inviteParameters": null,
"mediaProvider": "Flash",
"sipMessageRaw": null,
"isMsrp": false,
"target": null,
"holdForTransfer": false
}]

200 - call is found
404 - call with the given parameters is not found

/call/find_all

{}

Code Block
languagejs
themeRDark
[{
"custom": {},
"nodeId": null,
"appKey": null,
"sessionId": null,
"callId": "R08NQya-5NMe5v7q-JNkboaS-CGMlFi",
"parentCallId": null,
"incoming": false,
"status": "ESTABLISHED",
"sipStatus": 200,
"rtmpUrl": null,
"rtmpStream": null,
"streamName": null,
"rtmpStreamStatus": null,
"caller": "001",
"callee": "002",
"hasAudio": true,
"hasVideo": false,
"sdp": null,
"visibleName": "001",
"inviteParameters": null,
"mediaProvider": "Flash",
"sipMessageRaw": null,
"isMsrp": false,
"target": null,
"holdForTransfer": false
}]

200 - calls are found
404 - calls are not found

/call/terminate
Code Block
languagejs
themeRDark
{"callId" : "becee2c0-13b4-11e7-b817-c1649197cae8"}


200 - call is terminated
404 - call is not found

/call/send_dtmf
Code Block
languagejs
themeRDark
{
"callId" : "52173e00-13b6-11e7-b817-c1649197cae8",
"dtmf":"9",
"type":"RFC2833"
}


200 - DTMF is sent
404 - call is not found

/call/inject_stream
Code Block
languagejs
themeRDark
{
"callId": "ad5ac8a0-b518-11e7-82c7-999b45e427ba",
"streamName": "mixer1_stream"
}


200 - audio stream is added to the call
404 - call is not found

Parameters

Parameter nameDescriptionExample

callId

SIP Call ID - a unique identifier string

Xq2tlLcX89tTjaji
calleeSIP callee10001
toStreamName of the stream on the WCS server the call is published tocall_stream1
rtmpUrlRTMP URL - address of the RTMP server

rtmp://rtmp-server.flashphoner.com:1935/live

Here live - is the name of the RTMP application.
Also, in RTMP URL the instance name and the query string can be specified, for example:
rtmp://rtmp-server.flashphoner.com:1935/live/_definst_?param1=value1&param2=value2

rtmpStreamName of the RTMP stream on the RTMP serverstreamName2
hasAudioIf true, SDP will have the 'sendrecv' parameter in audio. If false, it gets 'recvonly'.true
hasVideoIf true, SDP will have the 'sendrecv' parameter in video. If false, it gets 'recvonly'.true
statusCall status on the WCS server

ESTABLISHED

The complete list of statuses is available in the Call Flow (see the CallStatusEvent method).

sipStatusAssociated SIP-status200
rtmpStreamStatusStatus of the RTMP stream

RTMP_STREAM_ACTIVE

RTMP_STREAM_WAIT - RTMP-stream is initializing
RTMP_STREAM_ACTIVE - RTMP-stream has initialized and connection is established
RTMP_CONNECTION_LOST - RTMP-connection is lost
RTMP_CONNECTION_FAILED - RTMP-connection was not established

callerSIP caller
visibleNameDisplayed name of the caller
mediaProviderNOT USEDNOT USED

SDP parameters recvonly and sendrecv

...

This address can be changed via WCS CLI. Se the description of the command line interface to get more information about application management in WCS.

...

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

...