Hi All, My requirement is when incoming call comes from internal user in i want to put kamailio ip and port in Contact header and forward or dispatch request to sip trunk carrier but i am unable to do so using KEMI frame work LUA. Can someone please give some pointer please?
KSR.textops.remove_hf("Contact"); KSR.textopsx.assign_hf_value("Contact","sip:1234@4.5.6.7"); KSR.rtpengine.rtpengine_manage0(); if KSR.tm.t_relay()<0 then KSR.sl.sl_reply_error(); end
It is a core function in KEMI. Not textops. https://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/core/#ksrh...
On Sun, Apr 7, 2024, 16:23 ramaseshi.kolli--- via sr-users < sr-users@lists.kamailio.org> wrote:
Hi All, My requirement is when incoming call comes from internal user in i want to put kamailio ip and port in Contact header and forward or dispatch request to sip trunk carrier but i am unable to do so using KEMI frame work LUA. Can someone please give some pointer please?
KSR.textops.remove_hf("Contact"); KSR.textopsx.assign_hf_value("Contact","sip:1234@4.5.6.7"); KSR.rtpengine.rtpengine_manage0(); if KSR.tm.t_relay()<0 then KSR.sl.sl_reply_error(); end __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
yes i have tried it but no luck what am i doing wrong here.
KSR.hdr.append("test_hdr: "test"\r\n"); --> this works i can see new header added KSR.hdr.remove("Contact"); -- this is not being removed
Check the logs and ensure you are not doing anything else with contact ( like nat handling or so )
On Sun, Apr 7, 2024, 17:02 ramaseshi.kolli--- via sr-users < sr-users@lists.kamailio.org> wrote:
yes i have tried it but no luck what am i doing wrong here.
KSR.hdr.append("test_hdr: "test"\r\n"); --> this works i can see new header added KSR.hdr.remove("Contact"); -- this is not being removed __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi, I'm not sure if it fits what you want to do but you can check topos module to change contact header https://www.kamailio.org/docs/modules/devel/modules/topos.html
-----Mensaje original----- De: ramaseshi.kolli--- via sr-users sr-users@lists.kamailio.org Enviado el: domingo, 7 de abril de 2024 15:41 Para: sr-users@lists.kamailio.org CC: ramaseshi.kolli@gmail.com Asunto: [SR-Users] Unable to remove/modify/replace "Contact SIP header'
Hi All, My requirement is when incoming call comes from internal user in i want to put kamailio ip and port in Contact header and forward or dispatch request to sip trunk carrier but i am unable to do so using KEMI frame work LUA. Can someone please give some pointer please?
KSR.textops.remove_hf("Contact"); KSR.textopsx.assign_hf_value("Contact","sip:1234@4.5.6.7"); KSR.rtpengine.rtpengine_manage0(); if KSR.tm.t_relay()<0 then KSR.sl.sl_reply_error(); end __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
in my case pv_headers.so was loaded and by commenting this worked fine. Not sure how does this affect adding/remove headers.