Hi
Further trying to eliminate every possible cause of UDP drops...
We use Homer as HEP server in conjunction with the siptrace module.
So to prevent DQM traffic to be sent to Homer I added:
event_route[siptrace:msg] {
if(is_method("KDMQ")) {
drop();
}
}
And had a closer look to the traffic sent to homer.
I noticed, also xhttp:requests, as far as I see the replies, not the
requests, get mirrored to homer.
xhttp is not a sip method I could match I guess.
The event_route[siptrace:msg] docs state only method can be filtered.
So I can not filter requests on the separate http port I listen on for
xhttp json-rpc requests.
How can I prevent xhttp traffic to be mirrored to homer by the siptrace
module?
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
Hello Kamailians!
As STIR/SHAKEN seems to cross the ocean and arrive on the European shores, I’m curious on how you’ve implemented it with Kamailio. I asked on our Matrix chat and got two responses that seems to not use the Kamailio STIR/SHAKEN support but rather a 3rd party service that they’ve integrated using restful APIs.
Please help me and share how you’re implementing STIR/SHAKEN with Kamailio.
I’m not shaken, nor stirred. yet.
Regards,
/O
Hi,
regarding ndb_redis,
I have 3 sentinels like this:
"192.168.88.155:26379"
"192.168.88.156:26379"
"192.168.88.157:26379"
So was thinking that I would configure ndb_redis this way:
modparam("ndb_redis", "server",
"name=srvZ;sentinel_group=myredis;sentinel_master=1;sentinel=
192.168.88.155:26379")
modparam("ndb_redis", "server",
"name=srvZ;sentinel_group=myredis;sentinel_master=0;sentinel=
192.168.88.156:26379")
modparam("ndb_redis", "server",
"name=srvZ;sentinel_group=myredis;sentinel_master=0;sentinel=
192.168.88.157:26379")
But the samples in the documentation show an extra sentinel key in the
config lines:
# sentinel (for a redis slave)
modparam("ndb_redis", "server",
"name=srvZ;sentinel_group=group_name;sentinel_master=0;sentinel=1.2.3.4:26379
;sentinel=1.2.3.5:26379")
# sentinel (for a redis master)
modparam("ndb_redis", "server",
"name=srvZ;sentinel_group=group_name;sentinel_master=1;sentinel=1.2.3.4:26379
;sentinel=1.2.3.5:26379")
So I am not sure if my configuration is correct.
Can someone clarify?
Hi,
I have an application as follows:
Multiple Kamailio Nodes
Shared Postgres database
Auth information will be stored in DB and accessed with Authdb.
Here is the behavior I seek:
I would like all the Kamailo nodes to cooperate in updating the database, each updating data as appropriate:
When a registration comes in to any Node, and it authenticated, create or update a database record in location table.
When a registration expires on that Node, delete database record in location table.
When INVITE comes in on any Node, ignore local cache and always lookup() record from database.
#1 and #2 are used so that a third SIP system can query the database and look up the Node a NAT’d subscriber is ‘connected’ to.
#3 is to let NON-NAT’d subscribers be contacted from any Node.
Now I have something close to this now – using following settings:
modparam("usrloc", "db_mode", 1) # immediately write registrations to the database.
modparam("usrloc", "db_timer_clean", 0) # do not expire DB records separately
modparam("usrloc", "db_check_update", 1)
This takes care of #1 and #2 above. However, #3 seems to still be relying purely on local cache and does not hit the database.
Is there a way to do #3? I can set db_mode to 3 but that would seem to have other effects besides merely making lookup() read from database.
Thanks in advance,
Jawaid
Hi all,
I am using Kamailio (5.7.2, Debian 11, Python KEMI) in a
mutli-homed environment with the topos module to hide the topology.
I have noticed that when I use `set_send_socket` or `$fsn` to force the
socket it's sent from, it breaks topos and the ACK is not proxied to the
other leg of the call. I am calling record_route() *after* forcing the
socket.
If I disable TOPOS the ACK works as expected, and the signalling looks
correct.
Or, with TOPOS enabled, if I comment out set_send_socket TOPOS works as
expected.
If I disable enable_double_rr, TOPOS works as expected and the ACK is
forwarded, but without the double RR subsequent in-dialog requests use the
wrong socket.
One other observation, when I change the send socket I also see these
warnings in the logs:
24(32) WARNING: PY3 {ACK}: dialog [dlg_handlers.c:1348]: dlg_onroute():
tight matching failed for ACK with
callid='!!:MByLMlFAM.NfWxFAM.cAMxyfWjyLz.yAO.y6MxF1MxVZWG4ZMy**'/55,
ftag='2023101714101800015'/19,
ttag='2f55349a-2c59-4e37-bf58-fd84fb69ece9'/36 and direction=0
24(32) WARNING: PY3 {ACK}: dialog [dlg_handlers.c:1355]: dlg_onroute():
dialog identification elements are
callid='2023101714101800015@2900-0601-0284-80'/37, caller
tag='2023101714101800015'/19, callee
tag='2f55349a-2c59-4e37-bf58-fd84fb69ece9'/36
Is anyone using TOPOS + forcing the socket, or could someone advise where I
am going wrong?
Thanks in advance
Matthew
Hello,
I'm using Kamailio as SIP proxy between Session Manager and SBC
So here is the scenario :
Session Manager sends a call (Invite) to Kamailio, kamailio needs to relay it to SBC after doing some modification.
(-----Session Manager-----) ----------- > (----Kamailio----) ----------- > (-----SBC-----)
My routing logic is similar to the below:
route{
if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {
options_reply();
}
if (is_method("INVITE")) {
sql_query("cb", "select number from pool1 order by random() limit 1", "ra");
$var(rand)=$dbr(ra=>[0,0]);
uac_replace_from($var(rand),"sip:$var(rand)@192.168.1.1");
xlog("L_INFO","Random: $var(rand)");
$var(ip) = $(ct{s.select,1,(a)}{s.select,0,;}{s.replace,>,});
remove_hf("Contact");
insert_hf("Contact: $var(rand) <sip:$var(rand)@$var(ip)>\r\n");
remove_hf("P-Asserted-Identity");
remove_hf("Route");
insert_hf("Route: <sip: 192.168.1.10>\r\n","Route");
record_route();
t_relay();
$td = "192.168.1.10";
$rd = "192.168.1.10";
t_relay();
}
}
Where:
192.168.1.1 is Kamailio IP
192.168.1.10 is SBC IP
My question here is that Kamailio handle all in dialog messages between Session Manager and SBC?
For example, after forwarding the invite packet to SBC, SBC sends 183 Session Progress to Kamailio, which in its turn relay it to the session manager, knowing that this is not mentioned in my routing logic, so how Kamailio knew that it must relay it to session manager in this case?
Also I need to add to the 183 Session Progress sent to session manager by Kamailio record route and Via headers , how to do it ?
Regards,
Hi sr-users,
In the case of dispatcher-based HA such as the Wazo example (
https://wazo-platform.org/blog/kamailio-ha-dispatcher-and-dmq)
won't the Route: headers be wrong for in-dialog requests if the request is
sent to the backup proxy?
front proxy -> proxy A, B, C, D,... -> network
Suppose the INVITE goes through proxy A, then proxy A goes down.
Based on the HA logic, an in-dialog request will go to a backup, say, proxy
B.
However, won't the Route headers be wrong (since they are placed by A) in
the original transaction?
How do you handle Route:, Record-Route: headers at the HA tier?
1. In the front proxy & HA tier don't use route headers at all ??
2. Manually check and remove route headers (i.e proxy B treats route
headers for proxy A as "myself") ??
I am curious as to what is your practice.
Regards
Shih-Ping
Hi all,
I have started using kamailio as a proxy register for asterisk's and works
fine, but in some moment kamailio show WARNINGs, ALERTS and CRITICAL logs
and restart.
I don't no how debug correctly, but the crash show this log lines
*Oct 16 21:34:26 proxy /usr/sbin/kamailio[2148]: CRITICAL: <core>
[core/mem/q_malloc.c:123]: qm_debug_check_frag(): BUG: qm: fragm.
0x7f14a27a5ab8 (address 0x7f14a27a5af0) beginning overwritten
(7f14a27a8e58)! Memory allocator was called from uac: uac_send.c:860.
Fragment marked by UH��AWAVAUATSH��:139726602009368. Exec from
core/mem/q_malloc.c:511.*
-------------------------------------------------------------
*Oct 16 21:39:46 proxy /usr/sbin/kamailio[2556]: CRITICAL: <core>
[core/mem/q_malloc.c:123]: qm_debug_check_frag(): BUG: qm: fragm.
0x7ff7ad456330 (address 0x7ff7ad456368) beginning overwritten (0)! Memory
allocator was called from uac: uac_send.c:860. Fragment marked by (null):0.
Exec from core/mem/q_malloc.c:511.Oct 16 21:39:46 proxy
/usr/sbin/kamailio[2578]: CRITICAL: <core> [core/pass_fd.c:277]:
receive_fd(): EOF on 19Oct 16 21:39:46 proxy /usr/sbin/kamailio[2539]:
ALERT: <core> [main.c:774]: handle_sigs(): child process 2556 exited by a
signal 6Oct 16 21:39:46 proxy /usr/sbin/kamailio[2539]: ALERT: <core>
[main.c:777]: handle_sigs(): core was not generatedOct 16 21:39:46 proxy
systemd[1]: kamailio.service: Main process exited, code=exited,
status=1/FAILUREOct 16 21:39:46 proxy systemd[1]: kamailio.service: Failed
with result 'exit-code'.Oct 16 21:39:46 proxy systemd[1]: kamailio.service:
Service RestartSec=100ms expired, scheduling restart.Oct 16 21:39:46 proxy
systemd[1]: kamailio.service: Scheduled restart job, restart counter is at
9.Oct 16 21:39:46 proxy systemd[1]: Stopped Kamailio - the Open Source SIP
Server.*
any advice is apreciated
--
================
**Daian Conrad**
E-mail: daian.conrad(a)gmail.com
OpenS Team (DaCoD)
Linux user: #248912
Hi,
We are having an error in the Kamailio logs which we need to resolve this
issue,
ERROR is ::* /usr/local/sbin/kamailio[10149]: ERROR: tm [t_reply.c:1081]:
run_failure_handlers(): error running run_top_route for failure handler.*
We are getting this error at the time of the 3xx response, Can anyone help
me on this?
Thank you.
Hi Gang
While still hunting DMQ issues, I noticed that the OS is reporting UDP
drops. Maybe DMQ packets? Would DMQ re-send a lost packet?
I increased OS UDP RX buffers times 10 and monitoring counters.
I also found that DMQ can use tcp or tls as transport.
Could this help to prevent loosing DMQ messages? Or is this prone to
cause new issues?
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
Hello,
I'm trying to solve a problem with calls WebRTC/UDP. I think is a
fragmentation problem because udp/webRTC calls works without problem.
The INVITE from Kamailio to the UDP device not receive any type of answer.
I'm trying to reduce the SDP annex size using:
|sdp_remove_line_by_prefix|
for some lines unsuccessfully. Maybe I don't know where put this
function in the script.
Or, is there another way to solve this issue?
Thank you in advance
Regards
--
---
I'm SoCIaL, MayBe
Hi Team
I'm still hunting down DMQ dialog issues.
https://www.kamailio.org/docs/modules/devel/modules/dialog.html#dialog.p.en…
Quote:
"Notably, it is not possible to send in-dialog requests on any but the
original proxy instance."
I make sure, that if a procied call (with same callID) is being
redirected from anywhere, it is send to the came dialog aware kamailio
instance it originated from. This seems to have fixed a lot of issues
with dialogues getting corrupted.
The two main purposed we use dialog is:
* CDR
* Channel Counting / Limiting
modparam("dialog", "profiles_with_value", "custprofilecounter");
Can a such profile WITH value be written from any node sharing dialog
via DMQ or is this bound to cause troubes?
Example.
Two call get to same customer, but over two different nodes.
Node A is getting a call:
set_dlg_profile("custprofilecounter","Customer7664");
get_profile_size("custprofilecounter","Customer7664","$var(busy_count)");
=> $var(busy_count) is now 1.
The profile is replicated to Node B and the value can be accessed there.
While Call on Node A is running, Node B is getting a call to same
customer:
set_dlg_profile("custprofilecounter","Customer7664");
get_profile_size("custprofilecounter","Customer7664","$var(busy_count)");
=> $var(busy_count) is now 2 on Node B.
Is this value being replicated BACK to Node A where the profile counter
originally was created?
As far as I have experienced, this is the case.
But what happens if the call on Node B is ending before the Call on
Node A? Will the counter being decreased also correctly be replicated
to Node A?
What happens the other way round?
What happens if both call end at the same time? Is a race condition
possible, or is there some sort of locking to prevent this?
Can I use profiles_with_value the way I use them? Or is this bound to
fail because it's not supported?
Mit freundlichen Grüssen
-Benoît Panizzon-
--
I m p r o W a r e A G - Leiter Commerce Kunden
______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00
CH-4133 Pratteln Fax +41 61 826 93 01
Schweiz Web http://www.imp.ch
______________________________________________________
(Please keep the list in CC)
Hello,
The web tools might use another logic internally. I had some success with a java library use case and also with PostgreSQL, I think.
A usual use-case is to have an encrypted password value in a DB, for data at rest encryption. The password is encrypted from something else. Then inside the Kamailio cfg you want to encrypt it on the fly, to use it for example for challenging a phone with username/password.
Maybe you can give it a try with some python or other script languages, where you can play with the different crypto system parameter more easily.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: Jayesh Nambiar <jayesh1017(a)gmail.com>
Sent: Donnerstag, 5. Oktober 2023 06:41
To: Henning Westerholt <hw(a)gilawa.com>
Subject: Re: [SR-Users] Crypto module AES algorithm details
Hello Henning,
Thanks for the super fast reply.
I tested this within kamailio 5.3.4 and I can successfully encrypt a header value and also the same encrypted value decrypts to proper plain text when.
But when I compare the encrypted text with online resources like https://www.devglan.com/online-tools/aes-encryption-decryption and https://www.javainuse.com/aesgenerator, their encrypted text value is different from what I see from kamailio.
Both these resources produce the same encrypted text while the encrypted text from kamailio is different.
How do I validate this?
My use case is as follows:
-- I get an encrypted text in a SIP Header
-- I decrypt it and validate it against some DB
-- If valid proceed or else exit
Now if the algorithm doesnt match exactly, there are chances of error, hence asking question on how to validate it.
On Wed, Oct 4, 2023 at 1:43 PM Henning Westerholt <hw(a)gilawa.com<mailto:hw@gilawa.com>> wrote:
Hello Jayesh,
AFAIK its uses AES 256 with CBC mode. The IV is generated from OpenSSL, e.g. https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html
For newer versions I have added the init_vector functionality to enable interoperability with other crypto functions, e.g. some databases, java frameworks etc. If you want to use this functionality, I’d suggest to update, as the 5.3. is also end of life since some time. Otherwise you can of course also backport this feature.
Cheers,
Henning
--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>
From: Jayesh Nambiar via sr-users <sr-users(a)lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Sent: Mittwoch, 4. Oktober 2023 08:54
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org<mailto:sr-users@lists.kamailio.org>>
Cc: Jayesh Nambiar <jayesh1017(a)gmail.com<mailto:jayesh1017@gmail.com>>
Subject: [SR-Users] Crypto module AES algorithm details
Hello,
I am running kamailio-5.3.4 on one of my setup and I intend to use the crypto module in the same.
I wanted to understand the following details when the module is used:
I understand it uses the AES algorithm, is that correct?
Does it use AES 128, 192 or 256 bit algorithms?
Does it use CBC or ECB mode for AES?
The 5.3 version does not have an parameter for init-vector, so does kamailio use any init vector internally in this case?
When i compared the encrypted text that kamailio produces and the ones available online, they were producing different outputs even when same shared secret was used. Hence asking for more clarification
PS: Upgrading kamailio is my very last option as this is one af an old setup which only needs this feature without much changes.
Thanks for any valuable response.
-- Jayesh
Hello,
I'm using Kamailio as SIP proxy between Session Manager and SBC
So here is the scenario :
Session Manager sends a call (Invite) to Kamailio, kamailio needs to relay it to SBC after doing some modification.
(-----Session Manager-----) ----------- > (----Kamailio----) ----------- > (-----SBC-----)
My routing logic is similar to the below:
route{
if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) {
options_reply();
}
if (is_method("INVITE")) {
sql_query("cb", "select number from pool1 order by random() limit 1", "ra");
$var(rand)=$dbr(ra=>[0,0]);
uac_replace_from($var(rand),"sip:$var(rand)@192.168.1.1");
xlog("L_INFO","Random: $var(rand)");
$td = "192.168.1.10";
$rd = "192.168.1.10";
t_relay();
}
}
Where:
192.168.1.1 is Kamailio IP
192.168.1.10 is SBC IP
The issue is that I'm not sure to handle the other SIP packets like 183,CANCEL, BYE etc that can be received from both SBC and session Manager?
What to add to my configuration to handle it properly?
Regards,
Hi,
I have 2 kamailio instances behind a load balancer. The problem I have is
that the load balancer can only track TCP connections, but not UDP. So one
Kamailio instance might send a request using UDP, while the corresponding
UDP reply arrives on the other. This doesn't play well with the (stateful)
TM module. Is there a way to synchronize the TM module accross Kamailio
instances using DMQ?
Cheers,
Michel Pelletier
Hello,
I'm a bit confused about a piece of the documentation. I'm using rtpproxy 3.0.1 + rtpproxy module on kamailio 5.6.4.
On the rtpproxy module, I'm trying to get the "timeout_socket" param working. From the documentation, I have
modparam("rtpproxy", "timeout_socket", "xmlrpc:http://192.168.155.64:8888/XMLRPC")
modparam("xmlrpc", "route", "XMLRPC_ROUTE")
modparam("xmlrpc", "mode", 1)
modparam("xmlrpc", "url_match", "^/XMLRPC")
/usr/bin/rtpproxy -i -u rtpproxy -n tcp:192.168.155.64:8888 -l 192.168.155.64 -s udp:127.0.0.1:7333 -m 29152 -M 49150 -d DBUG
However when purposely trying to timeout RTP, I'm seeing the following in my rtpproxy logs:
Oct 10 00:31:22 localhost rtpproxy[3802129]: DBUG:GLOBAL:rtpp_command_split:401: received command "3801518_4 USc9,0,8,18,101 219b2465decc-n7al36xva4lw 192.168.155.168 2266 C60D788E-8E14A9FA;1 w6p2ke9ttk;1 xmlrpc:http://192.168.155.64:8888/XMLHTTP"
Oct 10 00:31:22 localhost rtpproxy[3802129]: ERR:219b2465decc-n7al36xva4lw:rtpp_command_ul_handle:603: invalid socket name w6p2ke9ttk;1
I'm just wondering if I'm missing anything, do I need to define "listen=tcp:192.168.155.64:8888" in my configs? I know that rtpengine is recommended/ I would like to experiement with rtpproxy. Do I need a specific version of rtpproxy in order for this to work -- I did try it with 2.1.1 however that didn't work.
Thanks.
Hello,
Kamailio SIP Server project is organizing another meeting of its
developers and community members during November 7-8, 2023, hosted again
by sipgate.de in Dusseldorf, Germany.
The event is intended to facilitate the interaction between Kamailio
developers and contributors in order to offer a convenient environment
for working together on several topics of high interest for the project,
including writing code for Kamailio and its tools, improving
documentation, or discuss about future development.
Everyone from the community is welcome to join, developer or user
interested in helping the project. Please note we have a limited
capacity of seats in the meeting room, the main policy for accepting
participants being first come first server. Also, very important to be
aware that this is not an event to learn how to use Kamailio.
More details about the event, the venue, how to register, are available at:
* https://www.kamailio.org/w/developers-meeting/
Looking forward to those two intensive hacking Kamailio days in Dusseldorf!
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training - Online - Nov 14-16, 2023 -- asipto.com
Dear friends, I have a question: When adding a custom module in kamailio, I referenced a third-party library. There was no problem with compilation, but when I ran it, it reported that the third-party library could not be found. What is the reason?
The current Makefile is as follows:
```
# WARNING: do not run this directly, it should be run by the main Makefile
include ../../Makefile.defs
auto_gen=
NAME=rocketmq.so
THIRDPARTY=/mnt/vdd/kqbi2/3rdparty
ROCKETMQ_ROOT_PATH=${THIRDPARTY}/rocketmq
CXX?=g++
LD?=g++
LIBS+=-L$(LOCALBASE)/lib -L$(ROCKETMQ_ROOT_PATH)/lib/linux/x64 crocketmq.o -lstdc++ -lrocketmq
DEFS+=-I$(LOCALBASE)/include -I${ROCKETMQ_ROOT_PATH}/include
CXXFLAGS=$(CFLAGS:-Wno-deprecated option=)
CXXFLAGS+=-Wno-write-strings -Wno-deprecated -Wno-unused-function -Wno-sign-compare -Wno-strict-aliasing
include ../../Makefile.modules
crocketmq.o: crocketmq.cpp crocketmq.h
@echo "Compiling $<"
$(CXX) -std=c++11 $(CXXFLAGS) $(CFLAGS) $(C_DEFS) $(DEFS) -c $< -o $@
rocketmq.so: crocketmq.o
modclean:
-@rm -f crocketmq.o crocketmq.d rocketmq_mod.o rocketmq_mod.d
clean clean-modules: modclean
proper realclean distclean maintainer-clean: modclean
```
There is no problem in compiling, but when running, the third-party librocketmq.so library cannot be found, and various export LD_LIBRARY_LIBRARY also does not work.
```
0(13229) DEBUG: <core> [core/cfg.y:2053]: yyparse(): loading module rocketmq.so
0(13229) DEBUG: <core> [core/sr_module.c:516]: ksr_locate_module(): found module to load <lib64/kamailio/modules/rocketmq.so>
0(13229) DEBUG: <core> [core/sr_module.c:573]: ksr_load_module(): trying to load <lib64/kamailio/modules/rocketmq.so>
0(13229) ERROR: <core> [core/sr_module.c:591]: ksr_load_module(): could not open module <lib64/kamailio/modules/rocketmq.so>: librocketmq.so: cannot open shared object file: No such file or directory
0(13229) CRITICAL: <core> [core/cfg.y:3900]: yyerror_at(): parse error in config file /mnt/vdd/kqbi2/install/kamailio/etc/kamailio/kamailio.cfg, line 380, column 12-24: failed to load module
```
Hi
I have a scenario where I need to implement serial forking but each
destination has also a next hop proxy. I can do the forking using
append_branch, but how can I set the destination URI for each branch? In
some cases the R-URI does not change, only the next hop proxy.
Example:
R-URI Next Hop
user1(a)domain.com XXX.XXX.XXX.XXX
user1(a)domain.com YYY.YYY.YYY.YYY
user2(a)domain.com XXX.XXX.XXX.XXX
I was thinking I could use a htable to store the next hop using the
R-URI as the key, but as can be seen above there are possibly duplicate
R-URIs with only the next hop changing.
Thanks.
--
-Barry
Morning
What have you got your listen / advertise address / port set as?
See this link > https://www.kamailio.org/wiki/cookbooks/5.5.x/core#advertised_address
I'd probably start by looking at that.
Lewis
Mission Labs Limited is registered in England, company number 10040088. Trading Office: The Old Milk Depot, Bacup Rd, Rossendale, BB4 7FE. Registered office: The Scalpel, 18th Floor 52 Lime Street, London, EC3M 7AF. Email confidentiality notice: This message is private and confidential. If you have received this message in error, please notify us and remove it from your system. Please consider the environment before you print this email.
Hello,
I'm using Kamailio as SIP proxy to receive INVITE packets, randomize A-number and then relay it to a certain gateway.
I noticed that a Via header is added to the INVITE sent by Kamailio to the gateway with 0.0.0.0 as address as shown below:
Via: SIP/2.0/UDP 0.0.0.0;branch=z9hG4bK2d97.61de75dd58fa7ca7450cc8b9b01db62f.0
As far as I know, the IP that should be used in the new added VIA header must be Kamailio IP, but it's not the case here, knowing that Kamailio is not behind NAT.
Regards,
Ali Taher
Hello,
Is there a way to change the transaction order when a failure fork occurs -- to explain, endpoint 1 calls endpoint 2. Call towards endpoint 2 goes unanswered, and so the call forks to voicemail, I see that an INVITE is sent towards my voicemail server first, followed by a CANCEL towards the endpoint; can I send the CANCEL first to the endpoint and then INVITE towards my voicemail server. I'm essentially using the bundled/sample configurations for testing.
Thank you.
UA1(192.168.0.1) --> kamailio (internal:192.168.0.2 public:1.1.1.1) --> UA2(2.2.2.2)
if in UA1 INVITE, I write KSR.rr.record_route().
so UA2(2.2.2.2) received sip msg (Record-Route: <sip:1.1.1.1:7080>), so Kamailio can received BYE/ACK from UA2.
but,Kamailio can't received BYE/ACK from UA1.
if in UA1 INVITE, i write KSR.rr.record_route_advertised_address("192.168.0.2"), then Kamailio can received BYE/ACK from UA1, but not from UA2.
what can i do, let Kamailio receive BYE/ACK from both sides ?
Hello all,
Can you please clarify part of the following doc for me?
--
6.7. early_timeout (integer)
The timeout (in seconds) after which the dialogs in unconfirmed or early
state (no final response received) are destroyed.
* Default value is “300 (5 minutes)”. *
*Example 1.7. Set early_timeout parameter*
...
modparam("dialog", "early_timeout", 180)
---
In the case where Kamailio acts as an SBC, will kamailio send a SIP BYE
message to both devices (UAC and UAC)?
Or
Can Kamailio send a BYE message to both parties when timer b has expired?
If yes, how to do it?
Regards
Abdoul
UA(192.168.0.11) received 183, find Record-Route(36.140.122.12)
then send ACK to 36.140.122.12(Kamialio public ip) not 192.168.0.2(kamailio internal ip), so Kamailio can't receive ACK.
this is my config,192.168.0.11 -> Kamailio -> Other SBC(public ip)
function ksr_request_route()
if KSR.is_INVITE() then
KSR.rr.record_route();
KSR.nathelper.fix_nated_contact()
end
end
This question has been bothering me for a long time, help me
[cid:d1ec74be-1c33-406e-80d5-68663d1cd21f]
[cid:bda00d0d-e6e6-4dc9-9462-141ad42b09b8]
Hi All,
I use kamailio In front of Asterisk and kamailio needs to refresh registrations periodically towards Asterisk to ensure the availability of users from Asterisk side.
I use uac module and call uac_req_send() for sending REGISTER requests.
I set $uac_req(evroute)=1
The event_route[uac:reply] is called fine, but in kamailio logs I see the next lines:
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f114995ada8), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_resend_tm_callback(732) - ignoring
After some time, kamailio has crashed.
CRITICAL: <core> [core/mem/q_malloc.c:519]: qm_free(): BUG: freeing already freed pointer (0x7f114995ada8), called from uac: uac_send.c: uac_send_tm_callback(860), first free uac: uac_send.c: uac_resend_tm_callback(732) – ignoring
CRITICAL: <core> [core/pass_fd.c:277]: receive_fd(): EOF on 34
ALERT: <core> [main.c:774]: handle_sigs(): child process 1407950 exited by a signal 6
Any idea that is it a bug or I use something wrong in config?
Thanks in advance!
Péter Barabás
*Hello,*
I am running kamailio-5.3.4 on one of my setup and I intend to use the
crypto module in the same.
I wanted to understand the following details when the module is used:
I understand it uses the AES algorithm, is that correct?
Does it use AES 128, 192 or 256 bit algorithms?
Does it use CBC or ECB mode for AES?
The 5.3 version does not have an parameter for init-vector, so does
kamailio use any init vector internally in this case?
When i compared the encrypted text that kamailio produces and the ones
available online, they were producing different outputs even when same
shared secret was used. Hence asking for more clarification
PS: Upgrading kamailio is my very last option as this is one af an old
setup which only needs this feature without much changes.
Thanks for any valuable response.
*-- Jayesh*
Hello,
In reference to this issue https://github.com/kamailio/kamailio/issues/3081 I've been advised to set http_reply_parse to "no" which I did (and it is the default value anyways).
# grep http_reply_parse /etc/kamailio/kamailio.cfg
http_reply_parse=no
After setting this, I still get these parsing errors:
{ "idx": 23, "pid": 102, "level": "ERROR", "module": "core", "file": "core/parser/msg_parser.c", "line": 748, "function": "parse_msg", "logprefix": "", "message": "ERROR: parse_msg: message=<HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\ndate: Wed, 26 Jul 2023 16:43:19 GMT\r\ncontent-length: 224\r\ncontent-type: text/plain; charset=utf-8\r\n\r\n{\"result\": {\"ruri\":\"\",\"fU\":\"\",\"tU\":\"\",\"privacy\":\"\",\"identity\":\"\",\"error\":{\"code\":0,\"message\":\"\"},\"mb\":\"\",\"Headers\":null,\"encrypted\":\"\",\"sipsScheme\":\"\",\"attestation\":\"\",\"authUser\":\"\",\"authPassword\":\"\",\"disableStirShaken\":\"\"}}>" }
Is there anything that I am missing beyond setting that parameter?
Thank you,
Alexandru
Aloha,
I'm experiencing this internal DNS problem with Kamailio, can't seem to
figure out what's causing it. Maybe someone can help.
Essentially, from time to time (one or two times a day) this situation
happens, starting with logs:
linux kamailio[773]: ERROR: uac [uac_reg.c:1163]: uac_reg_send(): failed to
send request for [some-uuid]
linux kamailio[773]: ERROR: <core> [core/resolve.c:1730]:
sip_hostport2su(): could not resolve hostname: "my.domain.net"
linux kamailio[773]: ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "
my.domain.net"
linux kamailio[773]: ERROR: tm [uac.c:480]: t_uac_prepare(): no socket found
# Do a Kamailio internal DNS lookup, no results found???
root@linux:~# kamcmd dns.lookup a my.domain.net
error: 400 - Not found
# Do a system DNS lookup. All good.
root@linux:~# dig my.domain.net
;; QUESTION SECTION:
;my.domain.net. IN A
;; ANSWER SECTION:
my.domain.net. 18000 IN A 192.168.0.1
# Delete internal Kamailio DNS record
root@linux:~# kamcmd dns.delete_a my.domain.net
# Lookup again right away. It's there, problem fixed. Why??
root@linux:~# kamcmd dns.lookup a my.domain.net
{
name: my.domain.net
type: A
size_bytes: 120
reference_counter: 2
permanent: no
expires: 7674
last_used: 0
negative_entry: no
records: {
{
rr_idx: 0
rr_ip: 192.168.0.1
rr_permanent: no
rr_expires: 7674
}
}
}
Hello,
I have some questions about dispatcher's behavior. I noticed that when I first ds_select_dst() a specific dispatcher group ID, ds_next_dst() will cycle through the active destinations in that group. When it reaches the end of the destinations in the group, it does not return "false", instead it starts to return destinations that are not a part of that group, ie. those destinations which are listed prior to the selected group in the dispatcher.list file. Is this the expected behavior? I've observed it on kamailio 5.3 and 5.5 releases.
My dispatcher.list:
# Group 1
1 sip:127.0.0.1:5071;transport=udp 8 0
# Group 2
2 sip:127.0.0.1:5072;transport=udp 8 0
# Group 3
3 sip:127.0.0.1:7010;transport=udp 8 0
3 sip:127.0.0.1:7011;transport=udp 8 0
3 sip:127.0.0.1:7012;transport=udp 8 0
# Group 4
4 sip:127.0.0.1:5071;transport=udp 8 0
4 sip:127.0.0.1:5072;transport=udp 8 0
I have the following in failure_route (excerpt):
$var(dsFoundDestination) = 0;
if (t_any_replied())
{
xavp_params_implode("_dsdst_", "$var(dsDestinations)");
xlog("L_INFO", "FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [$var(dsDestinations)]");
if (ds_next_dst())
{
xavp_params_implode("_dsdst_", "$var(dsDestinations)");
xlog("L_INFO", "FAILURE ROUTE: Next destination selected: [$du] from [$var(dsDestinations)]");
$var(dsFoundDestination) = 1;
}
}
else if (ds_select_dst("3", "8")) // Dispatcher Group 3
{
xlog("L_INFO", "FAILURE ROUTE: Did not find any replies on this transaction. Selected destination: [$du]");
$var(dsFoundDestination) = 1;
}
if ($var(dsFoundDestination))
{
$var(logString) = "FAILURE ROUTE: Relayed to [" + $du + "]";
if (t_relay())
{
xlog("L_INFO", "$var(logString)");
}
}
Produces the following logs:
FAILURE ROUTE: Did not find any replies on this transaction. Selected destination: [sip:127.0.0.1:7012;transport=udp]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:7012;transport=udp]
FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [grp=3;uri=sip:127.0.0.1:7012;transport=udp;]
FAILURE ROUTE: Next destination selected: [sip:127.0.0.1:7011;transport=udp] from [grp=3;uri=sip:127.0.0.1:7011;transport=udp;]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:7011;transport=udp]
FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [grp=3;uri=sip:127.0.0.1:7011;transport=udp;]
FAILURE ROUTE: Next destination selected: [sip:127.0.0.1:7010;transport=udp] from [grp=3;uri=sip:127.0.0.1:7010;transport=udp;]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:7010;transport=udp]
FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [grp=3;uri=sip:127.0.0.1:7010;transport=udp;]
FAILURE ROUTE: Next destination selected: [sip:127.0.0.1:5072;transport=udp] from [grp=2;uri=sip:127.0.0.1:5072;transport=udp;]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:5072;transport=udp]
FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [grp=2;uri=sip:127.0.0.1:5072;transport=udp;]
FAILURE ROUTE: Next destination selected: [sip:127.0.0.1:5072;transport=udp] from [grp=2;uri=sip:127.0.0.1:5072;transport=udp;]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:5072;transport=udp]
FAILURE ROUTE: Already have replies on this transaction. Selecting next destination from: [grp=2;uri=sip:127.0.0.1:5072;transport=udp;]
FAILURE ROUTE: Next destination selected: [sip:127.0.0.1:5071;transport=udp] from [grp=1;uri=sip:127.0.0.1:5071;transport=udp;]
FAILURE ROUTE: Relayed to [sip:127.0.0.1:5071;transport=udp]
I want to stop the loop once there are no more active destinations in group 3. Is the solution simply to check that the selected destination is part of the desired group and stop processing if it is not?
Thanks for your time.
Hello,
Kamailio SIP Server v5.7.2 stable release is out.
This is a maintenance release of the latest stable branch, 5.7, that
includes fixes since the release of v5.7.1. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.7.x. Deployments running previous v5.7.x
versions are strongly recommended to be upgraded to v5.7.2.
For more details about version 5.7.2 (including links and guidelines to
download the tarball or from GIT repository), visit:
* https://www.kamailio.org/w/2023/09/kamailio-v5-7-2-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - www.kamailioworld.com
Hello,
I am considering to release Kamailio v5.7.2 (out of branch 5.7) this
week (likely on Wednesday or Thursday, Sep 27/28, 2023). If anyone is
aware of issues not yet on the bug tracker, report them there asap in
order to have a better chance to be fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - www.kamailioworld.com
Hello Kamailio Community,
I'm currently working on a project that involves complex SIP routing and handling. I've encountered some difficulties while using change_reply_status, and append_hf functions in failure_route route in Kamailio. Although the documentation does provide guidance, the behaviors I am experiencing aren't aligning with the expected outcomes.
Issue 1: failure_route
I've set up a failure_route to handle specific SIP response codes (>4xx). However, I've observed that it get trigered and lunched, but I can't use change_reply_status or append_hf, I was using this first in onreply_route.
Issue 2: change_reply_status
I tried to use the change_reply_status function to modify the status of SIP replies, but it raises an error that this command cannot be executed here.
Issue 3: append_hf
I've also attempted to use append_hf in my failure_route block to add headers to replies, but the headers are not being added as expected.
As a workaround, I've been using send_reply and append_to_reply for adding custom headers, and they seem to be working as expected. However, I found some old messages in kamailio mailing list, I can summerize what I learned like this ```
#Functions and Context
- append_hf(): Adds a header to the currently processed SIP message. If you are in a route {...} block, then this adds the header to the request. If you are in an onreply_route, it adds the header to the reply. This function always acts on the message currently under scrutiny.
- append_to_reply(): This function is used to add a header to a reply that will be generated by Kamailio at a later time. This function only affects replies generated by Kamailio itself and is not applicable for messages that are simply being forwarded.
#Contexts
- route {...}: This is typically where the incoming SIP request gets processed. Here, append_hf() will add headers to that request, and append_to_reply() will add headers to any replies that Kamailio might generate for this request.
- onreply_route: This is where incoming SIP replies are processed. Here, append_hf() will act on the reply, not the request.
``` I'd like to know if there is a way to handle sip replies in failure_route, because send_reply make a new reply from kamailio, instead I want to keep some important headers from the original reply.
I'd appreciate any insights or guidance the community can offer.
Best regards,
Hello Kamailio,
Is it possible to use RTPengine with a single UDP port for all calls instead of a range of ports?
For example, when an invite is received or sent, the offered SDP for RTPengine is to receive RTP packets on a single port that is the same for all other calls, so that on firewalls only one port is to be opened.
Hello all,
I have my rtpengine configured to use ports 20000 - 50000 for RTP in
rtpengine.conf.
Now i want to able to select the port or the port range in a call by call
basis. Is that possible?
I've tried to use "media-address" flag on rtpengine_manage but i wasn't
successful.
Thanks in advance,
Cheers,
Duarte Rocha
Hello!
We had several crashs of Kamailio (5.3.4) in the last weeks. Each time, the
last logs are:
/usr/local/sbin/kamailio[20942]: CRITICAL: <core> [core/forward.c:347]:
get_send_socket2(): unsupported proto 0 (*)
/usr/local/sbin/kamailio[20966]: CRITICAL: <core> [core/forward.c:347]:
get_send_socket2(): unsupported proto 111 (unknown)
When we look to the coredump, here below the first traces:
(gdb) bt
#0 0x00007f70131b3d91 in prepare_new_uac (t=0x7f6fe1d45340,
i_req=0x7f7016fbe208, branch=0, uri=0x7fff37142fa0, path=0x7fff37142f80,
next_hop=0x7f7016fbe480, fsocket=0x0,
snd_flags=..., fproto=0, flags=2, instance=0x7fff37142f70,
ruid=0x7fff37142f60, location_ua=0x7fff37142f50) at t_fwd.c:463
#1 0x00007f70131b7c42 in add_uac (t=0x7f6fe1d45340, request=0x7f7016fbe208,
uri=0x7f7016fbe480, next_hop=0x7f7016fbe480, path=0x7f7016fbe848, proxy=0x0,
fsocket=0x0,
snd_flags=..., proto=0, flags=2, instance=0x7f7016fbe858,
ruid=0x7f7016fbe870, location_ua=0x7f7016fbe880) at t_fwd.c:805
#2 0x00007f70131bfebd in t_forward_nonack (t=0x7f6fe1d45340,
p_msg=0x7f7016fbe208, proxy=0x0, proto=0) at t_fwd.c:1667
#3 0x00007f701316cf44 in t_relay_to (p_msg=0x7f7016fbe208, proxy=0x0,
proto=0, replicate=0) at t_funcs.c:332
#4 0x00007f70131a3a11 in _w_t_relay_to (p_msg=0x7f7016fbe208, proxy=0x0,
force_proto=0) at tm.c:1689
#5 0x00007f70131a4c51 in w_t_relay (p_msg=0x7f7016fbe208, _foo=0x0,
_bar=0x0) at tm.c:1889
#6 0x00000000005a1f57 in do_action (h=0x7fff37143d90, a=0x7f7016bd1b10,
msg=0x7f7016fbe208) at core/action.c:1071
#7 0x00000000005aeb1e in run_actions (h=0x7fff37143d90, a=0x7f7016bd1b10,
msg=0x7f7016fbe208) at core/action.c:1576
#8 0x00000000005af1df in run_actions_safe (h=0x7fff37146e90,
a=0x7f7016bd1b10, msg=0x7f7016fbe208) at core/action.c:1640
#9 0x000000000066aa50 in rval_get_int (h=0x7fff37146e90,
msg=0x7f7016fbe208, i=0x7fff37144238, rv=0x7f7016bd1e60, cache=0x0) at
core/rvalue.c:915
#10 0x000000000066f000 in rval_expr_eval_int (h=0x7fff37146e90,
msg=0x7f7016fbe208, res=0x7fff37144238, rve=0x7f7016bd1e58) at
core/rvalue.c:1913
#11 0x000000000066f453 in rval_expr_eval_int (h=0x7fff37146e90,
msg=0x7f7016fbe208, res=0x7fff371446ec, rve=0x7f7016bd2588) at
core/rvalue.c:1921
#12 0x00000000005a1a1d in do_action (h=0x7fff37146e90, a=0x7f7016bd2e08,
msg=0x7f7016fbe208) at core/action.c:1047
#13 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016bcbd20,
msg=0x7f7016fbe208) at core/action.c:1576
#14 0x000000000059e97d in do_action (h=0x7fff37146e90, a=0x7f7016ef19b8,
msg=0x7f7016fbe208) at core/action.c:695
#15 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016e3f578,
msg=0x7f7016fbe208) at core/action.c:1576
#16 0x000000000059e97d in do_action (h=0x7fff37146e90, a=0x7f7016c220a0,
msg=0x7f7016fbe208) at core/action.c:695
#17 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016c220a0,
msg=0x7f7016fbe208) at core/action.c:1576
#18 0x00000000005aae93 in do_action (h=0x7fff37146e90, a=0x7f7016c23978,
msg=0x7f7016fbe208) at core/action.c:1207
#19 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016c20748,
msg=0x7f7016fbe208) at core/action.c:1576
#20 0x00000000005a1ec6 in do_action (h=0x7fff37146e90, a=0x7f7016c576a0,
msg=0x7f7016fbe208) at core/action.c:1062
#21 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016c0b770,
msg=0x7f7016fbe208) at core/action.c:1576
#22 0x000000000059e97d in do_action (h=0x7fff37146e90, a=0x7f7016bc9920,
msg=0x7f7016fbe208) at core/action.c:695
#23 0x00000000005aeb1e in run_actions (h=0x7fff37146e90, a=0x7f7016bb9100,
msg=0x7f7016fbe208) at core/action.c:1576
#24 0x00000000005af2a7 in run_top_route (a=0x7f7016bb9100,
msg=0x7f7016fbe208, c=0x0) at core/action.c:1661
#25 0x00000000005bcb7a in receive_msg (
buf=0xadbd80 <buf.6971> "INVITE sip:AAAAAAAAAA@W.X.Y.Z SIP/2.0\r\nVia:
SIP/2.0/UDP W.X.Y.Z;rport;branch=z9hG4bKZD8Za7p2XF7cF\r\nMax-Forwards:
69\r\nFrom: \"AAAAAAAAAA\" sip:AAAAAAAAAA@W.X.Y.Z;tag=aXy4Na2NtvKBK\r\nTo:
<"..., len=1011, rcv_info=0x7fff371474c0) at core/receive.c:423
#26 0x0000000000488e7f in udp_rcv_loop () at core/udp_server.c:548
#27 0x000000000042650f in main_loop () at main.c:1673
#28 0x000000000042ec18 in main (argc=7, argv=0x7fff37147c38) at main.c:2802
Is there anything relevant in this to know what's wrong?
Regards,
Igor.
--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com
Hello,
we are considering to organize another edition of Kamailio Developers
Meeting, to be hosted again by sipgate.de in Dusseldorf, Germany. There
is no fee for participants (i.e., free entry), but each one has to take
care of travelling and accommodation (drinks and food are provided
during the day).
A few developers are already on board, we are looking to see if anyone
else from the broader community wants to join us. Likely it is going to
be during 2 days (with the option of doing it during three days still
open at this moment, if there is going to be enough interest to have it
longer). The proposed time frames are:
- Nov 7-9, 2023
- Nov 21-23, 2023
The event is about discussing the internals of Kamailio (e.g.,
architectural changes, development strategies) and writing code or
documentation for it. This is not an event about learning how to use
Kamailio, but to work on improving it. As a bonus, there will be a
social networking event in the evening with some fun activities, drinks
and food.
If you want to join, state your preference for any of the two time
frames (or even just for 2 days in one of the two time frames). It is
not a large meeting room, if we get too many join requests, we may have
to select based on past contributions, and if that is not the case, then
is just the first come first served.
You can reply to this thread or just write me directly if you want to
join and when you prefer to happen.
By mid of next week, we plan to select the event dates so everyone that
comes to it can start planning the trip.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy - Training Services -- asipto.com
Kamailio World Conference - kamailioworld.com
Hello Team,
I hope you're all doing well. I'm reaching out to request your insights on the following scenario.
Overview:
I have successfully configured Kamailio to authenticate IP addresses, primarily for PBXs and customers unable to register. With this setup, I can flawlessly receive incoming traffic and forward it to our internal FreeSwitch servers.
Current issue:
Now, I'm focusing on managing traffic in the opposite direction—specifically for DIDs. I have a DID table set up in Kamailio that associates DID numbers with their respective IP peers. Upon receiving a call, a database lookup is performed to find the destination number, after which the call is terminated at the customer's IP.
I'm facing difficulty in handling situations where a customer has multiple IP peers (for redundancy). My aim is to try each of these IPs sequentially when terminating a specific DID call towards them. The current logic I'm employing for the INVITE lookup looks like this:
# Database lookup for INVITEs
if (is_method("INVITE")) {
sql_query("didrouting_db", "SELECT route_to FROM did_routing WHERE did_number='$rU'", "result");
if ($dbr(result=>rows) > 0) {
$var(route_to) = $dbr(result=>[0,0]);
xlog("L_INFO", "Routing DID $rU to $var(route_to)\n");
$du = "sip:" + $var(route_to) + ":5060";
} else {
$du = "sip:" + FS_IP + ":5060";
}
}
The above logic works fine for a single IP.
I intend to use a comma-separated list of IPs in my route_to column (for example 192.168.1.2,192.168.1.3, ...) and then iterate through these IPs one by one. I'm having trouble coming up with a workable logic or loop to achieve this. Would you be able to offer any guidance or suggestions?
Please also recommend if there is a better approach available to handle this scenario.
Thank you in advance for your valuable input.
Regards,
Shah Hussain
Hi all
I see this old thread from 2015.
- https://kamailio.org/mailman3/hyperkitty/list/sr-users@lists.kamailio.org/t…
It's about max_inv_lifetime not working properly.
I have this problem today: SIP-180 responses from downstream
apparently reset max_inv_lifetime, and the transaction can live for
hours (apparently indefinitely) even though max_inv_lifetime is set to
just over a minute.
By spacing the SIP-180 responses (from downstream) slightly longer
apart than than max_inv_lifetime in kamailio, I don't get the problem,
so it looks to me that this is TM not matching what's in the
documentation (which mentions that this should be a hard limit).
With this configuration, SIP-180 responses every minute result in the
transaction never ending (until the client CANCELs the call).
- kamailio.cfg:modparam("tm", "fr_timer", 3000)
- kamailio.cfg:modparam("tm", "fr_inv_timer", 300000)
- kamailio.cfg:modparam("tm", "max_inv_lifetime", 65000)
- kamailio.cfg:modparam("tm", "noisy_ctimer", 1)
That other thread ends with Daniel mentioning that he'd have to look
at the code, but nothing further.
Running "git log --grep max_inv_lifetime" shows me that the last/only
update that wasn't just documentation was in 2007.
Has anyone got an ideas?
James
Hi list,
I'm trying to use Kamailio 4.4.4 with rtpengine in a self-inflicted
emergency situation (didn't monitor traffic growth properly and now
encountering packet loss during peak times) as a drop-in replacement for
an overloaded Asterisk box in a call-termination-to-upstream-carrier
scenario.
My test scenario is to make a call from a SIP softphone to Asterisk IP
1.1.1.1 -> Kamailio/rtpengine IP 2.2.2.2 -> Upstream carrier 3.3.3.3
sngrep on Kamailio box 2.2.2.2 - the following SDP will not work -
carrier is rejecting it. Carrier is authenticating our calls based on
our IP address 2.2.2.2, no username/pass involved.
2023/09/22 02:06:49.216136 2.2.2.2:5060 -> 3.3.3.3:5060
INVITE sip:+32xxxxxxxx@2.2.2.2;user=phone SIP/2.0
Record-Route: <sip:2.2.2.2;lr>
Via: SIP/2.0/UDP
2.2.2.2;branch=z9hG4bKd9c3.d6fa3abe5d52b827e2054de5573028e0.0
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK473270e8
Max-Forwards: 69
From: "61xxxxxxxxx" <sip:+61xxxxxxxxx@1.1.1.1>;tag=as3d75aadd
To: <sip:+32xxxxxxxx@2.2.2.2;user=phone>
Contact: <sip:+61xxxxxxxxx@1.1.1.1:5060>
Call-ID: 3f31e1622a72b6d17f24e42362f4f1d0@1.1.1.1:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 20.0.0
Date: Fri, 22 Sep 2023 00:06:50 GMT
Session-Expires: 1800
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE
Supported: replaces, timer
P-Asserted-Identity: <sip:+61xxxxxxxxx@2.2.2.2;user=phone>
Content-Type: application/sdp
Content-Length: 314
X-SIP: 1.1.1.1
v=0
o=root 1093000903 1093000903 IN IP4 1.1.1.1
s=Asterisk PBX 20.0.0
c=IN IP4 2.2.2.2
t=0 0
m=audio 25742 RTP/AVP 8 9 0 101
a=maxptime:150
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:25743
a=ptime:20
I'm comparing this rejected INVITE to a successful INVITE sent by the
original Asterisk box at IP 2.2.2.2 (now Kamailio box) to the carrier
without Kamailio in the path, and these are the differences I noticed,
and probably the things I have to mimick with Kamailio in order to make
it work:
INVITE sip:+32xxxxxxxxx@2.2.2.2;user=phone SIP/2.0
should be
INVITE sip:+32xxxxxxxxx@3.3.3.3;user=phone SIP/2.0
To: <sip:+32xxxxxxxx@2.2.2.2;user=phone>
should be
To: <sip:+32xxxxxxxx@3.3.3.3;user=phone>
From: "61xxxxxxxxx" <sip:+61xxxxxxxxx@1.1.1.1>;tag=as3d75aadd
should be
From: "61xxxxxxxxx" <sip:+61xxxxxxxxx@2.2.2.2>;tag=as3d75aadd
Contact: <sip:+61xxxxxxxxx@1.1.1.1:5060>
should be
Contact: <sip:+61xxxxxxxxx@2.2.2.2:5060>
Call-ID: 3f31e1622a72b6d17f24e42362f4f1d0@1.1.1.1:5060
should be
Call-ID: 3f31e1622a72b6d17f24e42362f4f1d0@2.2.2.2:5060
o=root 1093000903 1093000903 IN IP4 1.1.1.1
should be
o=root 1093000903 1093000903 IN IP4 2.2.2.2
My kamailio.cfg can be found here: https://pastebin.com/6PKcRjPU
These are the Asterisk boxes I want to originate calls from to Kamailio:
[root@voip30 ~]# kamctl address show
+-----+-----+----------+------+------+-----------+
| id | grp | ip_addr | mask | port | tag |
+-----+-----+----------+------+------+-----------+
| 195 | 1 | 1.1.1.1 | 32 | 0 | voip20.sv |
| 196 | 1 | 1.1.1.2 | 32 | 0 | voip21.sv |
| 197 | 1 | 1.1.1.3 | 32 | 0 | voip22.sv |
| 198 | 1 | 1.1.1.4 | 32 | 0 | voip23.sv |
| 199 | 1 | 1.1.1.5 | 32 | 0 | voip24.sv |
| 200 | 1 | 1.1.1.6 | 32 | 0 | voip25.sv |
| 201 | 1 | 1.1.1.7 | 32 | 0 | voip26.sv |
| 202 | 1 | 1.1.1.8 | 32 | 0 | voip27.sv |
| 203 | 1 | 1.1.1.9 | 32 | 0 | voip28.sv |
+-----+-----+----------+------+------+-----------+
This is the upstream carrier I want Kamailio to proxy calls to:
[root@voip30 ~]# kamctl dispatcher show
dispatcher gateways
+----+-------+------------------+-------+-------+------------+------+
| id | setid | destination | flags | prio. | attrs | desc |
+----+-------+------------------+-------+-------+------------+------+
| 12 | 1 | sip:3.3.3.3:5060 | 0 | 0 | weight=100 | |
+----+-------+------------------+-------+-------+------------+------+
(output manually slightly modified to look properly over E-Mail)
As you might have guessed I'm a Kamailio noob... and don't have the
resources to learn it as fast as I must to avoid further packet loss. If
there's anyone available who can help me to get this done today,
optionally in exchange for money, I'd be grateful.
Thank you!
Markus
What's the best way to store multi-dimensional data within an htable? For example, storing an avp stack:
$avp(foo) = "first";
$avp(foo) = "second";
$sht(bar=>foo) = $avp(foo);
The result of which is that only $avp(foo[0]) is stored in the htable:
kamcmd htable.dump bar
{
entry: 2
size: 1
slot: {
{
name: bar
value: second
type: str
}
}
}
The htable documentation shows support for lists, but it doesn't make clear if this is really usable outside of loading from a database, and looks like it's short hand for managing/creating linked lists. The other option would be to simply serialize the data before storing it in the htable - which is fine, I just want to be sure I'm not overlooking a more convenient method.
Regards,
Kaufman
Hello all
we are seeing these kind of logs in a Debian GNU/Linux 11 using kamailio
5.5.6
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155702]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:164.152.22.248:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155698]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155695]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.181:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155693]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:38.102.250.60:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:87.1.1.27:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [ut.h:302]: uri2dst2(): no corresponding socket for "87.1.1.27"
af 2
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [t_fwd.c:470]: prepare_new_uac(): can't fwd to af 2, proto 1 (no
corresponding listening socket)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155697]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155694]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:192.40.216.97:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155694]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.180:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155714]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:87.1.1.27:5060)
The kamailio instance we are using is receiving around 1500 calls per
second in average when we do start seeing these errors more frequently
In this instance we are using multihomed
the listen address list is
children=14
socket_workers=1
listen=udp:192.168.99.70:5081
listen=udp:192.168.99.81:5060
listen=udp:87.1.1.27:5060
listen=tcp:192.168.96.105:8095
listen=tcp:87.1.1.27:5060
tcp_children=6
port=5060
We use the first worker only to perform the OPTIONS requests from the
dispatcher module.
The sockets
listen=udp:192.168.99.81:5060
listen=udp:87.1.1.27:5060
are used to communicate both A and B legs
so when a message is received at 192.168.99.81:5060 we send it to
87.1.1.27:5060 and viceversa
We were using $fs variable before doing the t_relay() function.
This way is working, but when load increases, seems sometimes kamailio
doesn't get the proper socket to forward the reply.
I think the errors mainly are related to responses which are being
forwarded, like if the function get_sock_info_list was not able to retrieve
the listen interfaces
we have tried to set in the onreply routes the commands
set_recv_socket("udp:192.168.99.81:5060");
set_send_socket("udp:87.1.1.27:5060"); (when reply goes from private to
public domain)
and it seems it reduces the number of
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155702]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:164.152.22.248:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155698]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155695]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.181:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155693]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:38.102.250.60:5060)
errors
But i honestly don't know why the
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [ut.h:302]: uri2dst2(): no corresponding socket for "87.1.1.27"
af 2
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [t_fwd.c:470]: prepare_new_uac(): can't fwd to af 2, proto 1 (no
corresponding listening socket)
appear
We aldso tried to increase the kernel buffers rmem and wmem from 208KB (as
we had by default) to 4MB
Do you know a reason which could cause these logs to appear?
Any setup that could mitigate them?
thanks a lot and regards
david escartin
--
<http://www.sonoc.io/>
David Escartín
NOC engineer
www.sonoc.io
[image: LinkedIn] <https://www.linkedin.com/company/sonoc>
[image: Twitter] <https://twitter.com/sonoc_>
[image: Instagram] <https://www.instagram.com/sonoc.io/>
This e-mail is for the exclusive use of its recipients and may contain
business secrets or other confidential or privileged information. Any
unauthorised use, copying, publication or distribution of this e-mail is
strictly prohibited. If you are not the intended recipient, please inform
us immediately by replying to this e-mail and delete it, including any
attachments or copies on your system.
In accordance with the GDPR (EU) 2016/679 and the LOPDGDD 3/2018, we inform
you that this e-mail address and/or any other personal data you have
provided us with will be treated by SONOC with absolute confidentiality and
with the only purpose of providing you with the requested services, due to
your condition as a client, supplier or because you have requested
information from us at any time. These data will only be kept for as long
as required to comply with legal obligations. You can exercise your rights
at any time by sending an e-mail to: dataprotection(a)sonoc.io.
<dataprotection(a)sonoc.io>
Hello all
we are seeing these kind of logs in a Debian GNU/Linux 11 using kamailio
5.5.6
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155702]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:164.152.22.248:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155698]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155695]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.181:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155693]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:38.102.250.60:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:87.1.1.27:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [ut.h:302]: uri2dst2(): no corresponding socket for "87.1.1.27"
af 2
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [t_fwd.c:470]: prepare_new_uac(): can't fwd to af 2, proto 1 (no
corresponding listening socket)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155697]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155694]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:192.40.216.97:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155694]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.180:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155714]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:87.1.1.27:5060)
The kamailio instance we are using is receiving around 1500 calls per
second in average when we do start seeing these errors more frequently
In this instance we are using multihomed
the listen address list is
children=14
socket_workers=1
listen=udp:192.168.99.70:5081
listen=udp:192.168.99.81:5060
listen=udp:87.1.1.27:5060
listen=tcp:192.168.96.105:8095
listen=tcp:87.1.1.27:5060
tcp_children=6
port=5060
We use the first worker only to perform the OPTIONS requests from the
dispatcher module.
The sockets
listen=udp:192.168.99.81:5060
listen=udp:87.1.1.27:5060
are used to communicate both A and B legs
so when a message is received at 192.168.99.81:5060 we send it to
87.1.1.27:5060 and viceversa
We were using $fs variable before doing the t_relay() function.
This way is working, but when load increases, seems sometimes kamailio
doesn't get the proper socket to forward the reply.
I think the errors mainly are related to responses which are being
forwarded, like if the function get_sock_info_list was not able to retrieve
the listen interfaces
we have tried to set in the onreply routes the commands
set_recv_socket("udp:192.168.99.81:5060");
set_send_socket("udp:87.1.1.27:5060"); (when reply goes from private to
public domain)
and it seems it reduces the number of
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155702]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:164.152.22.248:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155698]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.184:5060)
Sep 21 17:41:13 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155695]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:208.74.138.181:5060)
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155693]:
ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding
socket found for(udp:38.102.250.60:5060)
errors
But i honestly don't know why the
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [ut.h:302]: uri2dst2(): no corresponding socket for "87.1.1.27"
af 2
Sep 21 17:41:14 lax-dedge-1 /usr/local/kamailio/sbin/kamailio[3155707]:
ERROR: tm [t_fwd.c:470]: prepare_new_uac(): can't fwd to af 2, proto 1 (no
corresponding listening socket)
appear
We aldso tried to increase the kernel buffers rmem and wmem from 208KB (as
we had by default) to 4MB
Do you know a reason which could cause these logs to appear?
Any setup that could mitigate them?
thanks a lot and regards
david escartin
--
<http://www.sonoc.io/>
David Escartín
NOC engineer
www.sonoc.io
[image: LinkedIn] <https://www.linkedin.com/company/sonoc>
[image: Twitter] <https://twitter.com/sonoc_>
[image: Instagram] <https://www.instagram.com/sonoc.io/>
This e-mail is for the exclusive use of its recipients and may contain
business secrets or other confidential or privileged information. Any
unauthorised use, copying, publication or distribution of this e-mail is
strictly prohibited. If you are not the intended recipient, please inform
us immediately by replying to this e-mail and delete it, including any
attachments or copies on your system.
In accordance with the GDPR (EU) 2016/679 and the LOPDGDD 3/2018, we inform
you that this e-mail address and/or any other personal data you have
provided us with will be treated by SONOC with absolute confidentiality and
with the only purpose of providing you with the requested services, due to
your condition as a client, supplier or because you have requested
information from us at any time. These data will only be kept for as long
as required to comply with legal obligations. You can exercise your rights
at any time by sending an e-mail to: dataprotection(a)sonoc.io.
<dataprotection(a)sonoc.io>