Transcoding using RTPEngine + Kamailio

 RTPengine can be configured to perform transcoding, which involves converting digital audio and video files from one format to another in real-time as they are being transmitted over the network. This can be useful in situations where the devices on either end of the connection do not support the same codecs or where the network conditions require the use of a different codec to ensure the best possible quality of service.

RTPEngine Transcoding

Kamailio configuration

#!define WITH_NAT
#!define WITH_RTPENGINE

loadmodule "rtpengine.so"

modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")

route[RELAY] {

   if (has_body("application/sdp")) {
       if ($rU=="user1") {
                rtpengine_manage("codec-transcode-PCMU");
       }
       else {
       rtpengine_manage("codec-transcode-opus");
       }

...

}

onreply_route[MANAGE_REPLY] {
       
       if (has_body("application/sdp")) {
                rtpengine_manage("codec-transcode-opus");
        }

...
}

user1 calls user2

Kamailio RTPEngine Transcoding


user2 calls user1

Comments