Hi all,
Got another anomaly in 4.1.5. I have this block of code which does
t_relay_tcp:
if ($var(isTpgw) == 1)
{
xlog("L_INFO","[$ci][$mi][CSeq $cs] isTpgw = $var(isTpgw)");
if (!t_relay_to_tcp())
{
xlog("L_INFO","[$ci][$mi][CSeq $cs] $ua Relaying
[$rm] from ($si) to ($rd) via tcp....Error...\n");
t_on_failure("DISPATCHER_FAIL");
}
else
{
xlog("L_INFO","[$ci][$mi][CSeq $cs] $ua Relaying
[$rm] from ($si) to ($rd) via tcp\n");
}
}
But when I looked at my sip capture tool, it showed the Via marked by the
Kam to use UDP:
INVITE sip:######@<some domain>:5060 SIP/2.0
Record-Route: <sip:206.81.191.30;r2=on;lr=on>
Record-Route: <sip:206.81.191.30;transport=tcp;r2=on;lr=on>
Call-ID: DL9dc0c8dd93-1079779342(a)gs-3924.GSLAB.COM
To: "sip:6204857@sjomaintpsg50.fuzemeeting.com"
<sip:6204857@sjomaintpsg50.fuzemeeting.com>
From: "LifesizeSIP"
<sip:LifesizeSIP@gs-3924.GSLAB.COM:5060>;tag=DL325a9e10c7;epid=062EE468
CSeq: 1 INVITE
Max-Forwards: 69
Via: SIP/2.0/UDP
206.81.191.30;branch=z9hG4bKb16b.bd6a0791c798e3c859f8608993d584ae.1;i=5611
Via: SIP/2.0/TCP 10.101.199.105:5060;rport=53272;branch=z9hG4bK-fc8090ecf8-DL
206.81.191.30 is the Kam.
I also log the activity as seen in the code with those xlog:
Apr 11 19:38:37 sjomaintpsg50 /usr/local/sbin/kamailio[16348]: INFO:
<script>: [DL9dc0c8dd93-1079779342(a)gs-3924.GSLAB.COM][42][CSeq 1] isTpgw = 1
Apr 11 19:38:37 sjomaintpsg50 /usr/local/sbin/kamailio[16348]: INFO:
<script>: [DL9dc0c8dd93-1079779342(a)gs-3924.GSLAB.COM][42][CSeq 1] LifeSize
Softphone 8.1.12 (Windows) Relaying [INVITE] from (10.101.19
9.105) to (206.81.191.72) via tcp
So why did the Kamailio mark the Via header on the outgoing INVITE UDP?
--
Andy Chen
Sr. Telephony Lead Engineer
achen@ <achen(a)thinkingphones.com>fuze.com
--
*Confidentiality Notice: The information contained in this e-mail and any
attachments may be confidential. If you are not an intended recipient, you
are hereby notified that any dissemination, distribution or copying of this
e-mail is strictly prohibited. If you have received this e-mail in error,
please notify the sender and permanently delete the e-mail and any
attachments immediately. You should not retain, copy or use this e-mail or
any attachment for any purpose, nor disclose all or any part of the
contents to any other person. Thank you.*
When a client sends a SUBSCRIBE with Expires: 0, Kamailio responds correctly with a "202 OK".
But then Kamailio sends a NOTIFY to the same client with "Subscription-State: terminated;reason=timeout".
The client rejects this NOTIFY with a "481 Dialog/Transaction Does Not Exist".
Why does Kamailio send this NOTIFY, and is there any way to fix or disable it because it's always rejected by the client?
The client is IMSDroid, and Kamailio is 5.2.2 with a default configuration.
Packet 1 = Client sending SUBSCRIBE with Expires: 0
SUBSCRIBE sip:X.X.X.X:443;transport=tcp SIP/2.0Via: SIP/2.0/TCP 192.168.0.21:45336;branch=z9hG4bK-670576127From: <sip:username@domain.com>;tag=1372208921To: <sip:kamailio.domain.com>;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6Contact: <sip:username@192.168.0.21:45336;transport=tcp>Call-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 1321654295 SUBSCRIBEExpires: 0Content-Length: 299Max-Forwards: 70Allow: INVITE, ACK, CANCEL, BYE, MESSAGE, OPTIONS, NOTIFY, PRACK, UPDATE, REFERAccept: application/pidf+xmlEvent: presence
Packet 2 = Kamailio responding with 202 OK
SIP/2.0 202 OKVia: SIP/2.0/TCP 192.168.0.21:45336;branch=z9hG4bK-670576127From: <sip:username@domain.com>;tag=1372208921To: <sip:kamailio@domain.com>;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6Call-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 1321654295 SUBSCRIBEExpires: 0Contact: <sip:X.X.X.X:443;transport=tcp>Server: kamailio (5.2.2 (x86_64/linux))Content-Length: 0
Packet 3 = Kamailio sending a NOTIFY
NOTIFY sip:username@192.168.0.21:45336;transport=tcp SIP/2.0Via: SIP/2.0/TCP X.X.X.X:443;branch=z9hG4bKefe7.5f8ec435000000000000000000000000.0To: <sip:username@domain.com>;tag=1372208921From: <sip:kamailio@domain.com>;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6CSeq: 3 NOTIFYCall-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0Content-Length: 0Max-Forwards: 70Event: presenceContact: <sip:X.X.X.X:443;transport=tcp>Subscription-State: terminated;reason=timeout
Packet 4 = Client responding to the NOTIFY with "481 Dialog/Transaction Does Not Exist"
SIP/2.0 481 Dialog/Transaction Does Not ExistVia: SIP/2.0/TCP X.X.X.X:443;branch=z9hG4bKefe7.5f8ec435000000000000000000000000.0From: <sip:kamailio@domain.com>;tag=c4eb72dabf44e7588b972bd3b454ea11-0cd6To: <sip:username@domain.com>;tag=1372208921Call-ID: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0CSeq: 3 NOTIFYContent-Length: 0
There are two entries in the Kamailio log:
INFO: {1 1321654295 SUBSCRIBE e8cffa8f-948d-eb99-69ca-c9f18bdf11a0} presence [notify.c:1614]: send_notify_request(): NOTIFY sip:username@domain.com via sip:Y.Y.Y.Y:45336;transport=tcp on behalf of sip:kamailio.domain.com for event presence : e8cffa8f-948d-eb99-69ca-c9f18bdf11a0
ERROR: {2 3 NOTIFY e8cffa8f-948d-eb99-69ca-c9f18bdf11a0} presence [subscribe.c:497]: delete_subs(): Failed to delete subscription from memory [slot: 174 ev: sip:kamailio.domain.com pu: presence ci: e8cffa8f-948d-eb99-69ca-c9f18bdf11a0 ft: 1372208921 tt: c4eb72dabf44e7588b972bd3b454ea11-0cd6]
These are the presence settings in the Kamailio config file:
#!ifdef WITH_PRESENCE# ----- presence params -----modparam("presence", "db_url", DBURL)modparam("presence", "send_fast_notify", 0)
# ----- presence_xml params -----modparam("presence_xml", "db_url", DBURL)modparam("presence_xml", "force_active", 1)modparam("presence_xml", "force_dummy_presence", 0)#!endif
Appreciate your help.
Hello all,
I am dealing with a no audio issue, phones are not even ringing. There is a
private IP address in the "VIA" section of the message header of the INVITE:
Via: SIP/2.0/UDP 192.168.1.25:65291
;rport;branch=z9hG4bKPj9e3849d1981a4094a8323dad5826ec34
and in the contact too:
Contact: <sip:5002@192.168.1.25:65291;ob>
In the "status 100 Attempting to connect your call" from the server, I can
see the public IP of the phone under received:
Via: SIP/2.0/UDP 192.168.1.25:65291
;rport=53990;branch=z9hG4bKPj9e3849d1981a4094a8323dad5826ec34;received=PHONE_PUBLIC_IP
And in the "status 200 ok" from the server, I have:
Via: SIP/2.0/UDP 192.168.1.25:65291
;received=PHONE_PUBLIC_IP;rport=53990;branch=z9hG4bKPj9e3849d1981a4094a8323dad5826ec34
Record-Route:
<sip:SERVER_PUBLIC_IP;lr=on;ftag=9284528256a54f8b81e692133a15684c>
I don't know what steps to take to resolve this issue.
hello dears
i'm trying to build kamailio & asterisk with the following :
* Kamailio will listen to All the interfaces :
listen=udp:0.0.0.0:5050
listen=udp:0.0.0.0:5060
* it will add the record header as in the following part :
if (!isflagset(FLT_RR)) record_route();
setflag(FLT_RR);
when the sip message get from kamailio to asterisk the record route header will be like "<sip:0.0.0.0:5060;....etc.>"
So is there any way to make the Via and record route headers has a specific IP instead of (0.0.0.0) i mean Something like "record_route("$Ri")".
thanks & regards
HI
this is Gaurav
im using kamailio 5.1.2 on ubuntu 18.4
i want to change kamailio SIP port 5060 to other port for security purpose
plz help me
--
*Regards:*
Gaurav Kumar
Hi Again,
Here is an issue with TCP connection being kept for more:
Yesterday, I have discovered that a User-Agent (<Avaya IP Phone 1120E
(SIP1120e.04.04.30.00)> tried to register a lot. It was sending REGISTER
over new established TCP socket *every 2 seconds*.
All the REGISTER was rejected with 401. (may be the device was
misconfigured? or not receiving any of my answer? I can't tell)
NOTE: You can see the expires header was very large: 86400, ie: 24 hours...
I was checking the TCP/TLS connections on my server and discovered more
than 1000 TCP established connection to that user/ip, and thus, I have
tried to understand what happened.
Checking the logs, I received 4855 REGISTER from this device from "Mar 25
03:47:09" to "Mar 25 07:56:13" which is a rate of approx one new TCP
connection every 2.5 seconds...
Today, I decided to check it again around 11am.
jack@sip:~$ sudo kamctl stats tcp
{
"jsonrpc": "2.0",
"result": [
"tcp:con_reset = 1857",
"tcp:con_timeout = 35927",
"tcp:connect_failed = 25",
"tcp:connect_success = 2",
"tcp:current_opened_connections = 2291",
"tcp:current_write_queue_size = 0",
"tcp:established = 80778",
"tcp:local_reject = 0",
"tcp:passive_open = 80776",
"tcp:send_timeout = 2",
"tcp:sendq_full = 0"
],
"id": 7305
}
There was still A LOT of established connections. And the connections have
been established more than 24 hours ago.
At 11H16:
$> lsof -n -l | grep kamailio | grep TCP | grep 41.234.242.69 | grep ESTA |
wc -l
1161
At 11H22:
$> lsof -n -l | grep kamailio | grep TCP | grep 41.234.242.69 | grep ESTA |
wc -l
1018
At 11H35:
$> lsof -n -l | grep kamailio | grep TCP | grep 41.234.242.69 | grep ESTA |
wc -l
655
At 13H
$> lsof -n -l | grep kamailio | grep TCP | grep 41.234.242.69 | grep ESTA |
wc -l
0
So the established connections are all gone now.
Between 11h16 and 11H35, I was seeing the server regularly sending [FIN,
ACK] over each TCP established connection, with retransmissions for all of
them. (no incoming trafic)
I do not have numbers/capture/stats, but I think that kamailio was already
closing some
connection yesterday. I don't know when kamailio started to try closing
those connections.
I'm now back with this status:
At 13pm:
jack@sip:~$ sudo kamctl stats tcp
{
"jsonrpc": "2.0",
"result": [
"tcp:con_reset = 1896",
"tcp:con_timeout = 38042",
"tcp:connect_failed = 26",
"tcp:connect_success = 2",
"tcp:current_opened_connections = 939",
"tcp:current_write_queue_size = 0",
"tcp:established = 81950",
"tcp:local_reject = 0",
"tcp:passive_open = 81948",
"tcp:send_timeout = 2",
"tcp:sendq_full = 0"
],
"id": 12734
}
With around 155 registration entries using TCP and TLS in my location
database.
As you can see, tcp:current_opened_connections = 939 is still pretty high
compared to
my currently registred users.
I have "modparam("registrar", "max_expires", 86400)", because I'm keeping
contact entries (even with TCP connection down) for push notifications.
I have "tcp_connection_lifetime=3600" configured.
Question 1
With "tcp_connection_lifetime=3600", I would expect kamailio to close the
established connection after 3600 seconds without traffic. It is pretty
obvious that no data has been exchanged over the 4855 established
connection during a day.
Despite the issue with the Avaya phones is solved automatically after a
day, I guess similar stuff or happening, at a different rate, for other
users as well. (because current_opened_connections is way higher than
registred TCP/TLS users)
Question 2
I can list TLS connection with "kamctl rpc tls.list"
Can I get a similar list for TCP? (lsof returns a lot of duplicates...)
Tks
Aymeric
--
Antisip - http://www.antisip.com
Greetings,
Is there a difference for Kamailio between these 2 situations.
1 - Method with 2 Route Headers, each one with one address and one uri
2 - Method with 1 Route Header that includes 2 Route URI
Best Regards,
Duarte Rocha
HI
this is Gaurav
im using kamailio 5.1.2 on ubuntu 18.4
i wan to implement user based calling on kamailio , that only can call how
registered with user
plz help
--
*Regards:*
Gaurav Kumar
Hi all,
I'm building an automated load testing system for an rtp media server with TURN that uses Kamailio for SIP.
When a client sends an INVITE to Kamailio, I need Kamailio to respond with "200 OK" and the SDP generated by rtpengine.
I've enabled auto-answer in the client, so as soon as it receives the response from Kamailio it will start sending RTP packets.
Right now I'm using send_reply("200", "OK"); which is sending the right 200 response back to the client, but it doesn't include any body.
How can I get Kamailio to send a "200 OK" and add the rtpengine_answer into the body?
Appreciate any help, I've been struggling with this for three days.
Cheers.
rtpengine_offer("SIP-source-address ICE=force-relay RTP");send_reply("200", "OK");