Link to home
Start Free TrialLog in
Avatar of klukac
klukac

asked on

xlite client fails to authenticate to asterisk server

I just got asterisk running on my linux server and I'm trying to establish a connection with an xlite client on my LAN.  When xlite attempts to log on, asterisk displays this error:
chan_sip.c:10879 handle_request_register: Registration from 'My Name <sip:2007@my.domain>' failed for 10.0.1.106' - User name / auth name mismatch

Following the O'Reilly book on Asterisk, my sip.conf file looks like this:
(the lan is nat'd, but the connection is internal - I'm not testing that part of the network yet, although my pix allows 5060 and 5004 connections)
[general]
context=default
srvlookup=yes

[2007]  
type=user
secret=hello
qualify=yes
nat=no
host=10.0.1.106
canreinvite=no
context=internal

My extensions.conf file shows:
[internal]
exten => 100,1,Dial(SIP/2007)
exten => 611,1,Echo()

And my xlite log file shows this:

© 2004 Xten Networks, Inc. All rights reserved.

X-Lite release 1105d build stamp 99999

License key: 7BAE08E072302C24E8D2D3887CD42FAC



Established SIP protocol listen on: 10.0.1.106:5060



SIP: 10.0.1.106:5060

RTP: 10.0.1.106:5004

NAT: 10.0.1.106



Discovered Blocked Firewall



PROXY#0: 10.0.1.104:5060





SEND TIME: 2059337154

SEND >> 10.0.1.104:5060

REGISTER sip:my.domain SIP/2.0

Via: SIP/2.0/UDP 10.0.1.106:5060;rport;branch=z9hG4bK398DABCFD4D0DA05780C978E8CBBE29D

From: My Name <sip:2007@my.domain>;tag=1362010897

To: My Name <sip:2007@my.domain>

Contact: "My Name" <sip:2007@10.0.1.106:5060>

Call-ID: 0B2AE56E582AF5CE562A69C9A64825E8@my.domain

CSeq: 45073 REGISTER

Expires: 1800

Max-Forwards: 70

User-Agent: X-Lite release 1105d

Content-Length: 0





RECEIVE TIME: 2059337155

RECEIVE << 10.0.1.104:5060

SIP/2.0 404 Not found

Via: SIP/2.0/UDP 10.0.1.106:5060;branch=z9hG4bK398DABCFD4D0DA05780C978E8CBBE29D;received=10.0.1.106;rport=5060

From: My Name <sip:2007@my.domain>;tag=1362010897

To: My Name <sip:2007@my.domain>;tag=as706d5f7b

Call-ID: 0B2AE56E582AF5CE562A69C9A64825E8@my.domain

CSeq: 45073 REGISTER

User-Agent: Asterisk PBX

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY

Contact: <sip:2007@10.0.1.104>

Content-Length: 0


My xlite configuration looks pretty straightforward, but if you need I can send entries for that too.  Let me know what's wrong, thanks.
ASKER CERTIFIED SOLUTION
Avatar of Frabble
Frabble
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I suggest you also have a look at the Diax IAX based client. It is much easier to setup and as it used the IAX client there are far fewer problems running it remotely with firewalls and NAT.
Avatar of klukac
klukac

ASKER

Frabble I had tried that earlier and many more asterisk errors appeared.  Here they are:
*CLI> Apr  9 11:31:24 NOTICE[19256]: chan_sip.c:11389 sip_poke_noanswer: Peer '2007' is now UNREACHABLE!  Last qualify: 0
Apr  9 11:31:54 ERROR[19256]: chan_sip.c:6401 register_verify: Peer '2007' is trying to register, but not configured as host=dynamic
Apr  9 11:31:54 NOTICE[19256]: chan_sip.c:10879 handle_request_register: Registration from 'Christine Kluka <sip:2007@meucci.us>' failed for '10.0.1.106' - Username/auth name mismatch
Apr  9 11:32:02 NOTICE[19256]: chan_sip.c:9714 handle_response_peerpoke: Peer '2007' is now REACHABLE! (5ms / 2000ms)
Apr  9 11:32:14 ERROR[19256]: chan_sip.c:6401 register_verify: Peer '2007' is trying to register, but not configured as host=dynamic
Apr  9 11:32:14 NOTICE[19256]: chan_sip.c:10879 handle_request_register: Registration from 'Christine Kluka <sip:2007@meucci.us>' failed for '10.0.1.106' - Username/auth name mismatch

This time, after following your advice and changing the setting back to type=friend, I changed my account in sip.conf to show host=dynamic and xlite shows that I'm logged in.  

Now I'm trying to make an actual call, starting with an echo test (all I get is a ring tone or a busy signal) but that's another question, wouldn't want to push my luck too far ;)  

But before closing this one out, I'd like to understand why a dynamic host is key to sip authentication - it seems to me that it would be easier to authenticate from a static address than from a dynamic one, although it would be unusual to get incoming calls from fixed ips.  

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of klukac

ASKER

Thanks - the Asterisk book from O'Reilly, which came recommended with my TDM400 card, says that you can limit an endpoint to a single IP address by replacing dynamic with the IP address.  That may be true, but not the way the rest of the options are set up in the book (for sip.conf etc)...
You have to be sure that the host is even dinamic or your static ip address of the computer ur running xlite. The other thing i suggest u should double check is the username and secret. U probably should include a line defining the username for 2007 sip extension,in sip.conf

username = yourusername

and fill the requested field for the username in the xlite gui