Skip to content

Commit

Permalink
examples/kemi: align the list of unfriendly UAs to the native cnf file
Browse files Browse the repository at this point in the history
  • Loading branch information
dilyanpalauzov authored and miconda committed Dec 28, 2022
1 parent 182b948 commit 6dadb32
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-jsdt.js
Expand Up @@ -135,7 +135,8 @@ function ksr_route_reqinit()
if (KSR.corex.has_user_agent()>0) {
var UA = KSR.kx.gete_ua();
if (UA.indexOf("friendly")>=0 || UA.indexOf("scanner")>=0
|| UA.indexOf("sipcli")>=0 || UA.indexOf("sipvicious")>=0) {
|| UA.indexOf("sipcli")>=0 || UA.indexOf("sipvicious")>=0
|| UA.indexOf("VaxSIPUserAgent")>=0 || UA.indexOf("pplsip")>= 0) {
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
}
Expand Down
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-lua.lua
Expand Up @@ -184,7 +184,8 @@ function ksr_route_reqinit()
end
local ua = KSR.kx.gete_ua();
if string.find(ua, "friendly") or string.find(ua, "scanner")
or string.find(ua, "sipcli") or string.find(ua, "sipvicious") then
or string.find(ua, "sipcli") or string.find(ua, "sipvicious")
or string.find(ua, "VaxSIPUserAgent") or string.find(ua, "pplsip") then
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
end
Expand Down
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-python.py
Expand Up @@ -158,7 +158,8 @@ def ksr_route_reqinit(self, msg):
if KSR.corex.has_user_agent() > 0 :
ua = KSR.pv.gete("$ua")
if (ua.find("friendly")!=-1 or ua.find("scanner")!=-1
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1) :
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1
or ua.find("VaxSIPUserAgent")!=-1 or ua.find("pplsip")!=-1) :
KSR.sl.sl_send_reply(200, "Processed")
return -255

Expand Down
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-python3s.py
Expand Up @@ -146,7 +146,8 @@ def ksr_route_reqinit():
if KSR.corex.has_user_agent() > 0 :
ua = KSR.kx.gete_ua()
if (ua.find("friendly")!=-1 or ua.find("scanner")!=-1
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1) :
or ua.find("sipcli")!=-1 or ua.find("sipvicious")!=-1
or ua.find("VaxSIPUserAgent")!=-1 or ua.find("pplsip")!=-1) :
KSR.sl.sl_send_reply(200, "Processed")
return -255

Expand Down
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-ruby.rb
Expand Up @@ -123,7 +123,8 @@ def ksr_route_reqinit()
if KSR::COREX.has_user_agent() > 0 then
ua = KSR::PV.gete("$ua");
if ua.include? 'friendly' or ua.include? 'scanner' or
ua.include? 'sipcli' or ua.include? 'sipvicious' then
ua.include? 'sipcli' or ua.include? 'sipvicious' or
ua.include? 'VaxSIPUserAgent' or ua.include? 'pplsip' then
KSR::SL.sl_send_reply(200, "OK");
exit
end
Expand Down
3 changes: 2 additions & 1 deletion misc/examples/kemi/kamailio-basic-kemi-sqlang.sq
Expand Up @@ -138,7 +138,8 @@ function ksr_route_reqinit()
local UA = KSR.pv.get("$ua");
// if (sipscanregex.match(UA)) {
if (UA.find("friendly")!=null || UA.find("scanner")!=null
|| UA.find("sipcli")!=null || UA.find("sipvicious")!=null) {
|| UA.find("sipcli")!=null || UA.find("sipvicious")!=null
|| UA.find("VaxSIPUserAgent")!= null || UA.find("pplsip")!= null) {
KSR.sl.sl_send_reply(200, "OK");
KSR.x.exit();
}
Expand Down

0 comments on commit 6dadb32

Please sign in to comment.