Hello,
Based on kamailio-basic-kemi.cfg and kamailio-basic-kemi-lua.lua,
I’m trying to get a simple test to go through using SIPp built-in UAC and UAS scenarios, using LUA config:
Commented out all the registration blocks and trying to run a simple proxy for now, but I can’t seem able to change the URI.
SIPp UAC: 192.168.1.12:5060
SIPp UAS: 192.168.1.12:5062
Kamailio 5.5.2: 192.168.15.:5060
Part of the Kamailio.lua config:
-- wrapper around tm relay function
function ksr_route_relay()
-- enable additional event routes for forwarded requests
-- - serial forking, RTP relaying handling, a.s.o.
if KSR.is_method_in("IBSU") then
if KSR.tm.t_is_set("branch_route")<0 then
KSR.dbg("EP: ksr_route_relay Set for branch_route\n");
KSR.tm.t_on_branch("ksr_branch_manage");
end
end
if KSR.is_method_in("ISU") then
if KSR.tm.t_is_set("onreply_route")<0 then
KSR.dbg("EP: ksr_route_relay Set for onreply_route\n");
KSR.tm.t_on_reply("ksr_onreply_manage");
end
end
if KSR.is_INVITE() then
if KSR.tm.t_is_set("failure_route")<0 then
KSR.dbg("EP: ksr_route_relay Set for failure\n");
KSR.tm.t_on_failure("ksr_failure_manage");
end
end
if KSR.tm.t_relay()<0 then
KSR.dbg("EP: ksr_route_relay Set for reply_error\n");
KSR.sl.sl_reply_error();
end
-- EP: Base route
KSR.dbg("EP: ksr_route_relay Check for Base Route\n");
if KSR.is_INVITE() then
KSR.dbg("EP: ksr_route_relay Base Route (DU)\n");
--KSR.sl.send_reply("503", "Debug");
KSR.setdsturi("sip:192.168.1.12:5062");
KSR.pv.sets("$du", "sip:192.168.1.12:5062");
end
KSR.dbg("EP: ksr_route_relay exit\n");
KSR.x.exit();
end
What’s happening here is that instead of forwarding the INVITE to the SIPp UAC, it creates a loop. Tried KSR.setdsturi() only (KSR.pv.sets commented out) and it’s still the same.
If I comment out the 503 reply, then that’s what the UAC gets back.
Here’s the log when calling ksr_route_relay:
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/msg_translator.c:162]: check_via_address(): (192.168.1.12, 192.168.1.12, 0)
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:489]: sr_lua_reload_script(): No need to reload [/etc/kamailio/kamaili
o.lua] is version 0
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:673]: app_lua_run_ex(): executing Lua function: [[ksr_onsend_route]]
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:675]: app_lua_run_ex(): lua top index is: 0
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: tm [t_funcs.c:376]: t_relay_to(): new transaction forwarded
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[0] for: dbg is str: EP: ksr_r
oute_relay Check for Base Route
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/kemi.c:85]: sr_kemi_core_dbg(): EP: ksr_route_relay Check for Base Route
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[0] for: dbg is str: EP: ksr_r
oute_relay Base Route (DU)
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/kemi.c:85]: sr_kemi_core_dbg(): EP: ksr_route_relay Base Route (DU)
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[0] for: setdsturi is str: sip
:192.168.1.12:5062
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[0] for: sets is str: $du
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[1] for: sets is str: sip:192.
168.1.12:5062
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/kemi.c:2906]: sr_kemi_pv_sets(): pv set: $du
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/pvapi.c:371]: pv_cache_add(): pvar [$du] added in cache
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1003]: sr_kemi_lua_exec_func_ex(): param[0] for: dbg is str: EP: ksr_r
oute_relay exit
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/kemi.c:85]: sr_kemi_core_dbg(): EP: ksr_route_relay exit
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:1837]: sr_kemi_lua_exit(): script exit call
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_api.c:729]: app_lua_run_ex(): ksr error call from Lua: ~~ksr~exit~~
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: app_lua [app_lua_mod.c:167]: sr_kemi_config_engine_lua(): execution of route type 1 with no n
ame returned 1
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) INFO: LUA {INVITE}: <core> [core/receive.c:515]: receive_msg(): request-route executed in: 1335 usec
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/usr_avp.c:637]: destroy_avp_list(): destroying list (nil)
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/xavp.c:541]: xavp_destroy_list(): destroying xavp list (nil)
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: LUA {INVITE}: <core> [core/receive.c:606]: receive_msg(): cleaning up
Oct 17 23:42:48 ol-vm1 kamailio[2416]: 3(2419) DEBUG: <core> [core/udp_server.c:493]: udp_rcv_loop(): received on udp socket: (112/100/661) [[INVITE sip:service@
192.168.1.15:5060 SIP/2.0 0D 0A Record-Route: <sip:192.168.1.15;lr=on> 0D 0A Via: SIP/2.0/U]]
Any idea how we can route this message?
Thanks!
I have the idea that if you enable dmq_usrloc, the other nodes that receive the usrloc info, also try to write to database.
We see this by a lot of errors indicating the index violation on postgres.
What is the easiest way to tell Kamailio that it does not need to store the usrloc in database if the data came through a DMQ message?
Currently I have in my config:
# DMQ processing
if(is_method("KDMQ") && $Rp == 5090) {
dmq_handle_message();
}
I have understood that no further processing happens then. So is my assumption correct that my other handling of REGISTER will not be used then?
As in, can you handle this in code that it will only store the register information in memory? Like this?
# Registration handling
route[REGISTRAR] {
# If coming from DMQ, don't save to database
if(dmq_is_from_node()) {
save("location", "0x01")
}
}
So I've been working on this for a while, and I cannot seem to find a way around this. When using the http_async_client to request data from an external API, the returned data in the "route_name" target is being treated as a failure route, so most of the subsequent processing and messaging that I want to do is not working, either because the function can't be used in a failure route, or because I have to create a transaction prior to doing the request, which then throws an error by immediately triggering a 500 after I return the response I want (via 302 to the requesting client).
Am I using http_async_client incorrectly somehow that's causing this behavior or is it expected that the response route is treated as a failure route?
Confidentiality Notice: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named on the e-mail. If the reader of this e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading this e-mail is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.
Hello all!
I'm trying to make a call from the system with Kamailio to a MS Teams. I
can answer in the Teams client, system will receive response 200 OK and
audio streams will be started.
The problem I have is that after a short period of time Teams sends BYE
with the reason "An acknowledgement was not received for the call
acceptance in the allotted time". If I try to hangup from the system side,
Teams will receive BYE and respond with "481 Call Leg/Transaction Does Not
Exist" - "Call leg unavailable".
It looks like Teams can not match and accept ACK request to finish
establishing the call and the following requests have the same problem.
I was wondering if someone had this problem before or can share a SIP
packet capture (of course with hidden addresses and domain names) of a
correctly established and completed call to Teams?
Thanks a lot!
Regards, Volodymyr Ivanets
After 4 (long) days of trying to receive any UDP SIP, I'm hoping someone can
point out what I'm doing wrong. I've looked at the kamailio code. I'm beginning
to think it's the 'polling' code, but it looks fine. It could be Centos or a
Dell network driver, but not seeing any errors anywhere.
- stock build/compile...
Version: kamailio 5.5.2 (x86_64/linux) 0d53d9
Compile flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS,
DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE,
USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES
MAX_RECV_BUFFER_SIZE=262144
MAX_URI_SIZE=1024
BUF_SIZE=65535
DEFAULT PKG_SIZE=8MB
DEFAULT SHM_SIZE=64MB
ADAPTIVE_WAIT_LOOPS=1024
TCP poll methods: poll, epoll_lt, epoll_et, sigio_rt, select
Source code revision ID: 0d53d9
Compiled with: gcc 4.8.5
Compiled architecture: x86_64
Compiled on: 08:44:19 Oct 11 2021
Running Centos 7 all updated. Dell R630.
# sestatus
SELinux status: disabled
# firewall-cmd --list-all
ports: 5666/tcp 873/tcp 873/udp 80/tcp 443/tcp 5060/tcp 5060/udp 5061/tcp
5061/udp
- Just trying to send SIP INVITE from trunk provider to R630 kamailio...
(SIP trunk) UDP 172.200.200.202:5060 -> (firewall) UDP 172.250.250.162:5060 ->
1:1 NAT -> (R630) UDP 10.102.88.81:5060
- I can 'see' the packet hit the em3 network...
# tcpdump -i em3 -e -vv -n port 5060
11:53:33.260892 99:99:ef:3e:69:c1 > 99:99:1c:48:4e:e3, ethertype IPv4 (0x0800),
length 1366: (tos 0x0, ttl 54, id 20430, offset 0, flags [none], proto UDP (17),
length 1352)
172.200.200.202.sip > 10.102.88.81.sip: [udp sum ok] SIP, length: 1324
INVITE sip:+18005551234@172.250.250.162:5060 SIP/2.0
...
At this point, I just need to see a SIP INVITE received. Then I can go back to
working on a real config.
I've tried with TCP on/off, listening on all networks, alias on/off, strace and
everything else I could think of.Truly appreciate any guidance.
Tried every sample config possible, but I just need to test receiving the SIP
UDP packet, so this 'should' be minimum config...
#!KAMAILIO
debug=9
log_stderror=no
log_facility=LOG_LOCAL0
log_prefix="{$mt $hdr(CSeq) $ci} "
children=2
disable_tcp=yes
udp4_raw=on
auto_aliases=no
alias="sbc01.mysite.com"
listen=udp:10.102.88.81:5060
loadmodule "debugger.so"
loadmodule "jsonrpcs.so"
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
modparam("debugger", "cfgtrace", 1)
request_route {
xlog("SIP received xxxxxxxxxxxxxxxxxxx\n");
}
# kamcmd ps
11578 main process - attendant
11579 udp receiver child=0 sock=10.102.88.81:5060
11580 udp receiver child=1 sock=10.102.88.81:5060
11581 slow timer
11583 timer
11584 secondary timer
11585 JSONRPCS FIFO
11586 JSONRPCS DATAGRAM
11587 ctl handler
- I get plenty of logging, but the logging just waits here...
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: INFO: ctl
[io_listener.c:210]: io_listen_loop(): io_listen_loop: using epoll_lt as the io
watch method (auto detected)
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: <core>
[core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7fd2a8bae010, 4800) called
from core: core/io_wait.c: init_io_wait(469)
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10059]: DEBUG: <core>
[core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7fd2a8bae010, 65456) returns
address 0x7fd2a8c652d8 frag. 0x7fd2a8c652a0 (size=65456) on 1 -th hit
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: <core>
[core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7fd2a8bae010, 4800) returns
address 0x7fd2a8c652d8 frag. 0x7fd2a8c652a0 (size=4800) on 1 -th hit
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: <core>
[core/mem/q_malloc.c:374]: qm_malloc(): qm_malloc(0x7fd2a8bae010, 2400) called
from core: core/io_wait.c: init_io_wait(516)
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: <core>
[core/mem/q_malloc.c:419]: qm_malloc(): qm_malloc(0x7fd2a8bae010, 2400) returns
address 0x7fd2a8c66600 frag. 0x7fd2a8c665c8 (size=2400) on 1 -th hit
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: ctl
[io_listener.c:246]: io_listen_loop(): io_listen_loop: adding socket 8, type 2,
transport 3 (/var/run/kamailio//kamailio_ctl)
Oct 12 11:38:04 sbc01 /usr/local/sbin/kamailio[10060]: DEBUG: ctl
[../../core/io_wait.h:375]: io_watch_add(): DBG: io_watch_add(0x7fd2a70a5360, 8,
2, 0x2439960), fd_no=0
- The only other thing that I see is transport 3. Isn't that a UNIXS_SOCK?
Hello,
I have an issue with filtering on the asterisk side, my requests are:
UsersPhones(bria) -> Kamailio -> Asterisk -> Sip Trunk Out.
The goal is to manage a new layer of protection ( IP filtering / Whitelisting ).
When I try to compile a list of Whitelisted IP in sip.conf I get this error:
NOTICE[205]: acl.c:748 ast_apply_acl: SIP contact ACL: Rejecting
'145.72.23.45' due to a failure to pass ACL '(BASELINE)'
WARNING[205]: chan_sip.c:17061 parse_register_contact: Domain
'5.12.16.2:48669' disallowed by contact ACL (violating IP
145.72.23.45)
WARNING[205]: chan_sip.c:17933 register_verify: Registration denied
because of contact ACL
The IP 145.72.23.45, is the proxy kamailio and if I added it to
sip.conf it works, but so does every ip afterwards.
I tried with contactpermit also with permit, the result is the same as
long as I permit the proxy ip it works. Is there something that I can
do on the asterisk side to activate this filtering Or there is
something that I can do in Kamailio so it will forward the realip ?
contactdeny=0.0.0.0/0.0.0.0
contactpermit=145.72.23.45/32
contactpermit=5.12.16.2/32
Thanks in advance,
Hi Everyone
There some log kamailio
Warning: 399 03077.08860.B.005.422.228.0.15.01039.00000000.00000 "SDP body
length beyond limit"
how to increase maximum length sdp in kamailio, because i don't see any
configuration related to sizing max length SDP on kamailio documentation
please help me
Thank you very much
Hello,
I'm wondering if anyone had any issues yesterday with the expiration of
the DST Root CA X3 cert?
Out of all the servers I manage, only a couple were affected (debian 8).
They were production servers so we replaced the cert with a different one
to solve the issue while we find the root cause.
Anyone out there had any issues yesterday because of this? I'm just curious!
Joel.