[SOLVED] Can't register a SIP hardphone

Hello,

I’ve got this problem and I don’t know what to do with it:

I have a Sip phone (Siemens C470IP) which works perfectly with different providers (iptel, betamax, ovh…). It also worked well with my testing server (ubuntu and inside the LAN).

The problem i have is that the hardphone doesn’t connect to my dedicated server (debian lenny / Asterisk 1.6.2.13). The strange thing is that ekiga can connect to the same asterisk server with the same SIP account.

Here is a part of my sip.conf :

[general]
dtmfmode=auto
language=fr ; pour les messages lus par asterisk
disallow=all
allow=ulaw
allow=alaw
allow=speex

[siemens]
type=friend
context=interne
host=dynamic
secret=xxxxxxxx

When i’m doing a sip set debug ip XXX.XXX.XXX.XXX i have some information. It seems that asterisk receives the rengistration request but doesn’t answer to it :

Debian-50-lenny-32-minimal*CLI> sip set debug ip 89.4.1xx.2xx
SIP Debugging Enabled for IP: 89.4.1xx.2xx
Debian-50-lenny-32-minimal*CLI> 
Debian-50-lenny-32-minimal*CLI> 
Debian-50-lenny-32-minimal*CLI> 

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->



<------------->

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---
[Nov 18 13:03:30] NOTICE[17316]: chan_sip.c:11601 sip_reregister:    -- Re-registration for  003397453xxxx@sip.ovh.net
       > doing dnsmgr_lookup for 'sip.ovh.net'
       > doing dnsmgr_lookup for 'sip.ovh.net'
[Nov 18 13:03:30] NOTICE[17316]: chan_sip.c:18334 handle_response_register: Outbound Registration: Expiry for sip.ovh.net is 120 sec (Scheduling reregistration in 105 s)

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---

<--- SIP read from UDP:89.4.1xx.2xx:61177 --->
REGISTER sip:server.exemple.com SIP/2.0
Via: SIP/2.0/UDP 192.168.0.50:5060;branch=z9hG4bK375a1a8b1ad99205b5e56896d094e0f1;rport
From: "siemens" <sip:siemens@server.exemple.com>;tag=661213739
To: "siemens" <sip:siemens@server.exemple.com>
Call-ID: 994182810@192_168_0_50
CSeq: 1 REGISTER
Contact: <sip:siemens@192.168.0.50:5060>
Max-Forwards: 70
User-Agent: C470IP022230000000
Expires: 180
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, REFER, SUBSCRIBE, NOTIFY
Content-Length: 0


<------------->
--- (12 headers 0 lines) ---
Debian-50-lenny-32-minimal*CLI>

Here is the registration log using Ekiga with the same SIP account (name is siemens) and from the same location. As you see the registration works:

[code]
<— SIP read from UDP:89.4.2xx.1xx:61772 —>
REGISTER sip:server.domain.com SIP/2.0
CSeq: 5 REGISTER
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKd71ac623-c502-1910-9d9a-000f66cf7cc5;rport
User-Agent: Ekiga/3.2.7
From: sip:siemens@server.domain.com;tag=b1c8c523-c502-1910-9d9a-000f66cf7cc5
Call-ID: b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi
To: sip:siemens@server.domain.com
Contact: sip:siemens@89.4.2xx.1xx:61772;q=1, sip:siemens@89.4.2xx.1xx;q=0.667, sip:siemens@192.168.0.10;q=0.334
llow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 3600
Content-Length: 0
Max-Forwards: 70

<------------->
— (12 headers 0 lines) —
Sending to 89.4.2xx.1xx : 61772 (no NAT)

