Hi
I've an issue with serial call forking and I hope somebody can help me...
What I'm trying to reach:
We are using Kamailio in a dynamic network with multiple nodes. The
dialplan is implemented using the KEMI interface. The call routing is
completely dynamic. At the moment, we are having call groups, which may
contain 1 or more recipients. If the number of this call group is called,
Kamailio is doing a parallel forking to all group participants. Now I'm
trying to extend the feature, that if nobody hooks up, the call is
forwarded to another number. This has been implemented with serial forking.
So the dialplan adds branches for all call group members with a q value of
1 and the last branch is the failover number with a lower q value. The
branching and failure route works fine.
The problem:
* I have a call group (G Bob 900101), with one participant (Bob 200102).
* The group has a fail over number (if Bob doesn't hook up), which points
again to Bob. I know that this use case doesn't make much sense, but it has
been simplified to show the problem. The failover number can be anything
also another call group which may contain one or more recipients from the
first group again.
* Alice (200101) calls the call group
* The first node (10.0.1.1/10.64.0.1) receives the call and forks it to
branch 1 Bob (202102) with q value 1.0 and to a second branch Bob (202102)
with q value 0.5. fr_timer is set to 10s
* The call is forwarded to node 2 (10.0.2.1/10.64.0.2), where Bob is
registered.
* The call is forwarded to Bobs device (Grandstream GXV3350) and the phone
is ringing.
* After 10s, the first node detects the 408 Request Timeout and switches to
the second branch
* The invite is sent to node 2 and Bobs device again.
* Node 1 also sends a CANCEL to node 2 and Bobs device for the first branch.
* The call in Bobs device is terminated
* Now the problem, the device does not react to the second INVITE. And
after the fr_inv_timer expires, the call is terminated with a 408 Request
Timeout.
I can see that the second INVITE contains another branch ID <ID>.1 compared
to the first INVITE, which had <ID>.0. The CANCEL is also sent with <ID>.0.
I've also tried with a Cisco 8861 3PCC and it doesn't work either. Compared
to the Grandstream, the Cisco device returns an error 500 upon the second
INVITE. Since both devices do not accept what I'm trying, I guess I'm doing
something wrong...
At the moment I'm a bit lost, what the problem could be.
Does somebody have an idea what it is and how I could solve it?
Following two SIP dumps from node 1 and node 2:
Node 1:
|Time | 10.0.1.128 | 10.64.0.1
|
| | | 10.0.1.1 | |
10.0.2.1 |
|2024-01-31 14:17:07.792784| INVITE SDP (g711A g7 |
| |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061>
Call-ID:2102072978-5060-296@BA.A.B.BCI CSeq:2950
| |(47276) ------------------> (5061) | |
|
|2024-01-31 14:17:07.793060| 407 Proxy Authentica |
| |SIP Status 407 Proxy Authentication
Required
| |(47276) <------------------ (5061) | |
|
|2024-01-31 14:17:07.796613| ACK | |
| |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2950
| |(47276) ------------------> (5061) | |
|
|2024-01-31 14:17:07.799045| INVITE SDP (g711A g7 |
| |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061>
Call-ID:2102072978-5060-296@BA.A.B.BCI CSeq:2951
| |(47276) ------------------> (5061) | |
|
|2024-01-31 14:17:07.836471| 100 trying -- your c |
| |SIP Status 100 trying -- your call is
important to us
| |(47276) <------------------ (5061) | |
|
|2024-01-31 14:17:07.865219| | |
INVITE SDP (g711A g7 |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5061) |
|2024-01-31 14:17:08.036334| | |
100 trying -- your c |SIP Status 100 trying -- your call is
important to us
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:08.084421| | |
180 Ringing |SIP Status 180 Ringing
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:08.096834| 180 Ringing |
| |SIP Status 180 Ringing
| |(47276) <------------------ (5061) | |
|
|2024-01-31 14:17:18.099644| | |
INVITE SDP (g711A g7 |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5061) |
|2024-01-31 14:17:18.100099| | |
CANCEL | |SIP CANCEL From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5061) |
|2024-01-31 14:17:18.259375| | |
100 trying -- your c |SIP Status 100 trying -- your call is
important to us
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:18.274841| | |
200 canceling |SIP Status 200 canceling
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:18.296942| | |
487 Request Terminat |SIP Status 487 Request Terminated
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:18.298630| | |
ACK | |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5061) |
|2024-01-31 14:17:20.281602| | |
408 Request Timeout |SIP Status 408 Request Timeout
| | | |(5061)
<------------------ (5061) |
|2024-01-31 14:17:20.283433| | |
ACK | |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5061) |
|2024-01-31 14:17:20.307343| 408 Request Timeout |
| |SIP Status 408 Request Timeout
| |(47276) <------------------ (5061) | |
|
|2024-01-31 14:17:20.309097| ACK | |
| |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:<sips:900101@10.0.1.1:5061> CSeq:2951
| |(47276) ------------------> (5061) | |
|
Node 2:
|Time | 10.64.0.1 | 10.64.0.2
|
| | | 10.0.2.1 | |
10.0.2.128 |
|2024-01-31 14:17:07.869305| INVITE SDP (g711A g7 |
| |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061>
Call-ID:2102072978-5060-296@BA.A.B.BCI CSeq:2951
| |(54454) ------------------> (5061) | |
|
|2024-01-31 14:17:08.036009| 100 trying -- your c |
| |SIP Status 100 trying -- your call is
important to us
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:08.050848| | |
INVITE SDP (g711A g7 |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5060) |
|2024-01-31 14:17:08.054357| | 100 Trying|
| |SIP Status 100 Trying
| | |(5061)
<-------------------------------------- (5060) |
|2024-01-31 14:17:08.075422| | 180 Ringing
| |SIP Status 180 Ringing
| | |(5061)
<-------------------------------------- (5060) |
|2024-01-31 14:17:08.083887| 180 Ringing |
| |SIP Status 180 Ringing
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:18.100359| INVITE SDP (g711A g7 |
| |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061>
Call-ID:2102072978-5060-296@BA.A.B.BCI CSeq:2951
| |(54454) ------------------> (5061) | |
|
|2024-01-31 14:17:18.258947| 100 trying -- your c |
| |SIP Status 100 trying -- your call is
important to us
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:18.273819| | |
INVITE SDP (g711A g7 |SIP INVITE From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5060) |
|2024-01-31 14:17:18.274460| CANCEL | |
| |SIP Request CANCEL CSeq:2951
| |(54454) ------------------> (5061) | |
|
|2024-01-31 14:17:18.274550| | |
CANCEL | |SIP CANCEL From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5060) |
|2024-01-31 14:17:18.274615| 200 canceling |
| |SIP Status 200 canceling
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:18.277438| | 200 OK |
| |SIP Status 200 OK
| | |(5061)
<-------------------------------------- (5060) |
|2024-01-31 14:17:18.279335| | 487 Request
Terminated | |SIP Status 487 Request Terminated
| | |(5061)
<-------------------------------------- (5060) |
|2024-01-31 14:17:18.280785| | |
ACK | |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| | | |(5061)
------------------> (5060) |
|2024-01-31 14:17:18.296312| 487 Request Terminat |
| |SIP Status 487 Request Terminated
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:18.298900| ACK | |
| |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| |(54454) ------------------> (5061) | |
|
|2024-01-31 14:17:20.280965| 408 Request Timeout |
| |SIP Status 408 Request Timeout
| |(5061) <------------------ (5061) | |
|
|2024-01-31 14:17:20.283730| ACK | |
| |SIP ACK From: "Alice" <
sips:200101@10.0.1.1:5061> To:"Bob" <sips:900101@10.0.1.1:5061> CSeq:2951
| |(54454) ------------------> (5061) | |
|
At the moment, I'm using Kamailio 5.5.4, but I also did a short try with a
newer version (I guess it was 5.7.4). Both versions showed the same issue.
Best regards
Mathias
Hello,
We have a production Kamailio 5.2.7 server which has suddenly started
reporting spikes in the shared memory use. When looking into this, we
noticed that at the same time as the memory spikes Kamailio also logs a
huge amount of errors like the following.
Can anyone help with an explanation for what's going on? The xx.xx.52.202
address is the Kamailio server itself. We record historical numbers of
network connections for the server overall, and that doesn't show any
increase in the number of TCP connections, either at the time of the spikes
or as a general trend.
Thanks in advance!
Apr 26 09:23:16 vpbx11 /sbin/kamailio[44272]: ERROR: <core>
[core/tcp_main.c:2703]: tcpconn_1st_send(): connect xx.xx.52.202:42726
failed (RST) Connection refused
Apr 26 09:23:16 vpbx11 /sbin/kamailio[44272]: ERROR: <core>
[core/tcp_main.c:2711]: tcpconn_1st_send(): xx.xx.52.202:42726: connect &
send for 0x14bbf44c9f40 failed: Connection refused (111)
Apr 26 09:23:16 vpbx11 /sbin/kamailio[44272]: ERROR: tm
[../../core/forward.h:293]: msg_send_buffer(): tcp_send failed
Apr 26 09:23:16 vpbx11 /sbin/kamailio[44272]: WARNING: <core>
[core/tcp_main.c:1149]: tcp_do_connect(): xx.xx.52.202:42726: could not
find corresponding listening socket for xx.xx.52.202, using default...
--
David Cunningham, Voisonics Limited
http://voisonics.com/
USA: +1 213 221 1092
New Zealand: +64 (0)28 2558 3782
Hello,
Just to confirm, as I quickly checked into a code of 5.8.x branch, there
were no modification on app_python3 module to comply with tls_threads_mode
mechanism?
Asking this beforehand posting a bug, that if using a quite simple script
into module, with tls_threads_mode = 2 Kamailio just hangs at the start and
become unresponsive.
And by simple I mean something like this
class PyKamailio:
def __init__(self):
self.test = 1
def child_init(self, rank):
"""Executed by app_python module when a new worker process (child)
is initialized by Kamailio."""
return 1
def mod_init():
""" Executed by app_python module when it is initialized by Kamailio."""
return PyKamailio()
with tls_threads_mode = 1 and 3 it loads, but if add some HTTPS calls
inside the script (even not the calls, but importing the methods, that are
making calls with import), it just start failing on TLS load, despite that
on packets processed (OPTIONS) no python_exec() is called, just from the
fact of having HTTPS calls into Python script.
--
Best regards,
Ihor (Igor)
Hello Everyone
I am using kamailio with RTP engine for wss to udp to connect my asterisk
server. It all works well like wss to UDP registration via kamailio to
asterisk. Here I am facing an issue with call hold i.e if I hold the call
from B leg it gets disconnected.
Any advice why it get failed and hangups
Thanks
Hello,,
I am using this docker file for installaing kamailio. I wana use it with open5gs for trynig VoNR , I used before it for VoLTE it works but right now I have this error in installation process.
icscf | 0(34) ERROR: <core> [core/sr_module.c:527]: ksr_locate_module(): could not find module <maxfwd> in </usr/lib64/kamailio/modules_k/:/usr/ lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/ modules>
icscf | 0(34) CRITICAL: <core> [core/cfg.y:4008]: yyerror_at(): parse error in config file /etc/kamailio_icscf/kamailio_icscf.cfg, line 94, colu mn 12-19: failed to load module
scscf | 0(38) ERROR: <core> [core/sr_module.c:527]: ksr_locate_module(): could not find module <maxfwd> in </usr/lib64/kamailio/modules_k/:/usr/ lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/:/usr/lib/x86_64-linux-gnu/kamailio/modules/:/usr/local/lib64/kamailio/
and there is docker file that Im using:
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
# Install updates and dependencies
RUN apt-get update && \
apt-get -y install mysql-server tcpdump screen tmux ntp ntpdate git-core dkms \
gcc flex bison libmysqlclient-dev make libssl-dev libcurl4-openssl-dev \
libxml2-dev libpcre2-dev bash-completion g++ autoconf libmnl-dev \
libsctp-dev libradcli-dev libradcli4 libjson-c-dev pkg-config iproute2 net-tools \
iputils-ping
# Fetch Kamailio code (branch 5.3)
RUN mkdir -p /usr/local/src/ && cd /usr/local/src/ && \
git clone https://github.com/kamailio/kamailio && \
cd kamailio && git checkout 5.8
# Build and Install Kamailio
RUN cd /usr/local/src/kamailio && make cfg
COPY modules.lst /usr/local/src/kamailio/src
RUN cd /usr/local/src/kamailio && \
make -j`nproc` Q=0 all | tee make_all.txt && \
make install | tee make_install.txt && \
ldconfig
COPY kamailio_init.sh /
CMD /kamailio_init.sh
Hi Gang
Somehow I don't get my head around NAT Flags and the nathelper module
https://www.kamailio.org/docs/modules/5.7.x/modules/nathelper.html
In the examples I found, there is: FLT_NATS and FLB_NATB
If I got it right, FLB_NATB is a branch flag, which shall indicate that
the device is 'B'ehind NAT, right?
It is being set, when FLT_NATS is set:
if(isflagset(FLT_NATS)) {
setbflag(FLB_NATB);
}
But when should FLT_NATS be set and what is it's meaning? The examples I
found don't tell me this.
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
______________________________________________________
Hi everyone,
New user who is trying to make an outbound proxy to route a lot of freepbx
boxes for outbound calls.
I got this setup and working using dsiprouter. Calls come in from freepbx
trunk using outbound proxy, authenticated using IP auth, and then gets
signed with our stirshaken cert, then routes out to our carriers.
Interested in using plain kamailio. Got everything compiled and
libstirshaken compiled.
Just wanted to see if someone could point me in the right direction for the
cfg file.
I assume I would match how I have it in dsiprouter. That config has a lot
of things I'm not using and having a hard time deciphering it.
My thoughts on what I need:
MySQL database. Have a table for ip auth, a table for voice carriers, and
a table for 911 carriers.
Invite comes in, it checks ip auth table and responds with 403 if it's not
on the list. If it is, proceed to stir shaken signing, and then route the
call? I assume I will need to have some logic to tell voice calls and
emergency calls.
I got plain old routing/forwarding working and now want to focus on locking
it down.
Any thoughts, examples configs, anything would be awesome.
I am hoping to get this working and then having a primary/standby or even
load balancing them but im in the very early stages of trying to get my
head around Kamailio.
Thanks for any insights!
Hi List
I have stumbled over this challenge:
I have a kamailio server without dialog module. Only tmx module, acting
as registrar / rtpengine host.
If the call is routed over that server once, this works fine.
If the call is routed more than once (call from one location to another
on same registrar, call forwarding) then to correctly work, I would need
to engage rtpengine in a way to tell rtpengine to handle both call legs
separately.
By default, rtpengine identifies one call by Call-ID,FromTag,ToTag so
it considers all invocations to target one instance and on the 2nd
invocations it replaces the source rtp ip by it's own ip killing audio.
Using 'loop-protect' to prevent the 2nd invocation 'sort-of' works, but
not cleanly if I use different 'private' ip ranges on my voice core and
IC network to which CPE should not talk.
It is possible to pass a custom Call-ID to rtpengine. So this is how I
am considering finding a solution.
When passing the call-id to rtpengine I could append a leg identifier
to that call-id.
like $avp(rtp-callid) = $ci + $var(leg-id)
How could I reliably generate this leg-id / tell the legs apart?
Consider this situation:
leg 1 leg 2
CPE-A => Kam-Reg => Routing Core => Kam-Reg => CPE-B
Also I wonder if I can use an AVP at all? From Kamailio's Point of
view, the first invite being routed twice could be the same transaction
with same shared AVP, right?
Is there a way to pass some information via flags appended route-header?
Or maybe use the count of via or route header to tell the legs apart?
Any ideas very appreciated.
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
______________________________________________________
Hi,
I see the documentation for the sqlite module includes a parameter to
set the journal_mode to wal, but I don't see any way to set
synchronous=normal. Is there a way to run arbitrary PRAGMA statements
upon opening the file or would I have to run it before each query?
Hi everyone,
Here is my setup
SIP Client (MacBook) <=> Kamailio (AWS) <=> Freeswitch (AWS)
When I initiate a call from Client, audio won't be sent out, but the client
can receive audio. (When the client receives the call everything works
fine). I started to trace the SIP message using tdpdump. And here is an
interesting thing.
Kamailio sends the following SDP message while sending 200 OK
v=0
o=FreeSWITCH 1714278184 1714278185 IN IP4 *<freeswitch-ip-address>*
s=FreeSWITCH
c=IN IP4 *<freeswitch-ip-address>*
t=0 0
m=audio 27644 RTP/AVP 120 101
a=rtpmap:120 opus/48000/2
a=fmtp:120 useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
But on my computer where SIP client is running I receive following message
v=0
o=FreeSWITCH 1714278184 1714278185 IN IP4 *<kamailio-ip-address>*
s=FreeSWITCH
c=IN IP4 *<kamailio-ip-address>*
t=0 0
m=audio 27644 RTP/AVP 120 101
a=rtpmap:120 opus/48000/2
a=fmtp:120 useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
Somehow, somewhere, somebody is modifying the IP address in the SDP
message, hence the SIP client is sending audio to "Kamailio" instead of
"Freeswitch" server.
My initial guess was my router might be modifying it. After checking the
router settings I found SIP ALG is enabled. I disabled it, yet no use.
I changed my internet connection to a different provider and things started
working. SDP is not getting modified.
Have you ever faced such an issue where someone/something is modifying the
SDP messages. How did you debug to figure out which component was modifying
it? And common fixes for such weird situations?
Thanks and Regards,
Pavan Kumar