Hi, Websocket module documentation has a code reference to use aliases for SIP routing. However, aliases will not work in the following setup and situation. 1. Kamailio is configured with active and standby node 2. Ping is implemented from webclient and kamailio responds with pong. 3. Two clients ClinetA and ClientB registered themselves to Kamailio. 4. After SIP negotiation (INVITE-200OK) each client learnt about below aliases. Alias of ClientA: alias=172.27.6.98~58336 Alias of ClientB: alias=172.27.6.98~58342
So normally if ClientB wants to send SIP message to ClientA, SIP URI from ClientB looks like below ACK sip:v9d0gtl6@q0lrdlj63pik.invalid;alias=172.27.6.98~58336~5;transport=ws SIP/2.0 4. Call is in a connected state.
Following is the issue. i. Switchover (or network lost or reboot) at Kamailio happened ii. Due to ping pong both the clients detected network loss individually and re-registered themselves. iii. Aliases of both the clients got changed. New Alias of ClientA: alias=172.27.6.98~ 58346
New Alias of ClientB: alias=172.27.6.98~ 58348
iv. But ClientB doesn’t know that ClientA also re-registered and ClientA’s alias got changed and vice-versa v. Because of this ClientB still sends BYE with Initial alias BYE sip:v9d0gtl6@q0lrdlj63pik.invalid;alias=172.27.6.98~58336~5;transport=ws SIP/2.0
Would like to know what is the recommended solution for this problem using alias or is it a limitation of using alias?
Thanks & Regards, Shahid
On 30.06.21 09:28, Juha Heinanen wrote:
Shahid Hussain writes:
Would like to know what is the recommended solution for this problem using alias or is it a limitation of using alias?
Maybe a limitation. Try with SIP User Agents that support gruu and thus identify themselves using sip.instance.
Relying on GRUU would be ok, but most of the UAs I had to deal with lack its implementation.
What I have seen as an alternative (e.g., linphone, iirc) is sending re-INVITE with the new contact address and then a new alias will be generated as well. It is not enough for the UA to send a new REGISTER, that is for receiving new calls. In making calls is not restricted to registered devices, therefore when an UA changes is local states/coordinates, it has to send a re-INVITE. Contact can be changed within dialog (also, just for sake of completion, dialog module should save new Contact values), only Record-Route/Route headers are fixed for active calls (as far as I remember right now).
Cheers, Daniel
On 30 Jun 2021, at 09:10, Shahid Hussain shnx88@gmail.com wrote:
Hi, Websocket module documentation has a code reference to use aliases for SIP routing. However, aliases will not work in the following setup and situation.
- Kamailio is configured with active and standby node
- Ping is implemented from webclient and kamailio responds with pong.
- Two clients ClinetA and ClientB registered themselves to Kamailio.
- After SIP negotiation (INVITE-200OK) each client learnt about below aliases.
Alias of ClientA: alias=172.27.6.98~58336 Alias of ClientB: alias=172.27.6.98~58342
So normally if ClientB wants to send SIP message to ClientA, SIP URI from ClientB looks like below ACK sip:v9d0gtl6@q0lrdlj63pik.invalid;alias=172.27.6.98~58336~5;transport=ws SIP/2.0 4. Call is in a connected state.
Following is the issue. i. Switchover (or network lost or reboot) at Kamailio happened ii. Due to ping pong both the clients detected network loss individually and re-registered themselves. iii. Aliases of both the clients got changed. New Alias of ClientA: alias=172.27.6.98~ 58346
New Alias of ClientB: alias=172.27.6.98~ 58348
iv. But ClientB doesn’t know that ClientA also re-registered and ClientA’s alias got changed and vice-versa v. Because of this ClientB still sends BYE with Initial alias BYE sip:v9d0gtl6@q0lrdlj63pik.invalid;alias=172.27.6.98~58336~5;transport=ws SIP/2.0
Would like to know what is the recommended solution for this problem using alias or is it a limitation of using alias?
Full implementation of SIP outbound is the only solution close to solving this problem in the IETF standards. However, I have seen no single SIP client that have implemented this, even though Kamailio supports it on the server side. The idea is that you always have two TCP connections to two active servers.
https://datatracker.ietf.org/doc/rfc5626/ https://datatracker.ietf.org/doc/rfc5626/
Having said that, SIP outbound enables registration survival and always being reachable, but it does not handle dialog survival. It was something we discussed for a while at the latest Kamailio dev meeting.
Hopefully the actual RTP streams can survive the failover and the call can go on, but if it depends on SIP signalling there’s no other way (that i know of) to survive and move the call to a new server with a new TCP connection. I have struggled with similar problems and made possible call survival in the case of lost SIP signalling path. It requires SIP uas that doesn’t implement any keepalive or SIP timer that will hangup if SIP signalling is dead.
/O
Olle E. Johansson writes:
Full implementation of SIP outbound is the only solution close to solving this problem in the IETF standards. However, I have seen no single SIP client that have implemented this, even though Kamailio supports it on the server side. The idea is that you always have two TCP connections to two active servers.
Have you checked baresip?
-- Juha
On 30 Jun 2021, at 09:49, Juha Heinanen jh@tutpro.com wrote:
Olle E. Johansson writes:
Full implementation of SIP outbound is the only solution close to solving this problem in the IETF standards. However, I have seen no single SIP client that have implemented this, even though Kamailio supports it on the server side. The idea is that you always have two TCP connections to two active servers.
Have you checked baresip?
I don’t recall baresip having a full SIP outbound implementation.
SIP outbound seems to be an elegant solution to a non-problem. Maybe it’s coming back on the radar now, several years later and we need to start working on it as more and more SIP moves to TCP/TLS or WebSocket and network operators implement CGnat and other middleboxes that do strange stuff to open flows.
Without SIP outbound a SIP UA using TLS needs to have a server cert and accept incoming TLS connections, which of course does not work over NAT, so if we want to be RFC compliant, we should at least copy the RFC for SIP over WebSocket “half-outbound” requirement to SIP/TLS and SIP/TCP.
I have started discussions about this “half-outbound” concept a few times, but haven’t gotten much support in the SIPcore IETF group. Meanwhile, Kamailio actually breaks the RFC by sending outbound requests on the inbound TLS connection. It works, but it’s not RFC compliant.
Cheers, /O
Olle E. Johansson writes:
Have you checked baresip?
I don’t recall baresip having a full SIP outbound implementation.
baresip is able to register with two outbound proxies and supports gruu (below). What else is needed?
-- Juha
# TLS 192.168.43.160:49556 -> 192.168.43.160:5061 REGISTER sip:test.tutpro.com SIP/2.0 Via: SIP/2.0/TLS 127.0.0.1:5047;branch=z9hG4bK305c4adf9d548df2;rport Contact: sip:test-0x55788569f390@127.0.0.1:5047;transport=tls;expires=600;+sip.instance="urn:uuid:9b21c1a8-dc58-a3d6-83d5-7be67cbe70ce";q=0.5 Max-Forwards: 70 To: sip:test@test.tutpro.com From: "Test Account" sip:test@test.tutpro.com;tag=f2465ebef6a435a2 Call-ID: ea13feabfb0effd8 CSeq: 1420 REGISTER User-Agent: baresip v1.1.0 (x86_64/linux) Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE,REFER Content-Length: 0 # TLS 192.168.43.160:5061 -> 192.168.43.160:49556 SIP/2.0 200 OK Via: SIP/2.0/TLS 127.0.0.1:5047;branch=z9hG4bK305c4adf9d548df2;rport=49556;received=192.168.43.160 To: sip:test@test.tutpro.com;tag=75fad08a1e94bbeeabf349d4bd14beda.b29c1116 From: "Test Account" sip:test@test.tutpro.com;tag=f2465ebef6a435a2 Call-ID: ea13feabfb0effd8 CSeq: 1420 REGISTER Contact: sip:test-0x55788569f390@127.0.0.1:5047;transport=tls;q=0.5;expires=600;received="sip:192.168.43.160:49556;transport=tls";+sip.instance="urn:uuid:9b21c1a8-dc58-a3d6-83d5-7be67cbe70ce" Supported: outbound Server: OpenSIPg SIP Proxy (5.6.0-0b02 (x86_64/linux)) Content-Length: # TLS 192.168.43.160:49556 -> 192.168.43.160:5061 INVITE sip:foo@test.tutpro.com SIP/2.0 Via: SIP/2.0/TLS 127.0.0.1:5047;branch=z9hG4bK5b8f364c3b95c0b1;rport Contact: sip:test-0x55788569f390@127.0.0.1:5047;transport=tls Max-Forwards: 70 To: sip:foo@test.tutpro.com From: "Test Account" sip:test@test.tutpro.com;tag=ffb1ab9552ce5a91 Call-ID: 1a70eaa0d9e358bb CSeq: 2779 INVITE User-Agent: baresip v1.1.0 (x86_64/linux) Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE,REFER Supported: gruu Content-Type: application/sdp Content-Length: 995
On 30 Jun 2021, at 10:14, Juha Heinanen jh@tutpro.com wrote:
Olle E. Johansson writes:
Have you checked baresip?
I don’t recall baresip having a full SIP outbound implementation.
baresip is able to register with two outbound proxies and supports gruu (below). What else is needed?
Full support for SIP outbound (using REG-id when registering etc). Last time I looked we did not have all nuts and bolts for it, but let’s give it a try.
/O
Olle E. Johansson writes:
Full support for SIP outbound (using REG-id when registering etc). Last time I looked we did not have all nuts and bolts for it, but let’s give it a try.
Yes, reg-id is missing from contact. It would be good to add so that sip proxy can detect if registration is a new one or refreshes the old one.
But if a connection oriented transport is used and connection breaks, kamailio should unregister the contact. If it does, missing of reg-id does cause a problem.
For redundancy support, instance-id is needed and it is there.
-- Juha
Due to other tests, I had missed baresip account's ;outbound paramater. Once I added it, also reg-id was added.
-- Juha
WSS 192.168.43.160:50442 -> 192.168.43.160:5061 REGISTER sip:test.tutpro.com SIP/2.0 Via: SIP/2.0/WSS 127.0.0.1:9;branch=z9hG4bK5a4ad01f9164d358;rport Contact: sip:test-0x560871f65390@127.0.0.1:9;transport=wss;expires=30;+sip.instance="urn:uuid:9b21c1a8-dc58-a3d6-83d5-7be67cbe70ce";q=0.5;reg-id=1 Max-Forwards: 70 Route: sip:lohi.tutpro.com:5061;transport=wss;lr To: sip:test@test.tutpro.com From: "Test Account" sip:test@test.tutpro.com;tag=904f27750c59fc5b Call-ID: 69f4eea174d327eb CSeq: 29225 REGISTER User-Agent: baresip v1.1.0 (x86_64/linux) Supported: gruu, outbound, path Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE,REFER Content-Length: 0
I am using a JSSIP client and they claim to be implemented RFC-5626. Following are the REGISTER and response messages. Is it possible to confirm the JSSIP client has full implementation of SIP outbound? If it supports fully then I can debug outbound and gruu functionality at Kamailio(I have it enabled but it didn't work, have to see if I need to enable any more settings).
REGISTER sip:sip.engageio.com SIP/2.0 Via: SIP/2.0/WSS 5qfe1k7uvuaf.invalid;branch=z9hG4bK563864 Max-Forwards: 69 To: sip:123456543_28iseh@sip.engageio.com From: "123456543" sip:123456543_28iseh@sip.engageio.com;tag=em9kvbdqg2 Call-ID: 071s1uno9bk7ie1hf0p3dn CSeq: 1 REGISTER Contact: sip:h0pg4fas@5qfe1k7uvuaf.invalid ;transport=ws;+sip.ice;reg-id=1;+sip.instance="urn:uuid:b7d40d83-b1f4-4419-bced-4c464507dea6";expires=600 Expires: 600 Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY Supported: path,gruu,outbound User-Agent: JsSIP 3.7.5 Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/WSS 5qfe1k7uvuaf.invalid;branch=z9hG4bK563864;received=172.27.6.98 To: <sip:123456543_28iseh@sip.engageio.com
;tag=211517f31d5fe3f765e28c150e460fc3.0b7e0000
From: "123456543" sip:123456543_28iseh@sip.engageio.com;tag=em9kvbdqg2 Call-ID: 071s1uno9bk7ie1hf0p3dn CSeq: 1 REGISTER Contact: sip:h0pg4fas@5qfe1k7uvuaf.invalid ;transport=ws;expires=600;pub-gruu="sip:123456543_28iseh@sip.engageio.com ;gr=urn:uuid:b7d40d83-b1f4-4419-bced-4c464507dea6";temp-gruu=" sip:uloc-60dc6c8a-7464-1-2dfe734@sip.engageio.com ;gr";+sip.instance="urn:uuid:b7d40d83-b1f4-4419-bced-4c464507dea6";reg-id=1 Require: outbound Supported: outbound Server: kamailio (5.3.2 (x86_64/linux)) Content-Length: 0
On Wed, Jun 30, 2021 at 4:11 PM Juha Heinanen jh@tutpro.com wrote:
Due to other tests, I had missed baresip account's ;outbound paramater. Once I added it, also reg-id was added.
-- Juha
WSS 192.168.43.160:50442 -> 192.168.43.160:5061 REGISTER sip:test.tutpro.com SIP/2.0 Via: SIP/2.0/WSS 127.0.0.1:9;branch=z9hG4bK5a4ad01f9164d358;rport Contact: sip:test-0x560871f65390@127.0.0.1:9 ;transport=wss;expires=30;+sip.instance="urn:uuid:9b21c1a8-dc58-a3d6-83d5-7be67cbe70ce";q=0.5;reg-id=1 Max-Forwards: 70 Route: sip:lohi.tutpro.com:5061;transport=wss;lr To: sip:test@test.tutpro.com From: "Test Account" sip:test@test.tutpro.com;tag=904f27750c59fc5b Call-ID: 69f4eea174d327eb CSeq: 29225 REGISTER User-Agent: baresip v1.1.0 (x86_64/linux) Supported: gruu, outbound, path Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE,REFER Content-Length: 0
Kamailio - Users Mailing List - Non Commercial Discussions
- sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: