Configuring Kamailio to use RTPENGINE - Omid-Mohajerani/Learn-Kamailio GitHub Wiki

Add to the beginning of the file:

#!define WITH_NAT
#!define WITH_RTPENGINE

Change RTPEngine Port Parameter

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

for calling on the INVITE add in the route[relay] route

route[RELAY]{
   ...
   if (has_body("application/sdp")) {
       rtpengine_manage();
   }
   ...
}

for the reply put a conditional in the onreply_route[MANAGE_REPLY] for if it has SDP

onreply_route[MANAGE_REPLY] {
        xdbg("incoming reply\n");
        if(status=~"[12][0-9][0-9]") {
                route(NATMANAGE);
        }
        if (has_body("application/sdp")) {
                rtpengine_manage();
        }

}

Check the status of RTPEngine

kamcmd rtpengine.show all