Media forking howto

695 views
Skip to first unread message

Mihovil Kolaric

unread,
Mar 15, 2022, 11:12:16 AM3/15/22
to rtpengine
Hi,

I am using RTPengine together with kamailio in different scenarios (WebRTC-Gateway, Recording for SIP-calls).
No I am trying to duplicate the RTP-Stream of a SIP-call (resp: one direction of it) to 1..x other SIP-UAs. This somehow sounds like
  • Media forking
  • Publish/subscribe mechanism for N-to-N media forwarding
in https://github.com/sipwise/rtpengine/blob/master/README.md - however, I do not really understand how to do that/where to start. For obvious reasons the commands are not present in kamailio´s rtpengin-module - is there however any other tool/utility that uses this media forking, so I can study it? Or is there any howto/guideline to use that feature?
Any hints are appreciated.

Thx & Br,
M. K.

Youssef Boujraf

unread,
Mar 16, 2022, 6:08:14 AM3/16/22
to rtpengine
Hi,

Would you like to share your rtpengine and kamailio config pls?

I am looking for webrtc gateway with rtpengine and have some issue to setup with kamailo.

Best Regards

Mihovil Kolaric

unread,
Mar 16, 2022, 9:09:04 AM3/16/22
to rtpengine
Hi,

for the WebRTC-Gateway I used this howto: https://github.com/havfo/WEBRTC-to-SIP

Best Regards

Richard Fuchs

unread,
Mar 16, 2022, 9:40:07 AM3/16/22
to rtpe...@googlegroups.com

Hi,

This is a relatively new feature and so not well supported in other software yet. Contributions are always welcome.

OpenSIPS is working on integrating this with their SIPREC module. I suppose the Kamailio UAC module could also be used for this. Other solutions like general SIP UAs would also be possible.

As a PoC you can use the included `rtpengine-ng-client` script. You need to know the call ID of the call that you want to fork media from, and be able to select a particular call party (e.g. through their SIP tag or the provided label) OR be able to handle multi-part SDP that receives media from all call parties.

You start by sending a subscribe request to rtpengine. For example for a SIPREC-style subscription you would do something like

$ rtpengine-ng-client "subscribe request" --call-id=$CALLID --all --SIPREC

This produces a multi-part offer SDP (that would be sent as an invite to the SIPREC SRS). It also returns a "to-tag" which is used to identify this subscription.

The corresponding answer SDP (from the 200 OK from the SRS) would then be passed as a subscribe answer to rtpengine, together with the to-tag that was returned by the subscribe-request:

$ rtpengine-ng-client "subscribe answer" --call-id=$CALLID --sdp=$SDP --to-tag=$TAG

At this point the media would start flowing to the SRS.

Subscriptions can use all other available options, such as encryption, transcoding, etc.

For the N-to-N media forwarding feature you would create subscriptions exactly in the same way, except that you subscribe not to a regular call created through offer/answer, but rather to send-only media streams created via "publish" (which works analogous to "offer" except that it's one-way).

HTH

Cheers

Youssef Boujraf

unread,
Mar 17, 2022, 5:58:28 AM3/17/22
to rtpengine
Dear,

Is this repo working with kamailio behind the NAT ?

Best Regards,

geekdroid 0409

unread,
Oct 10, 2022, 4:24:55 AM10/10/22
to rtpengine
Hi Mihovil Kolaric,

Have you tried the solution mentioned, can it be implemented? Do you have any ideas to share, 

thank you very much!

Reply all
Reply to author
Forward
0 new messages