ejabberd icon indicating copy to clipboard operation
ejabberd copied to clipboard

Unable to Register SIP client with IPv6

Open Andy-2639 opened this issue 8 years ago • 57 comments

What version of ejabberd are you using? How did you install ejabberd (source, package, distribution)?

https://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/17.03/ejabberd-17.03-windows-installer.exe

What operating system (version) are you using?

Windows 10 Pro x64 Anniversary Update (Version 1607 Build 14393.969)

What did not work as expected? Are there error messages in the log? What was the unexpected behavior? What was the expected result?

My SIP client (Phoner Lite 2.47, http://www.phonerlite.de/ ) can register to my ejabberd SIP server via IPv4 (TCP and UDP) without problems. When I try to use IPv6, the register fails and PhonerLite says a timeout occurred. This happens with TCP and UDP.

SIP client and ejabberd are running on different maschines in the same LAN. No firewall is enabled on either maschine.

I attached the logs of the connections (ejabberd log, PhonerLite debug output and wireshark packet captures) zipped. Wireshark ran on the same maschine on which ejabberd runs. logs_pcaps.zip

SIP configuration in my ejabberd.yml:

listen: 
  - 
    ip: "0.0.0.0"
    port: 65060
    transport: udp
    module: ejabberd_sip
  - 
    ip: "::"
    port: 65060
    transport: udp
    module: ejabberd_sip
  - 
    ip: "0.0.0.0"
    port: 65060
    module: ejabberd_sip
  - 
    ip: "::"
    port: 65060
    module: ejabberd_sip
modules: 
  mod_sip: []

Andy-2639 avatar Apr 09 '17 09:04 Andy-2639

Don't you have any errors in the log? It's not always possible to define the same port globally to both IP protocols. Do you see the ports are opened on all IP interfaces?

zinid avatar May 05 '17 10:05 zinid

Don't you have any errors in the log?

No, there are no errors in the log. The ejabberd logs are in logs_pcaps.zip "ejabberd [tcp/udp] v[4/6].log". For every protocol combination, I deleted the old logs and started a fresh ejabberd instance.

It's not always possible to define the same port globally to both IP protocols. Do you see the ports are opened on all IP interfaces?

I tested it again with port 5060 for IPv4 TCP/UDP and port 65060 for IPv6 TCP/UDP. This gives the same behavior. I also testes the bahavior of Phoner Lite 2.47: when the SIP server is not reacheable I get an connection error message instead of an timeout. Also wireshark indicates that the ports are open: no TCP RST packets. In the ejabberd logs, I can see the REGISTER messages from Phoner Lite, too (ejabberd tcp v6.log, line 327; ejabbers udp v6.log, 326 - 509). XMPP works fine with IPv4 and IPv6 on the same port number.

Andy-2639 avatar May 07 '17 06:05 Andy-2639

I tested it again with port 5060 for IPv4 TCP/UDP and port 65060 for IPv6 TCP/UDP.

Do you mean to say you disabled ipv4 listener and still don't have it working with ipv6 listener?

zinid avatar May 07 '17 06:05 zinid

Neighter

listen: 
  - 
    ip: "0.0.0.0"
    port: 5060
    transport: udp
    module: ejabberd_sip
  - 
    ip: "::"
    port: 65060
    transport: udp
    module: ejabberd_sip
  - 
    ip: "0.0.0.0"
    port: 5060
    module: ejabberd_sip
  - 
    ip: "::"
    port: 65060
    module: ejabberd_sip

nor

listen: 
  - 
    ip: "::"
    port: 5060
    transport: udp
    module: ejabberd_sip
  - 
    ip: "::"
    port: 5060
    module: ejabberd_sip

works on my system.

Andy-2639 avatar May 07 '17 08:05 Andy-2639

I tested SIP with IPv6 again with ejabberd 17.08. It still fails. The logs of phonerlite and ejabberd and the complete ejabberd configuration is in the zip: logs_config.zip

SIP with IPv4 works fine. I enabled listening only on one IP version at a time.

It seems that ejabberd is receiving the requests vom the SIP client but just does not send a reply.

The test ran in a VM with a newly installed Windows 10 Pro x64 and a newly installed ejabberd 17.08. The windows firewall was deactivated and phonelite and ejabberd ran on the same VM.

Andy-2639 avatar Aug 27 '17 08:08 Andy-2639

I'm not sure I can help because I don't have windows installed and IPv6 works fine for me on Linux.

zinid avatar Sep 20 '17 08:09 zinid

Any progress with this? I'm running centos and have enabled IPv6. I can see from the logs the server receives the SIP REGISTER message. But never responds.

aylesm avatar Nov 10 '17 14:11 aylesm

I still have it working:

$ telnet ::1 5060
Trying ::1...
Connected to ::1.
Escape character is '^]'.
REGISTER sip:zinid.ru SIP/2.0
Via: SIP/2.0/TCP 198.211.126.52:43403;branch=z9hG4bK.23e5441e;rport;alias
From: sip:[email protected];tag=4cc1fd1f
To: sip:[email protected]
Call-ID: [email protected]
CSeq: 1 REGISTER
Content-Length: 0
Max-Forwards: 70
User-Agent: sipsak 0.9.7pre
Expires: 15
Contact: sip:[email protected]:43403;transport=TCP

SIP/2.0 401 Unauthorized
Via: SIP/2.0/TCP 198.211.126.52:43403;branch=z9hG4bK.23e5441e;alias;received=[::1];rport=54724
From: <sip:[email protected]>;tag=4cc1fd1f
Call-ID: [email protected]
CSeq: 1 REGISTER
Max-Forwards: 70
To: <sip:[email protected]>;tag=2332915767-1429473788
Server: ejabberd 17.09.121
WWW-Authenticate: Digest realm="zinid.ru", qop="auth", nonce="8aa552d7fd797fec03f613ef91f856859d72ec97"
Content-Length: 0

zinid avatar Nov 14 '17 07:11 zinid

I have tried on two Linux machines, btw.

zinid avatar Nov 14 '17 07:11 zinid

Have you tested over TLS?

aylesm avatar Nov 14 '17 08:11 aylesm

Yes, it works as well.

zinid avatar Nov 14 '17 08:11 zinid

Have you enabled debug (loglevel: 5)? What do you see in the log?

zinid avatar Nov 14 '17 09:11 zinid

I see the incoming request in the logs. But I don't see the response. So it feels like this is an outbound issue in my setup. Not sure if I've waited long enough to see a timeout or other relevant log msg.

aylesm avatar Nov 14 '17 09:11 aylesm

This is strange because you should see data_out log message within 32 seconds max.

zinid avatar Nov 14 '17 09:11 zinid

Also, what if you don't use TLS? Does plain TCP or UDP work with IPv6?

zinid avatar Nov 14 '17 10:11 zinid

Same result with UDP. Haven't tried TCP at this point.

aylesm avatar Nov 14 '17 10:11 aylesm

:disappointed:

zinid avatar Nov 14 '17 10:11 zinid

@zinid do you have a sample ejabberd.yml I can take a look at to see if I've setup my instance correctly for IPv6?

aylesm avatar Nov 15 '17 09:11 aylesm

I've also reproduced this same behaviour on MacOS. Which by default has IPv6 switched on. So the only thing I can think of is that my yml is wrong. The only other thing I can think of is trying to setup the same type of linux box as you to see if that's the issue.

aylesm avatar Nov 15 '17 09:11 aylesm

do you have a sample ejabberd.yml

Sure, here is the listening section

listen:
  - 
    port: 3478
    module: ejabberd_stun
    transport: udp
    use_turn: true
    auth_type: user
    turn_ip: "A.B.C.D"
  - 
    port: 5060
    ip: "::"
    module: ejabberd_sip
    transport: udp
  - 
    port: 5060
    ip: "::"
    module: ejabberd_sip
  -
    port: 5061
    ip: "::"
    module: ejabberd_sip
    tls: true
    certfile: "/path/to/cert.pem"

And modules section:

modules:
  mod_sip: {}

zinid avatar Nov 15 '17 09:11 zinid

I 'm having the same issue, able to register from my iPhone to android using IPV4, but unable to register using IPV6 using baresip

sbourji avatar Jan 06 '18 13:01 sbourji

@sbourji This is not enough to just say "I don't have this working". This doesn't help us. You're better off intercepting the SIP traffic to see what happens.

zinid avatar Jan 06 '18 16:01 zinid

Ok. What you need me to supply. The is nothing going thru the wire Wireshark show nothing. I can register with ipv4 and I do, but not with ipv6?

Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message -------- From: Evgeny Khramtsov [email protected] Date: 1/6/18 11:12 AM (GMT-05:00) To: processone/ejabberd [email protected] Cc: sbourji [email protected], Mention [email protected] Subject: Re: [processone/ejabberd] Unable to Register SIP client with IPv6 (#1668)

@sbourjihttps://github.com/sbourji This is not enough to just say "I don't have this working". This doesn't help us. You're better off intercepting the SIP traffic to see what happens.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/processone/ejabberd/issues/1668#issuecomment-355756858, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALfuXe7iMTbaQP9FyBf9cBpWKpJclP8Fks5tH5tugaJpZM4M3-nM.

sbourji avatar Jan 06 '18 22:01 sbourji

If there is nothing on the wire, how is it supposed to work? Packets don't arrive at server, of course nothing would work.

zinid avatar Jan 06 '18 22:01 zinid

Don't get it? What are you saying.? This not about ejabbered, the issue is about baresip and ipv6. Maybe I am in the wrong discussion group. If it's the case, then, my mistake.

Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message -------- From: Evgeny Khramtsov [email protected] Date: 1/6/18 5:57 PM (GMT-05:00) To: processone/ejabberd [email protected] Cc: sbourji [email protected], Mention [email protected] Subject: Re: [processone/ejabberd] Unable to Register SIP client with IPv6 (#1668)

If there is nothing on the wire, how is it supposed to work? Packets don't arrive at server, of course nothing would work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/processone/ejabberd/issues/1668#issuecomment-355784383, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALfuXSNfdkWN18iZIao8K7EYEeqjxN-Gks5tH_pOgaJpZM4M3-nM.

sbourji avatar Jan 06 '18 23:01 sbourji

The network traffic that I saw was from ejabberd 17.01. Traffic was received and there was no response. The logs did Not indicate an error condition. The request went into a black hole. The latest release seams to have fixed this issue for me.

Sent from my iPhone

On 6 Jan 2018, at 22:57, Evgeny Khramtsov [email protected] wrote:

If there is nothing on the wire, how is it supposed to work? Packets don't arrive at server, of course nothing would work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

aylesm avatar Jan 06 '18 23:01 aylesm

I see packets arrive at ejabberd and they are logged. I don’t see a response on the client or even in the server logs. The latest ejabberd config example seems to be more IPv6 compatible. For me I just updated and incorporated the new config and it worked for me.

Sent from my iPhone

On 6 Jan 2018, at 23:16, sbourji [email protected] wrote:

Don't get it? What are you saying.? This not about ejabbered, the issue is about baresip and ipv6. Maybe I am in the wrong discussion group. If it's the case, then, my mistake.

Sent from my Verizon, Samsung Galaxy smartphone

-------- Original message -------- From: Evgeny Khramtsov [email protected] Date: 1/6/18 5:57 PM (GMT-05:00) To: processone/ejabberd [email protected] Cc: sbourji [email protected], Mention [email protected] Subject: Re: [processone/ejabberd] Unable to Register SIP client with IPv6 (#1668)

If there is nothing on the wire, how is it supposed to work? Packets don't arrive at server, of course nothing would work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/processone/ejabberd/issues/1668#issuecomment-355784383, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALfuXSNfdkWN18iZIao8K7EYEeqjxN-Gks5tH_pOgaJpZM4M3-nM. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

aylesm avatar Jan 06 '18 23:01 aylesm

OK, I close the issue then

zinid avatar Jan 07 '18 08:01 zinid

@aylesm

I don't really understand your answer.

I see packets arrive at ejabberd and they are logged. I don’t see a response on the client or even in the server logs.

Is this the behavior before your configuration change?

What exactly did you change? I still cannot register using IPv6 - IPv4 works fine. ejabberd 17.12 on Windows 10 x64 Fall Creators Update.

Andy-2639 avatar Jan 07 '18 10:01 Andy-2639

@zinid I spoke too soon. I've now got round to changing my client to be dual stack SIP client. IPv4 works well. But IPv6 is still failing to respond. I can see the REGISTER data in the logs, but the sip module doesn't respond and there is no error message.

I'm using CentOS 7 (RHEL 7.4) with ejabberd 18.01. TLS is enabled and we use letsencrypt certs for this. My client is PJSIP and is 2.7.2

Below is the IPv4 logs...

16:52:49.976 [debug] SIP [tls/in] ::ffff:109.147.134.30:57353 -> ::ffff:10.0.19.30:5061:
REGISTER sip:example.net;transport=tls SIP/2.0
Via: SIP/2.0/TLS 192.168.1.141:57353;rport;branch=z9hG4bKPjzSXQubtFjI1SfsQIjT7qeyoSLq9TRV0T;alias
Max-Forwards: 70
From: <sip:[email protected]>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
To: <sip:[email protected]>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18860 REGISTER
Supported: outbound, path
Contact: <sip:[email protected]:57353;transport=TLS;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00000163161a>"
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0


16:52:49.977 [debug] SIP [tls/out] ::ffff:10.0.19.30:5061 -> ::ffff:109.147.134.30:57353:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/TLS 192.168.1.141:57353;branch=z9hG4bKPjzSXQubtFjI1SfsQIjT7qeyoSLq9TRV0T;alias;received=109.147.134.30;rport=57353 
Max-Forwards: 70
From: <sip:[email protected]>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18860 REGISTER
To: <sip:[email protected]>;tag=376234652-2440810256
Server: ejabberd 18.01
WWW-Authenticate: Digest realm="example.net", qop="auth", nonce="2ce01e598ee3cd476949a0274578a443e270f959"
Content-Length: 0


16:52:50.004 [debug] SIP [tls/in] ::ffff:109.147.134.30:57353 -> ::ffff:10.0.19.30:5061:
REGISTER sip:example.net;transport=tls SIP/2.0
Via: SIP/2.0/TLS 109.147.134.30:57353;rport;branch=z9hG4bKPjK2apGwnJpB9Cd5zKGRti4rYvjULof4De;alias
Max-Forwards: 70
From: <sip:[email protected]>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
To: <sip:[email protected]>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18861 REGISTER
Supported: outbound, path
Contact: <sip:[email protected]:57353;transport=TLS;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00000163161a>"
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="31bb60bd-bbde-4641-b86d-b4538a4a8108", realm="example.net", nonce="2ce01e598ee3cd476949a0274578a443e270f959", uri="sip:example.net;transport=tls", response="be8f1e0b06f1fec3d3c22b17eae1c170", cnonce="eQRpI.MufumHnqWZ41SRQsXGqULNN-od", qop=auth, nc=00000001
Content-Length:  0


16:52:50.006 [info] register SIP session for user [email protected] from ::ffff:109.147.134.30
16:52:50.006 [debug] SIP [tls/out] ::ffff:10.0.19.30:5061 -> ::ffff:109.147.134.30:57353:
SIP/2.0 200 OK
Via: SIP/2.0/TLS 109.147.134.30:57353;branch=z9hG4bKPjK2apGwnJpB9Cd5zKGRti4rYvjULof4De;alias;received=109.147.134.30;rport=57353
Max-Forwards: 70
From: <sip:[email protected]>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18861 REGISTER
To: <sip:[email protected]>;tag=376234652-661717022
Server: ejabberd 18.01
Contact: <sip:[email protected]:57353;transport=TLS;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00000163161a>";expires=600
Require: outbound
Flow-Timer: 120
Content-Length: 0

IPv6 logs that don't respond

16:56:29.212 [info] (<0.726.0>) Accepted connection 2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf:57363 -> 2a05:d018:b31:4601:ecbc:1d37:4979:a975:5061
16:56:29.223 [debug] SIP [tls/in] 2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf:57363 -> 2a05:d018:b31:4601:ecbc:1d37:4979:a975:5061:

16:56:29.279 [debug] SIP [tls/in] 2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf:57363 -> 2a05:d018:b31:4601:ecbc:1d37:4979:a975:5061:

16:56:29.340 [debug] SIP [tls/in] 2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf:57363 -> 2a05:d018:b31:4601:ecbc:1d37:4979:a975:5061:
REGISTER sip:example.net;transport=tls SIP/2.0
Via: SIP/2.0/TLS [2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf]:57363;rport;branch=z9hG4bKPjHozxzs4HxITTX7oRGt8zBFBDyDa22xsZ;alias
Max-Forwards: 70
From: <sip:[email protected]>;tag=GiBO-c7Iml8rnryfSiD7kYrxM8cU69Ze
To: <sip:[email protected]>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18862 REGISTER
Supported: outbound, path
Contact: <sip:[email protected]:57353;transport=TLS;ob>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00000163161a>"
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

aylesm avatar Nov 07 '18 17:11 aylesm