Asterisk 1.8 and SIP Phone

Evening all,

I’ve finnally maanged to install asterisk 1.8 and get the gui working and even get a phone : )

however i can not call in or out.

I’m using a basic personal number from SIPgate rather tha nthe buisness scheme but i see no reason it shouldn’t work.

I’m getting this error

[i]
<------------->
— (18 headers 19 lines) —
Sending to 217.10.79.23:5060 (NAT)
Using INVITE request as basis request - 3ac1f8950444b4027a4af45d60cd83a4@sipgate.co.uk
Found peer ‘1531133’ for ‘07504614638’ from 217.10.79.23:5060

<— Reliably Transmitting (NAT) to 217.10.79.23:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 217.10.79.23:5060;branch=z9hG4bK3c1e.ff987d11.1;received=217.10.79.23;rport=5060
Via: SIP/2.0/UDP 172.20.40.1;branch=z9hG4bK3c1e.ff987d11.1
Via: SIP/2.0/UDP 217.10.79.23:5060;received=217.10.68.222;branch=z9hG4bK019ecb09
Via: SIP/2.0/UDP 217.116.117.5:5060;received=217.116.117.5;branch=z9hG4bK019ecb09;rport=5060
From: “07504******” sip:07504614638@sipgate.co.uk;tag=as4c8e7ff8
To: sip:00442392985126@sipgate.co.uk;tag=as3ddd28f7
Call-ID: 3ac1f8950444b4027a4af45d60cd83a4@sipgate.co.uk
CSeq: 102 INVITE
Server: Asterisk PBX 1.8.20.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="75cd5b98"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog '3ac1f8950444b4027a4af45d60cd83a4@sipgate.co.uk’ in 32000 ms (Method: INVITE)

<— SIP read from UDP:217.10.79.23:5060 —>
ACK sip:s@148.197.233.171:5060 SIP/2.0
Via: SIP/2.0/UDP 217.10.79.23:5060;branch=z9hG4bK3c1e.ff987d11.0
Via: SIP/2.0/UDP 172.20.40.1;branch=z9hG4bK3c1e.ff987d11.0
From: “0750461****” sip:07504614638@sipgate.co.uk;tag=as4c8e7ff8
Call-ID: 3ac1f8950444b4027a4af45d60cd83a4@sipgate.co.uk
To: sip:00442392985126@sipgate.co.uk;tag=as3e5e7b6d
CSeq: 102 ACK
Max-Forwards: 69
Content-Length: 0
X-hint: rr-enforced
[/i]

SIP.conf
user - my trunk is connecting fine. I think its to do with the user setup.
[userjoshua]
type=friend
username=joshua
fromuser=joshua ; Specify user to put in “from” instead of callerid
secret=joshua
context=outgoing
host=dynamic ; use either host=dynamic or defaultip=…
amaflags=default ; Choices are default, omit, billing, documentation
accountcode=joshua ; Users may be associated with an accountcode to ease billing
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=g723.1

Extensions.conf
[incoming]
exten => 1531133,1,Dial(SIP/userjoshua,60)
exten => 1531133,n,Hangup()

[outgoing]
exten => 1+NXXNXXXXXX.,1,Dial(SIP/${EXTEN}@sipgate.co.uk)
exten => 1+NXXNXXXXXX.,n,Hangup()

I believe it might be the fact, its something to do with the authorisation but can’t seem to think what it could be any help would be very grateful thank you.

i think you need to register the trunk by using register => username:password@host.com

Replace “secret” by “remotesecret”. (Historically the advice would have been to use insecure=invite.)

Also, ITSPs generally do not register with you, so you cannot use host=dynamic.

Also note that it is usually better to use type=peer.

There must already be a register=> line, otherwise the ITSP would not know how to send the INVITE to you.

401, in itself, is not an error; it simply tells the other side how to authenticate. The error is that you are expecting them to authenticate with you, when they have no intention of doing so.

Thank you for the replies, but i think you misunderstand me

that isn’t my whole sip.conf file, as i didn’t put in the trunk link, in which i use peer as i’ve already sorted that problem and i’m connected to my provider.
right ok i’ll change the host=dynamic,

When i call the number i get a constant tone on the phone of my mobile.

where as before it was saying its an wrong number.

the problem is its going from the provider to the asterisk box but not to the phone. i guess i’m guessing how to set up a user for a phone. as its not working.

the authentication is with the phone not the provider i’m already connected to SIPGate.

sorry if i was vague in my original post does this make it any better?

Thank you again.

The trace clearly shows you trying to get sipgate to authenticate itself, which it won’t do.

oh right… my bad, that’s a little weird as that message only comes up when i ring the phone, otherwise its fine. and i don’t get authentication errors. ok cool well i guess i’ll retrace my steps.