[OpenSIPS-Users] SIPREC video calls
Walter Schober
walter.schober at neotel.at
Wed Feb 18 17:29:35 UTC 2026
Hi Everyone!
Some tricks now made my day today, e.g. remove a=mid:* from SDP to get both directions with rtpengine.
Finally I do:
if (is_method("INVITE") && $ru=~"sip:.*@.*;maddr=.*" && $(ru{uri.param,maddr}{s.len})) {
# inbound call
create_dialog();
$siprec(group) = "webrtc-loop-in";
$rtp_relay_ctx(callid) = "srs-i-"+$ci;
xlog("L_INFO", ">> created originating dialog and set ctx(callid)=$rtp_relay_ctx(callid)");
route(setup_rec);
$du = "sip:"+$(ru{uri.param,maddr})+":"+$rp;
route(relay);
}
route[setup_rec] {
# https://www.opensips.org/Documentation/Tutorials-SIPREC-2-4
# remove mid:0 - offer/answer w/ same mid:0 mixes up labels and returns single m= line -> will be fixed in rtpengine ...
$rtp_relay_ctx(flags) = "sdp-attr-remove-audio-mid sdp-attr-remove-video-mid sdp-attr-remove-audio-msid sdp-attr-remove-video-msid";
rtp_relay_engage("rtpengine");
$avp(x-system) = $(ru{uri.param,x-system}); # without a x-system we do have a problem here. It MUST be present
t_on_reply("setup_rec");
}
onreply_route[setup_rec] {
if ($rs=="200") {
xlog("L_INFO", "Start recording on 200 OK"); # otherwise the recording would start right after the first 18x with SDP
# https://opensips.org/docs/modules/3.6.x/siprec.html#func_siprec_start_recording
$siprec(headers) = "X-Call-ID: "+$ci+"\r\n";
$siprec(from_uri) = $fu;
$siprec(to_uri) = $tu;
# not only IP address but also RTPEngine flags can be set for the SRS leg here
# sdp-media-remove=video sends "sdp-media-remove": "video" instead of "sdp-media-remove": [ "video" ] -> video is not removed - no solution yet
$siprec(media) = "allow-transcoding asymmetric sdp-media-remove=video";
siprec_start_recording("sip:opensips-srs at 192.168.48.161:5060;x-system=$avp(x-system)");
}
}
All singing all dancing except WebRTC Video Calls. The Video should be passed by rptengine, but not sent to the SRS.
In the SIPREC XML body only the last two video sessions are referenced and audio is missing:
audio forward is label:0, audio backward is label:1, video forward is label:2, video backward is label:3 then - and SIPREC XML body refers to labels 2 and 3 only!
<stream stream_id="U/CQBPCgTPqtv2nreh7IJQ==" session_id="ri+uAfKsTtWqLYTgSuRFlg==">
<label>2</label>
</stream>
<stream stream_id="9vbDRoEwT2esPjE9xcfK0Q==" session_id="ri+uAfKsTtWqLYTgSuRFlg==">
<label>3</label>
</stream>
RTPENGINE expects "sdp-media-remove": [ "video“ ]. A LIST, not a STRING. I tried several variants to have a LIST in the NG protocol, but failed.
Is there any way to take „audio“ only into account for SRS?
Opensips version 3.6.3.
br
Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20260218/e353ff84/attachment-0001.html>
More information about the Users
mailing list