User Tools

Site Tools


rtc:media_server

RTC Use Case: Media Server

Finally consider an RTC scenario:

Here a VPS+ agent plays the role of a media server. A media server responds to incoming phone calls and plays a video. For sake of simplicity, the calls are regular video VoIP IP-to-IP calls. In this case, the media server is programmed and deployed by the controller, after which, a regular softphone can be used to place calls.

As in the Hello, World! example, in this example the controller interacts with its built-in agent to enable it to answer incoming calls and play a movie. The VPS network interface carries IPv4 and IPv6 addresses 192.168.21.5 and 2001::21:5 respectively.

First, start the controller and create a new project, named mediaServer, by selecting File ⇒ New ⇒ Project:

Then build the stack up to the IP layer leaving all the defaults. The stack should include physical, ethernet and IP layers:

Right clicking on the IP layer shows the IP address assigned by the controller:

Note that this is a static IP address assigned by the controller. Changes can be made to change the address, enable DHCP or switch to IPv6.

Next thing is to add UDP and RTP layers to support audio/speech coding:

UDP ports are automatically configured by the controller. To select the codec for the RTP layer, right click on it and select Add Codecs:

Then, specifically select the AMR codec (or any other for that matter):

The codec must be such that is compatible with that of the softphone that will be used to place the call.

In order to support video, two more UDP and RTP layers are needed. The UDP layer has to be placed on top of the IP layer:

Once both layers are added, then can be switch by clicking on the arrows:

Then right click on the RTP layer and select the Media Type:

And switch it to Video:

Then, as done with the audio layer, change the video codec to (for example) H.265:

Now, call control is needed. Specifically UDP and SIP layers are needed. Let's start by putting a new UDP layer on top of the IP layer:

The SIP layer is then placed on top of the UDP layer:

Then right click on the SIP layer to select Add Rtp Interfaces:

And add the other two RTP interfaces:

Next, create a media player and call it Player:

And place it on top of the audio/speech RTP layer:

Right click on the media player layer and select the Filename:

And select a media file (i.e. video.mov):

Then start the suite:

Start Wireshark:

And start a softphone (that supports the audio/speech and video codecs):

Right click on the media player layer and select Play:

Than place the call:

and voilà! Wireshark shows the AMR and H.265 speech/audio and video packets respectively…

rtc/media_server.txt · Last modified: 2021/07/31 04:05 by vps