Question : Problem with incoming calls using SIP URI

Hi all, new to this asterisk malarkey but I think I'm getting there.

I have managed to setup up a working asterisk system, behind a nat firewall. I have two users, and have managed to configure a sip trunk, incoming and outgoing using www.voiptalk.org

I simplified things a little, in order to get sip URI working. (I took out the sip trunk).

This pretty much left me with... (important bits picked out..)

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
== sip.conf ==

[general]
context=default
srvlookup=yes

[phone1]
type=friend
host=dynamic
context=users
secret=secret

[phone2]
type=friend
host=dynamic
context=users
secret=secret

== extensions.conf ==

[default]
exten => test,1,NoOp(Incoming call from unauthenticated SIP from ${CALLERID})
exten => test,2,Goto(incoming,s,1)

[incoming]
exten => s,1,Answer
exten => s,n,Goto(extensions,all,1)

[extensions]
exten => all,1,Dial(SIP/phone1&SIP/phone2)


That all seems fine to me - from looking at the examples I've seen etc.

So this is what happens in the packet trace...

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=z9hG4bK416a8efe;rport
Max-Forwards: 69
From: "Test User" <sip:[email protected]>;tag=as1b65e9e6
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.9
Date: Wed, 21 Jul 2010 09:44:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 283

v=0
o=root 1513486040 1513486040 IN IP4 4.4.4.4
s=Asterisk PBX 1.6.2.9
c=IN IP4 4.4.4.4
t=0 0
m=audio 16002 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


and the response from the pbx is...

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 4.4.4.4:5060;branch=z9hG4bK416a8efe;rport
From: "Test User" <sip:[email protected]>;tag=as1b65e9e6
To: <sip:[email protected]>;tag=as6c48917c
Call-ID: [email protected]
CSeq: 102 INVITE
Server: Asterisk PBX 1.6.2.9
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="09db0c24"
Content-Length: 0


Now - I understand that the response is basically asking for authorisation - but I'm confused as to why it would.

Any suggestions please ?

Thanks very much !

Answer : Problem with incoming calls using SIP URI

Hello, add:

unsecure=port,invite

To your test user. And read about "Asterisk peer matching" it is important.
Random Solutions  
 
programming4us programming4us