Open Andy-2639 opened 7 years ago
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?
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.
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?
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.
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.
I'm not sure I can help because I don't have windows installed and IPv6 works fine for me on Linux.
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.
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:xram@zinid.ru;tag=4cc1fd1f
To: sip:xram@zinid.ru
Call-ID: 1287781663@198.211.126.52
CSeq: 1 REGISTER
Content-Length: 0
Max-Forwards: 70
User-Agent: sipsak 0.9.7pre
Expires: 15
Contact: sip:xram@198.211.126.52: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:xram@zinid.ru>;tag=4cc1fd1f
Call-ID: 1287781663@198.211.126.52
CSeq: 1 REGISTER
Max-Forwards: 70
To: <sip:xram@zinid.ru>;tag=2332915767-1429473788
Server: ejabberd 17.09.121
WWW-Authenticate: Digest realm="zinid.ru", qop="auth", nonce="8aa552d7fd797fec03f613ef91f856859d72ec97"
Content-Length: 0
I have tried on two Linux machines, btw.
Have you tested over TLS?
Yes, it works as well.
Have you enabled debug (loglevel: 5
)? What do you see in the log?
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.
This is strange because you should see data_out
log message within 32 seconds max.
Also, what if you don't use TLS? Does plain TCP or UDP work with IPv6?
Same result with UDP. Haven't tried TCP at this point.
:disappointed:
@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?
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.
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: {}
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 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.
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 notifications@github.com Date: 1/6/18 11:12 AM (GMT-05:00) To: processone/ejabberd ejabberd@noreply.github.com Cc: sbourji sbourji@live.com, Mention mention@noreply.github.com 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.
If there is nothing on the wire, how is it supposed to work? Packets don't arrive at server, of course nothing would work.
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 notifications@github.com Date: 1/6/18 5:57 PM (GMT-05:00) To: processone/ejabberd ejabberd@noreply.github.com Cc: sbourji sbourji@live.com, Mention mention@noreply.github.com 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.
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 notifications@github.com 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.
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 notifications@github.com 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 notifications@github.com Date: 1/6/18 5:57 PM (GMT-05:00) To: processone/ejabberd ejabberd@noreply.github.com Cc: sbourji sbourji@live.com, Mention mention@noreply.github.com 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.
OK, I close the issue then
@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.
@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:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
To: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18860 REGISTER
Supported: outbound, path
Contact: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@192.168.1.141: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:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18860 REGISTER
To: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;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:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
To: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18861 REGISTER
Supported: outbound, path
Contact: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@109.147.134.30: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 31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net 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:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=v.mLBqTZ0I.MwHEu-m6OhoM1dE3Y8-Fx
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18861 REGISTER
To: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=376234652-661717022
Server: ejabberd 18.01
Contact: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@109.147.134.30: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:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>;tag=GiBO-c7Iml8rnryfSiD7kYrxM8cU69Ze
To: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@example.net>
Call-ID: Ror6yV37CazB76miig4Zg2mYm51tLvV4
CSeq: 18862 REGISTER
Supported: outbound, path
Contact: <sip:31bb60bd-bbde-4641-b86d-b4538a4a8108@109.147.134.30: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
@zinid Your test is also incorrect. You are testing an IPv4 client on an IPv6 connection. The CONTACT and VIA headers should represent an IPv6 address. Are you sure the server is parse these header fields correctly for IPv6?
@aylesm yes, I actually was able to reproduce the issue. I will reopen it and will try to fix it ASAP.
@zinid any update on this? Is there anything I can do to help?
HI @zinid ... can you give us a pointer as to where in the code this is failing please? I might be able to submit a PR, but any help getting started would be great.
@zinid More info, I've managed to track down the issue. You're not parsing IPv6 addresses at all it seems.
This function is wrong (esip_codec.hrl):
decode_uri_host(Data, URI) ->
case split(Data, $;, 1) of
[_] ->
case split(Data, $?, 1) of
[HostPort, Tail] ->
Headers = decode_param_hdrs(Tail),
Params = [];
[HostPort] ->
Headers = Params = []
end;
[HostPort, Tail] ->
case split(Tail, $?, 1) of
[Ps, Hs] ->
Headers = decode_param_hdrs(Hs),
Params = decode_params(Ps);
[Ps] ->
Headers = [],
Params = decode_params(Ps)
end
end,
case split(HostPort, $:, 1) of
[Host, Port] ->
case to_integer(Port, 0, 65535) of
{ok, PortInt} ->
URI#uri{host = to_lower(Host), port = PortInt,
params = Params, hdrs = Headers};
_ ->
error
end;
[Host] ->
URI#uri{host = to_lower(Host), params = Params, hdrs = Headers}
end.
Results in values:
Host == < Host = <<"[2a01">>
Port == < Port = <<"4c8:1c:51fe:bc0c:bff9:b11b:cfcf]:57363">>
From input of:
HostPort == < HostPort = <<"[2a01:4c8:1c:51fe:bc0c:bff9:b11b:cfcf]:57363">>
@zinid Looks like there is an internal server error with a IPv6 -> IPv6 call. My assumption is that the record for the remote peer is incorrectly formatted. So when you come to lookup and route the request it fails causing a 500 internal server error.
Any tips about where to look for this one?
Any movement on this?
Yes, sorry for the delay, I'll fix it ASAP (by upcoming ejabberd 19.05).
Any updates? I also tried to connect to ejabberd SIP service over IPv6 using both a Windows computer and an android phone without success. With debug log level, the registering requests are received by the server but are also never answered. Using Debian buster official native package (18.12.1).
Still no luck with 19.08 release. With android native client the registering process times out as ever before. log.txt
@oksjd what client is this? Tried Baresip or Linphone yet?
@licaon-kter That's android bulit-in SIP, in the native phone app. Just tried Linphone from F-Droid, stuck at "connection in progress" linphone.txt Baresip has no log on server at all.
@oksjd this is my config that works ok on IPv4, maybe it helps: https://gist.github.com/edbc6629722fa1651d47924e15472bf0
@licaon-kter Thanks for your config, however without explicitly specifying the listening port as :: for sip module, as in your config, the module won't even listen on ipv6. Telnet on the port show a "connection refused". I can only test ipv6 since this ejabberd instance is set up at home, where the fibre optics has carrier grade NAT. The xmpp domain has only one AAAA record and several SRV and TLSA records.
@oksjd Add ::
as needed, right.
There is a bug in ejabberd. The SIP module fails to parse IPv6 addresses properly. I’ve forked the sip module and patched this. Still waiting for processOne to merge.
Sent from my iPhone
On 31 Aug 2019, at 12:42, Licaon_Kter notifications@github.com wrote:
@oksjd Add :: as needed, right.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@aylesm Which PR is it ?
From what I understand the PR cannot be applied as is as it is said to not be working for all cases and should probably have tests. We had not time yet to work on it to make a proper fix.
At this date (20-01-27), any news about this problem? Several ISP now give only IPv6 address...
https://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/17.03/ejabberd-17.03-windows-installer.exe
Windows 10 Pro x64 Anniversary Update (Version 1607 Build 14393.969)
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: