Hello,

afaik, rtpengine is suitable when using Kamailio in proxy mode, forwarding the INVITE, not sending 200ok from it.

Maybe you should look at rtp_media_server module for building an announcement server:

  * https://www.kamailio.org/docs/modules/devel/modules/rtp_media_server.html

It is only in master branch, not in a stable release, but maybe you can just copy and paste it in an older branch clone tree.

Otherwise, iirc, there is a variable that you can get the sdp returned by rtpengine and you can add it to the reply generated by kamailio. If not, do msg_apply_changes() and get the new body with $rb variable and append it to reply with the function from textops module.

Cheers,
Daniel

On 11.06.19 16:36, Ali Shirvani wrote:
Hi all,

I tried to implement simple announcer by using play_media function in latest rtpengine module. I implemented simple Lua script and I tried to test the implementation with simple SIPp scenario.

Here is the Lua function to reply the received INVITE request.

```Lua
function ksr_route_announcer()
    KSR.info("======= Announcer =====\n");
    local u = KSR.pv.gete("$rU");
    KSR.info("username is: " .. u .. "\n");
    if u == "ann" then
         KSR.info("announcer has been called.\n");
         if KSR.textops.has_body_type("application/sdp") then
              KSR.info("request contains SDP.\n");
              KSR.tm.t_newtran();
              KSR.rtpengine.rtpengine_manage0();
              KSR.tm.t_reply(200, "OK");
              KSR.x.exit();
         end
    end
end
```

According to kamailio logs rtpengine modified the INVITE SDP, but I want to add SDP to 200 OK response. How should I manage rtpengine to append SDP answer to the 200 OK response?

The attached is the SIPp log, as you can see that last 200 OK doesn't contain SDP.

Regards,
Ali

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda