Redirecting a stream to a SIP call using /call/inject_stream
¶
Redirecting a stream published on server¶
-
For the test we use:
- two SIP accounts;
- a softphone to answer to the call;
- the REST client in the Chrome browser;
- the OBS Studio program to broadcast an RTMP stream.
-
Run the RTMP stream broadcast program. Configure and start broadcasting to your WCS server using the following parameters:
- URL of the server:
rtmp://demo.flashphoner.com:1935/live/
- Stream key:
obsStream
- URL of the server:
-
Open the REST client. Send the
/call/startup
query to the WCS server, and in the query parameters specify the following:- parameters of your SIP account the call is made from
- the name of your second SIP account the call is made to
-
Receive the call in the softphone:
-
From the REST client send the
/call/inject_stream/startup
query to the WCS server and specify the following parameters:- the identifier of the call
- the name of the broadcast stream
obsStream
-
Make sure the broadcast is playing in the softphone.
-
To terminate the call, click the corresponding button in the softphone.
Injecting stream from file¶
VOD stream from file can be injected to SIP call. If there is video in file, and hasVideo
parameter set for the call, video also will be injected. To do this, file name should be set as strem name:
Stopping stream injection¶
To stop stream injection to SIP call, send the following REST query