[SFLphone] Cannot connect to asterisk via sip and a vpn
Jan Wiele
jan at wiele.ath.cx
Tue Jan 19 18:30:19 EST 2010
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
More information about the SFLphone
mailing list