Hi Gang
I have a observation which I don't understand...
Let's assume we have an inbound $rU = 12345
And I want to change $rU outbound to 0012345
Doing:
$rU = "0012345";
ds_select_dst("2000"),"6");
route(RELAY)
The call is being sent out with unaltered R-URI Username: 12345
Doing:
$rU = "0012345";
ds_select_domain("2000", "6");
route(RELAY);
The call is being sent out with the intended new R-URI Username: 0012345
Looking at the docs:
https://kamailio.org/docs/modules/5.4.x/modules/dispatcher.html#dispatcher.…
I can not figure out, why I see this difference.
--
Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
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,
We're attempting to implement a mid-registrar for websocket connections but
are running into some issues where the tcpconn-id and socket attributes are
not stored correctly in memory (usrloc).
REGISTER Flow: UA1 -> P1 (Mid-Registrar) ~> P2 (Core Proxy/Registrar)
INVITE Flow: UA2 -> P2 -> P1 -> UA1
UA1: baresip cli connecting to P1 using websockets
UA2: softphone
Everything is running locally on a dev machine, and we're using Docker to
launch P1 and P2.
The below code snippet is what we use on P1, and has been simplified.
The general idea is as following:
1) UA1 sets up the websocket connection and sends a REGISTER request to P1
2) P1 checks if this request has already been sent to P2
2.a) If not, then relay the request to P2. Upon receiving a 200 OK from
P2 we save the registration in usrloc
2.b) If so, then absorb the request (save) and generate a reply
3) UA2 tries to call UA1 via P1 and P2
The problem occurs at 2.a since the REGISTER request is forwarded using UDP
and the 200 OK is also received using UDP.
When the registration is stored in reply route, the Socket
(udp:x.x.x.x:xxxx) and Tcpconn-Id (-1) are not set to what we would prefer
(see Output 1)
TCP was also tried as the transport between P1 and P2. Upon receiving the
reply from P2 the Tcpconn-Id and Socket of the connection between P1 and P2
was saved in the binding.
When 2.b occurs the Socket and Tcpconn-Id are set to the correct values
(see Output 2)
Making a call when the binding state is at 2.a we receive the following
error: "TCP/TLS connection (id: 0) for WebSocket could not be found"
Making a call when the binding state is at 2.b works perfectly fine since
the correct Tcpconn-Id is set.
We did find a solution, or rather a workaround to this issue:
1) Always call the save function in request_route
2) If P2 responds with an error (non-200 OK) use the unregister function to
remove the binding
We also tried the tcpops tcp_set_otcpid and tcp_set_otcpid_flag functions
after lookup, but this didn't do anything.
KEMI Script
def ksr_request_route(self, msg):
if kemi.is_REGISTER():
aor = "aor"
if result := kemi.htable.sht_is_null("registrations", aor) == 1:
kemi.tm.t_on_reply("ksr_register_reply_route")
kemi.dispatcher.ds_select_dst(1, 4)
kemi.tm.t_relay()
return 1
kemi.registrar.save("registrations", 1)
return 1
if kemi.is_INVITE():
aor = "aor"
if result := kemi.registrar.lookup_uri("registrations", aor):
kemi.tm.t_relay()
return 1
def ksr_register_reply_route(self, msg):
if kemi.tm.t_check_status("200") == 1:
kemi.registrar.save("registrations", 1)
aor = "aor"
kemi.htable.sht_sets("registrations", aor, "")
return 1
Output 1: Binding state when request is being forwarded
kamcmd ul.dump
{
Domains: {
Domain: {
Domain: registrations
Size: 1024
AoRs: {
Info: {
AoR: grant(a)127.0.0.1
HashID: 409622189
Contacts: {
Contact: {
Address: sip:grant-0x7fe915a79138@172.16.99.12:9;transport=ws
Expires: 13
Q: 1.000000
Call-ID: 7cdfbf93f23bb54f
CSeq: 34818
User-Agent: n/a
Received: sip:192.168.80.1:62184;transport=ws
Path: [not set]
State: CS_NEW
Flags: 1
CFlags: 20
Socket: udp:10.2.0.15:5060
Methods: -1
Ruid: uloc-626a80d3-46-1
Instance: <urn:uuid:c67df38d-d5e0-e834-1d98-a8df2d3f291b>
Reg-Id: 0
Server-Id: 0
Tcpconn-Id: -1
Keepalive: 0
Last-Keepalive: 1651146965
KA-Roundtrip: 0
Last-Modified: 1651146965
}
}
}
}
Stats: {
Records: 1
Max-Slots: 1
}
}
}
}
kamcmd core.tcp_list
{
id: 1
type: WS
state: CONN_OK
timeout: 2
lifetime: 120
ref_count: 2
src_ip: 192.168.80.1
src_port: 62184
dst_ip: 192.168.80.15
dst_port: 80
}
kamcmd ws.dump
{
connections: {
1: ws:192.168.80.1:62184 -> ws:192.168.80.15:80 (state: OPEN, last used 3s
ago, sub-protocol: sip)
}
info: {
wscounter: 1
truncated: no
}
}
Output 2: Binding state when request is being absorbed
kamcmd ul.dump
{
Domains: {
Domain: {
Domain: registrations
Size: 1024
AoRs: {
Info: {
AoR: grant(a)127.0.0.1
HashID: 409622189
Contacts: {
Contact: {
Address: sip:grant-0x7fe915a79138@172.16.99.12:9;transport=ws
Expires: 9
Q: 1.000000
Call-ID: 7cdfbf93f23bb54f
CSeq: 34819
User-Agent: baresip v2.0.2 (x86_64/darwin)
Received: sip:192.168.80.1:62184;transport=ws
Path: [not set]
State: CS_NEW
Flags: 1
CFlags: 20
Socket: tcp:192.168.80.15:80
Methods: 5087
Ruid: uloc-626a80d3-46-1
Instance: <urn:uuid:c67df38d-d5e0-e834-1d98-a8df2d3f291b>
Reg-Id: 0
Server-Id: 0
Tcpconn-Id: 1
Keepalive: 0
Last-Keepalive: 1651146979
KA-Roundtrip: 0
Last-Modified: 1651146979
}
}
}
}
Stats: {
Records: 1
Max-Slots: 1
}
}
}
}
kamcmd core.tcp_list
{
id: 1
type: WS
state: CONN_OK
timeout: 3
lifetime: 120
ref_count: 2
src_ip: 192.168.80.1
src_port: 62184
dst_ip: 192.168.80.15
dst_port: 80
}
kamcmd ws.dump
{
connections: {
1: ws:192.168.80.1:62184 -> ws:192.168.80.15:80 (state: OPEN, last used 1s
ago, sub-protocol: sip)
}
info: {
wscounter: 1
truncated: no
}
}
Hi kamailiers,
I ask your help for a strange situation with topos, 183 (before a 200OK)
and SIP INFO
My topology is kamailio in front of asterisks; so kamailio has 2 interfaces
(1Public to talk with customers and carriers and 1 Private to talk with
asterisk).
In the image:
- the first column is the customer
- the second is the public interface of kamailio
- the third is the private interface of kamaiio
- the fourth is asterisk
As you can see in the image, the customer send an INVITE and the carrier
give back the IVR messages in a 183 (before a 200OK) asking for an IVR
selection.
The customer (configured to use SIP INFO) types a key and sends in INFO,
but as you can see kamailio sends the INFO to himself to private interface
instead of sending it to asterisk as if the contact that handled topos
contained incorrect information.
[image: Schermata 2022-04-26 alle 19.40.32.png]
- If the customer is configured with a RFC2833
- or if the IVR messages is not in a 183 but is sent after a 200OK
- or if I disabe TOPOS
*all works fine*
I used kamailio 5.5.3, I also try to upgrade to 5.5.4 but nothing change
Maybe could be connected with
https://github.com/kamailio/kamailio/issues/2344https://github.com/kamailio/kamailio/issues/1077
Could be a kamailio bug for this particular situation or am I getting lost
in a glass of water?
thanks a lot
cheers
Giovanni Tommasini
*evoseed s.r.l.*
phone: +39 340 11 28 800
mail: giovanni.tommasini(a)evoseed.io
site: evoseed.io
address: Via Lucrezio 13, Trieste Italy
Hallo all,
I would need help with Kamailio. I hope, you can give me some hints.
I would like use Kamailio for CFNRy feature call forward no replay, i.e.
- call is forked to multiple destination
- 180 is received, call is ringing, but not answered, no 200 OK is received
from destinations
- after predefined time (CFNRy timer), the specific branch has to be
rerouted to another destination
Expected behaviour is described in this flow:
[image: image.png]
My current behavior:
- Kamailio TM module is involved for parallel forking (
https://www.kamailio.org/docs/modules/stable/modules/tm.html#:~:text=1.-,Ov…
)
- all branches are CANCEL-ed, it is not possible send CANCEL just to one
specific branch
[image: image.png]
My questions:
- is it possible to CANCEL just specific branch of parallel forked calls?
- is it possible start timer just for specific branch?
- do you think is it possible implement this feature with Kamailio?
Thanks a lot in advance for any comments.
Pavel.
Hello.
Kamailio 5.2.1, Debian 10.
I need to change session name (s=) in SDP before relaying it to next hop,
and for unknown reason I can't do it with virtually any TEXTOPS function,
everything replace*, subst*, *body*... For example this from TEXTOPS
documentation:
subst_body('/^s=(.*)/s=root/')
just before 'final' t_relay().
Either Kamailio just adds "s=root" to SDP leaving first "s=" intact, or
adds just "root", or does nothing.
Also I've tried msg_apply_changes() before and after these manipulations,
still no result.
Is it possible to make this in Kamailio without source code modification?
Hello! I have kamailio 5.5 configured with digest authentication.
DB Mysql, 2 rtpengine one on the same server with kamailio, the other is separate.
Rtpengins work in bridge mode, internal/external/external-ipV6.
Kamailio listen 3 address: internal/external/external-ipV6 work in mixed mode: ipV4-ipV4, ipV4-ipV6, ipV6-ipV6.
OS Debian 10, CPU 1 core, Ram 4gb, Disk not ssd.
internal address is used for the gateway model of the connection to the PSTN. Before sending a call to PSTN, a request is sent to Billing by Diameter (request over the network, ims_charging ), Billing responds in the region of 10-17 milliseconds. usrloc db_mode = 0; UAS contacts are received according to the PUSH scheme (we send PUSH via http and get a REGISTER). children = 8 for each;
When running synthetic tests with sipp, I get 36 cps as a maximum, but there are a lot of retrans.
This is a test environment.
Product:
I plan to get 100 cps; 20k concurrent calls, hardware will be 128GB RAM ddr4-2400; Intel Xeon Silver 4216, Optane SSD. 2 such servers, kamailio/rtpengine are configured exactly according to the scheme of the test environment.
Question:
Can you please tell me how many children, shm/pv do I need?
Is it worth going in the direction of asynchrony, or is the standard one enough for my purpose?
I will be very glad for any help.
Thank you!
--
Отправлено из Mail.ru для Android
Hi,
Intermittently we are observing the following error when checking if given
header is present in SIP INVITE:
SystemError: returned a result with an error set
The complete stack trace is (some names redacted):
11(28) ERROR: {1 195 INVITE nMHZDN.10nOIDt4ldOwz5cqz0XnMepA9} app_python3
[python_support.c:156]: python_handle_exception(): apy_exec:
modify_headers((null)): Unhandled exception in the Python code:
TypeError: an integer is required (got type NoneType)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/etc/kamailio/kamailio.py", line 25, in modify_headers
self.modify_header("SomeHeader")
File "/etc/kamailio/kamailio.py", line 29, in modify_header
present = KSR.hdr.is_present(header_name)
SystemError: returned a result with an error set
Kamailio version (kamailio -v output):
version: kamailio 5.4.6 (x86_64/linux)
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_BLACKLIST,
HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024,
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 8.3.0
Operation system: Linux kamailio-5c7484c74d-vhhr8 5.4.0-1056-azure
#58~18.04.1-Ubuntu SMP Wed Jul 28 23:14:18 UTC 2021 x86_64 GNU/Linux
Are you able to help me find the root cause of this issue?
Pozdrawiam / Best regards,
Wojtek
--
*For more information on how and why we collect your personal
information, please visit our Privacy Policy
<https://www.motorolasolutions.com/en_us/about/privacy-policy.html?elqTrackI…>.*
Hello,
I am trying to implement scenario described in this thread
by Daniel-Constantin Mierla.
I am able to cache registration using save but i am not able to handle
unregistration.
Unregister function of registrar module is not available in onreply routes
and I cannot unregister until upstream registrar returns 200 OK on Expire 0
message.
Is there any workaround to fix this?
Thanks,