<— Transmitting (no NAT) to 89.4.2xx.1xx:61772 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKd71ac623-c502-1910-9d9a-000f66cf7cc5;received=89.4.2xx.1xx;rport=61772
From: sip:siemens@server.domain.com;tag=b1c8c523-c502-1910-9d9a-000f66cf7cc5
To: sip:siemens@server.domain.com;tag=as3384ec04
Call-ID: b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi
CSeq: 5 REGISTER
Server: Asterisk PBX 1.6.2.13
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="78df32a9"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:89.4.2xx.1xx:61772 —>
REGISTER sip:server.domain.com SIP/2.0
CSeq: 6 REGISTER
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKdb2ec823-c502-1910-9d9a-000f66cf7cc5;rport
User-Agent: Ekiga/3.2.7
Authorization: Digest username=“siemens”, realm=“asterisk”, nonce=“78df32a9”, uri=“sip:server.domain.com”, algorithm=MD5, response="fec67185c669f9a966e67d5194284a93"
From: sip:siemens@server.domain.com;tag=b1c8c523-c502-1910-9d9a-000f66cf7cc5
Call-ID: b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi
To: sip:siemens@server.domain.com
Contact: sip:siemens@89.4.2xx.1xx:61772;q=1, sip:siemens@89.4.2xx.1xx;q=0.667, sip:siemens@192.168.0.10;q=0.334
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 3600
Content-Length: 0
Max-Forwards: 70

<------------->
— (13 headers 0 lines) —
Sending to 89.4.2xx.1xx : 61772 (no NAT)
– Registered SIP ‘siemens’ at 89.4.2xx.1xx port 61772
> Saved useragent “Ekiga/3.2.7” for peer siemens

<— Transmitting (no NAT) to 89.4.2xx.1xx:61772 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKdb2ec823-c502-1910-9d9a-000f66cf7cc5;received=89.4.2xx.1xx;rport=61772
From: sip:siemens@server.domain.com;tag=b1c8c523-c502-1910-9d9a-000f66cf7cc5
To: sip:siemens@server.domain.com;tag=as3384ec04
Call-ID: b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi
CSeq: 6 REGISTER
Server: Asterisk PBX 1.6.2.13
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Expires: 3600
Contact: sip:siemens@89.4.2xx.1xx:61772;expires=3600
Date: Thu, 18 Nov 2010 13:44:25 GMT
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘b1c8c523-c502-1910-9d99-000f66cf7cc5@cdi’ in 32000 ms (Method: REGISTER)

<— SIP read from UDP:89.4.2xx.1xx:61772 —>
SUBSCRIBE sip:siemens@server.domain.com SIP/2.0
CSeq: 2 SUBSCRIBE
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bK4ca0c823-c502-1910-9d9a-000f66cf7cc5;rport
User-Agent: Ekiga/3.2.7
From: sip:siemens@server.domain.com;tag=639cc823-c502-1910-9d9a-000f66cf7cc5
Call-ID: 7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi
To: sip:siemens@server.domain.com
Contact: sip:siemens@89.4.2xx.1xx:61772
Accept: application/simple-message-summary
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 3600
Event: message-summary
Content-Length: 0
Max-Forwards: 70

<------------->
— (14 headers 0 lines) —
Creating new subscription
Sending to 89.4.2xx.1xx : 61772 (no NAT)
list_route: hop: sip:siemens@89.4.2xx.1xx:61772
Found peer ‘siemens’ for ‘siemens’ from 89.4.2xx.1xx:61772

<— Transmitting (no NAT) to 89.4.2xx.1xx:61772 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bK4ca0c823-c502-1910-9d9a-000f66cf7cc5;received=89.4.2xx.1xx;rport=61772
From: sip:siemens@server.domain.com;tag=639cc823-c502-1910-9d9a-000f66cf7cc5
To: sip:siemens@server.domain.com;tag=as0f9d2526
Call-ID: 7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi
CSeq: 2 SUBSCRIBE
Server: Asterisk PBX 1.6.2.13
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="33349611"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi’ in 32000 ms (Method: SUBSCRIBE)

