[SFLphone] Cannot connect to asterisk via sip and a vpn
Alexandre Savard
alexandre.savard at savoirfairelinux.com
Wed Jan 20 10:35:16 EST 2010
Hi,
We worked on this issue very recently (beginign of january), so I recommand you to use the nightly built version if you are not already using it.
https://launchpad.net/~savoirfairelinux/+archive/sflphone-nightly
Concerning your problem,
SFLphone creates a default SIP UDP transport at startup on port 5060. If you want to change this transport's settings, you need to go in Edit > Preference > Ip Calls and then restart SFLphone.
Once the default transport is created, SFLphone loads your account settings, and create new transport if required. If a transport is already created on a given port, no new transport will
be created and the current one will be used.
To make sure that a new SIP UDP transport with your requested settings will be created for an account, you should use a specific port number other than the default 5060.
OR, if you want to use your VPN for all your accounts, make the change for the default transport and make sure that all your accounts use the default transport's port number.
Thanks for this report, and give us some news about it.
Alexandre Savard
----- Mail Original -----
De: "Jan Wiele" <jan at wiele.ath.cx>
À: sflphone at lists.savoirfairelinux.net
Envoyé: Mardi 19 Janvier 2010 18h30:19 GMT -05:00 USA/Canada - États de l'Est
Objet: [SFLphone] Cannot connect to asterisk via sip and a vpn
Hi,
I'm trying to connect to my asterisk server via a OpenVPN.
I have the following ips:
"eth0" -> 192.168.1.10
"tun0" -> 10.8.0.18
The OpenVPN server has the adress 10.8.0.1.
When I try to connect asterisk logs this:
#########################################
<--- SIP read from UDP://10.8.0.18:5060 --->
REGISTER sip:10.8.0.1 SIP/2.0
Via: SIP/2.0/UDP
192.168.1.10:5060;rport;branch=z9hG4bKPjafdb9f53-fbf5-4294-aa2d-e9614a45480b
Max-Forwards: 70
From: <sip:janextern at 10.8.0.1>;tag=785e03b4-0c58-444f-b89b-ae41cb0e072b
To: <sip:janextern at 10.8.0.1>
Call-ID: 3d999067-54fa-4dbe-8f23-458212ce93bd
CSeq: 50460 REGISTER
User-Agent: sflphoned/0.9.6
Contact: "wielejan" <sip:janextern at 192.168.1.10:5060>
Expires: 600
Content-Length: 0
<------------->
--- (11 headers 0 lines) ---
Sending to 192.168.1.10 : 5060 (no NAT)
<--- Transmitting (no NAT) to 192.168.1.10:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.1.10:5060;branch=z9hG4bKPjafdb9f53-fbf5-4294-aa2d-e9614a45480b;received=10.8.0.18;rport=5060
From: <sip:janextern at 10.8.0.1>;tag=785e03b4-0c58-444f-b89b-ae41cb0e072b
To: <sip:janextern at 10.8.0.1>;tag=as0c960378
Call-ID: 3d999067-54fa-4dbe-8f23-458212ce93bd
CSeq: 50460 REGISTER
Server: Asterisk PBX 1.6.1.9
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="69154389"
Content-Length: 0
#########################################
With Twinkle it is working:
#########################################
<--- SIP read from UDP://10.8.0.18:5060 --->
REGISTER sip:10.8.0.1 SIP/2.0
Via: SIP/2.0/UDP 10.8.0.18;rport;branch=z9hG4bKfcchtzqc
Max-Forwards: 70
To: "Jan <sip:janextern at 10.8.0.1>
From: "Jan <sip:janextern at 10.8.0.1>;tag=uzhfj
Call-ID: bgtvsywndvmqfai at joplaptop
CSeq: 983 REGISTER
Contact: <sip:janextern at 10.8.0.18>;expires=3600
Allow:
INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
User-Agent: Twinkle/1.4.2
Content-Length: 0
<------------->
--- (11 headers 0 lines) ---
Sending to 10.8.0.18 : 5060 (no NAT)
<--- Transmitting (no NAT) to 10.8.0.18:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
10.8.0.18;branch=z9hG4bKfcchtzqc;received=10.8.0.18;rport=5060
From: "Jan <sip:janextern at 10.8.0.1>;tag=uzhfj
To: "Jan <sip:janextern at 10.8.0.1>;tag=as1daaf748
Call-ID: bgtvsywndvmqfai at joplaptop
CSeq: 983 REGISTER
Server: Asterisk PBX 1.6.1.9
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="510cbd7b"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog 'bgtvsywndvmqfai at joplaptop' in
32000 ms (Method: REGISTER)
freeman*CLI>
<--- SIP read from UDP://10.8.0.18:5060 --->
REGISTER sip:10.8.0.1 SIP/2.0
Via: SIP/2.0/UDP 10.8.0.18;rport;branch=z9hG4bKfumtltvv
Max-Forwards: 70
To: "Jan" <sip:janextern at 10.8.0.1>
From: "Jan" <sip:janextern at 10.8.0.1>;tag=uzhfj
Call-ID: bgtvsywndvmqfai at joplaptop
CSeq: 984 REGISTER
Contact: <sip:janextern at 10.8.0.18>;expires=3600
Authorization: Digest
username="janextern",realm="asterisk",nonce="510cbd7b",uri="sip:10.8.0.1",response="6f011aa54d6aada0324ff92481f0bd8b",algorithm=MD5
Allow:
INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
User-Agent: Twinkle/1.4.2
Content-Length: 0
<------------->
--- (12 headers 0 lines) ---
Sending to 10.8.0.18 : 5060 (no NAT)
-- Registered SIP 'janextern' at 10.8.0.18 port 5060
Reliably Transmitting (no NAT) to 10.8.0.18:5060:
OPTIONS sip:janextern at 10.8.0.18 SIP/2.0
Via: SIP/2.0/UDP 10.8.0.1:5060;branch=z9hG4bK54785a89;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk at 10.8.0.1>;tag=as3045c12c
To: <sip:janextern at 10.8.0.18>
Contact: <sip:asterisk at 10.8.0.1>
Call-ID: 3a72c15d1584152f76f59e4d11a8233e at 10.8.0.1
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.6.1.9
Date: Tue, 19 Jan 2010 23:11:49 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
#########################################
It looks like slfphone uses the wrong ip-adress ("Via: SIP/2.0/UDP
192.168.1.10:5060").i've set tun0 as the adapter to use.
When watching the traffic with wireshark between sflphone and asterisk
on the client side, no package appears from the server. sflphone only
repeats its register packages.
Any ideas?
Regards, Jan
_______________________________________________
SFLphone mailing list
SFLphone at lists.savoirfairelinux.net
http://lists.savoirfairelinux.net/mailman/listinfo/sflphone
More information about the SFLphone
mailing list