Module: kamailio
Branch: master
Commit: f04f8539fccfc2afefb5e0badb4747adead2e378
URL: https://github.com/kamailio/kamailio/commit/f04f8539fccfc2afefb5e0badb4747a…
Author: �������������������� �������������������������������� <git-dpa(a)aegee.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-10-05T07:56:24+02:00
examples/kamailio-basic-kemi-lua.lua: Add example for rtpengine
---
Modified: misc/examples/kemi/kamailio-basic-kemi-lua.lua
---
Diff: https://github.com/kamailio/kamailio/commit/f04f8539fccfc2afefb5e0badb4747a…
Patch: https://github.com/kamailio/kamailio/commit/f04f8539fccfc2afefb5e0badb4747a…
---
diff --git a/misc/examples/kemi/kamailio-basic-kemi-lua.lua b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
index d3de2688243..fe9b131f570 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-lua.lua
+++ b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
@@ -340,7 +340,7 @@ end
-- RTPProxy control
function ksr_route_natmanage()
- if not KSR.rtpproxy then
+ if not KSR.rtpproxy and not KSR.rtpengine then
return 1;
end
if KSR.siputils.is_request()>0 then
@@ -354,7 +354,19 @@ function ksr_route_natmanage()
return 1;
end
- KSR.rtpproxy.rtpproxy_manage("co");
+ if KSR.kx.ifdef('WITH_RTPENGINE') then
+ if KSR.nathelper.nat_uac_test(8)>0 then
+ KSR.rtpengine.rtpengine_manage("replace-origin replace-session-connection SIP-source-address");
+ else
+ KSR.rtpengine.rtpengine_manage("replace-origin replace-session-connection");
+ end
+ elseif KSR.kx.ifdef('WITH_RTPPROXY') then
+ if KSR.nathelper.nat_uac_test(8)>0 then
+ KSR.rtpproxy.rtpproxy_manage("co");
+ else
+ KSR.rtpproxy.rtpproxy_manage("cor");
+ end
+ end
if KSR.siputils.is_request()>0 then
if KSR.siputils.has_totag()<0 then
A while ago I wanted to adjust my Lua configuration to work with rtpengine and I have adjusted this example accordingly. I have not tried the example, but if there are no obvious bugs with it, I think it will be useful.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3587
-- Commit Summary --
* examples/kamailio-basic-kemi-lua.lua: Add example for rtpengine
-- File Changes --
M misc/examples/kemi/kamailio-basic-kemi-lua.lua (16)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3587.patchhttps://github.com/kamailio/kamailio/pull/3587.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3587
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3587(a)github.com>