<— SIP read from UDP:89.4.2xx.1xx:61772 —>
SUBSCRIBE sip:siemens@server.domain.com SIP/2.0
CSeq: 3 SUBSCRIBE
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKbe11c923-c502-1910-9d9a-000f66cf7cc5;rport
User-Agent: Ekiga/3.2.7
Authorization: Digest username=“siemens”, realm=“asterisk”, nonce=“33349611”, uri="sip:siemens@server.domain.com", algorithm=MD5, response="4aa386369a65250b3c10a494a5b42da9"
From: sip:siemens@server.domain.com;tag=639cc823-c502-1910-9d9a-000f66cf7cc5
Call-ID: 7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi
To: sip:siemens@server.domain.com
Contact: sip:siemens@89.4.2xx.1xx:61772
Accept: application/simple-message-summary
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Expires: 3600
Event: message-summary
Content-Length: 0
Max-Forwards: 70

<------------->
— (15 headers 0 lines) —
Creating new subscription
Sending to 89.4.2xx.1xx : 61772 (no NAT)
Found peer ‘siemens’ for ‘siemens’ from 89.4.2xx.1xx:61772

<— Transmitting (no NAT) to 89.4.2xx.1xx:61772 —>
SIP/2.0 404 Not found (no mailbox)
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bKbe11c923-c502-1910-9d9a-000f66cf7cc5;received=89.4.2xx.1xx;rport=61772
From: sip:siemens@server.domain.com;tag=639cc823-c502-1910-9d9a-000f66cf7cc5
To: sip:siemens@server.domain.com;tag=as0f9d2526
Call-ID: 7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi
CSeq: 3 SUBSCRIBE
Server: Asterisk PBX 1.6.2.13
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0

<------------>
[Nov 18 14:44:26] NOTICE[17316]: chan_sip.c:21518 handle_request_subscribe: Received SIP subscribe for peer without mailbox: siemens
Really destroying SIP dialog ‘7a98c823-c502-1910-9d9a-000f66cf7cc5@cdi’ Method: SUBSCRIBE

<— SIP read from UDP:89.4.2xx.1xx:61772 —>
PUBLISH sip:siemens@server.domain.com SIP/2.0
CSeq: 7 PUBLISH
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bK81c3c823-c502-1910-9d9a-000f66cf7cc5;rport
User-Agent: Ekiga/3.2.7
From: sip:siemens@server.domain.com;tag=afbbc823-c502-1910-9d9a-000f66cf7cc5
Call-ID: dcb3c823-c502-1910-9d9a-000f66cf7cc5@cdi
To: sip:siemens@server.domain.com
Contact: sip:siemens@89.4.2xx.1xx:61772
Expires: 500
Event: presence
Content-Type: application/pidf+xml
Content-Length: 346
Max-Forwards: 70

<?xml version="1.0" encoding="UTF-8"?> online - I'm online using Ekiga open siemens@server.domain.com

<------------->
— (13 headers 10 lines) —

<— Transmitting (no NAT) to 89.4.2xx.1xx:61772 —>
SIP/2.0 501 Method Not Implemented
Via: SIP/2.0/UDP 89.4.2xx.1xx:61772;branch=z9hG4bK81c3c823-c502-1910-9d9a-000f66cf7cc5;received=89.4.2xx.1xx;rport=61772
From: sip:siemens@server.domain.com;tag=afbbc823-c502-1910-9d9a-000f66cf7cc5
To: sip:siemens@server.domain.com;tag=as62cfd18d
Call-ID: dcb3c823-c502-1910-9d9a-000f66cf7cc5@cdi
CSeq: 7 PUBLISH
Server: Asterisk PBX 1.6.2.13
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0

<------------>

<— SIP read from UDP:89.4.2xx.1xx:61772 —>

<------------->
Debian-50-lenny-32-minimal*CLI>[/code]

I didn’t change anything about asterisk config (except sip.conf and extensions.conf).
Thanks in advance…

in fact, it was just a NAT problem !
i add a stun server in the phone configuration and it works :smile: