際際滷

際際滷Share a Scribd company logo
rtpengine
Media Relaying and Beyond
Andreas Granig <agranig@sipwise.com>
WHAT IS IT?
rtpengine
Media Relay WebRTC Bridge Call Recorder Media Transcoder Media Player
MEDIA RELAY
rtpengine
 Kernel based forwarding
 Network bridging (IPv4, IPv6)
 IP load balancing (more ports)
 State syncing (Redis)
MEDIA RELAY
rtpengine
rtpengine.so module in Kamailio
rtpengine daemon
xt_RTPENGINE kernel module
rtpengine
Kamailio
SIP
RTP
original SDP + meta info modi鍖ed SDP + meta info
MEDIA RELAY
rtpengine
route {
...
rtpengine_manage();
...
}
rtpengine 
--interface=ext/1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Con鍖g rtpengine
WEBRTC BRIDGE
rtpengine
 SDP pro鍖le transforming
 RTP/AVP 皙 RTP/SAVPF
 In-Kernel DTLS-SRTP crypto
 ICE negotiation
 RTCP multiplexing
WEBRTC BRIDGE
rtpengine
rtpengine
Kamailio
SIP
RTP
original SDP + meta info
modi鍖ed SDP:
 changed pro鍖le
 added ICE candidates
 RTCP mux
DTLS-RTP
WEBRTC BRIDGE
rtpengine
route {
rtpengine_offer(RTP/SAVPF ICE=force);
}
reply_route {
rtpengine_answer(RTP/AVP ICE=remove
rtcp-mux-demux);
}
rtpengine 
--interface=ext/1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Con鍖g rtpengine
CALL RECORDER
rtpengine
 Started/stopped before or during call
 Packet forking to /proc in real-time
 Storing streams as WAV/MP3 on NFS
 Storing meta-data in MySQL
CALL RECORDER
rtpengine
rtpengine
Kamailio
SIP
RTP
original SDP + meta info
recorder
metainfo /var/spool/recordings/
/proc/rtpengine/0/calls/
out.wav /nfs/recordings/Packet Queue
modi鍖ed SDP + meta info
CALL RECORDER
rtpengine
route {
rtpengine_manage(record-call
metadata=uuid:$var(aid)|
uuid:$var(bid));
}
rtpengine 
--interface=ext/1.2.3.4 
--listen-ng=127.0.0.1:12221 
--recording-method=proc 
--recording-dir=/var/spool/rtpengine
Kamailio Con鍖g rtpengine
MEDIA TRANSCODER
rtpengine
 Transcoding audio streams
 Supporting Opus, G711, G729, G722,
speex,  (see rtpengine --codecs)
 Operating in user-space
 Allowing last-resort and forced mode
MEDIA TRANSCODER
rtpengine
rtpengine
Kamailio
SIP
RTP G711
original SDP + meta info
modi鍖ed SDP:
 鍖lter unwanted codecs
 add additional codecs
RTP Opus
MEDIA TRANSCODER
rtpengine
route {
rtpengine_manage(mask-all
transcode-opus);
}
rtpengine 
--interface=ext/1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Con鍖g rtpengine
MEDIA PLAYER
rtpengine
 Injecting audio into streams
 Playing from local 鍖les or MySQL blobs
MEDIA PLAYER
rtpengine
rtpengine
Kamailio
SIP
RTP
 call-id of existing
call
 from-tag/address
 鍖le/db-id
 calculated duration
in.wav
MEDIA PLAYER
rtpengine
event_route[xhttp:request] {
play_media(call-id=$var(callid)
from-tag=$var(fromtag)
file=/path/to/hello.mp3);
}
rtpengine 
--interface=ext/1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Con鍖g rtpengine
MORE FEATURES
rtpengine
 DTMF logging
 Media and DTMF blocking/unblocking
 block/unblock_dtmf(...)
 block/unblock_media(...)
 Stream forwarding to 3rd party via TLS
(for example to speech recognition
engine)
 start/stop_forwarding(...)
 MOS reporting via AVPs
 mos_xxx_pv mod-param
THANK YOU
Questions?

More Related Content

rtpengine - Media Relaying and Beyond