solved: incoming calls on sip trunk 401 unauthorised

Get help with installing and running AsteriskNOW.

Moderators: Moderator, Support

solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Thu Nov 17, 2011 6:24 am

this thread was originally on asterisk support but I was asked to move it here:
using asterisk-gui I'm having difficulty trying to get asterisk 1.8 to accept incoming sip calls from my sip provider. Outbound calls work fine. Port 5060 is forwarded correctly in the router and if I watch wireshark during an inbound call the asterisk machine always rejects the call with '401 unauthorised'. I've set up an incoming call rule to an extension number but it doesn't work. I've also watched a debug scroll but that doesn't show me why asterisk rejects the call. The main problem is I can't find any straightforward steps anywhere on google that shows how to configure this in the asterisk-gui v 1.8. Most pages are from years ago with outdated info. Thanks if anyone can help.
Last edited by tonj on Thu Nov 17, 2011 6:02 pm, edited 1 time in total.
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: incoming calls on sip trunk 401 unauthorised

Postby tonj » Thu Nov 17, 2011 6:00 pm

I solved it, so for the benefit of others here's the steps that worked:
in the asterisk-gui (v1.8) click 'incoming call rules' in the left hand column
these are the entries you need for a new incoming call rule:
trunk: select your trunk from the drop down list
time interval: none
pattern: s
destination: choose your extension from the drop down list
in your router you need to forward port 5060 to the ip address of your asterisk machine
after you've done all this it probably still won't work (didn't for me) so the final thing is:
open up users.conf and find the section that pertains to your sip provider.
add these two lines at the end:
insecure=port,invite
fromdomain=sipprovider.com <---your sip provider domain
calls to your sip number should now make the extension ring.
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby mgazelle » Wed Dec 07, 2011 7:46 am

I have done these steps, but I still get the same message:
NOTICE[30943]: chan_sip.c:20785 handle_request_invite: Call from '' to extension 'xxxxxxxxx' rejected because extension not found in context 'default'
All configuration has been done by Asterisk GUI
mgazelle
Newsterisk
 
Posts: 5
Joined: Wed Dec 07, 2011 7:44 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Wed Dec 07, 2011 8:39 am

ok, I'm no expert but does extension 'xxxxxxxxx' actually work? does it show as registered and up in asterisk gui? (does it have the green dot next to it), can you call this extension from another extension?
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby mgazelle » Sat Dec 10, 2011 4:00 pm

xxxx is in this case my DID like 3312345676, the number I am calling.
I was able to get this running using freepbx on other hosts, but I am still having issues using the Asterisk GUI.

Here is the debug:


CLI> sip set debug on
SIP Debugging enabled

<--- SIP read from UDP:192.168.1.7:5086 --->

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

<--- SIP read from UDP:192.168.1.7:5068 --->

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

<--- SIP read from UDP:10.10.10.10:5060 --->
INVITE sip:31703097761@siptst.gazelle-technologies.net SIP/2.0
Record-Route: <sip:10.10.10.10;lr;ftag=as5288bf16>
Record-Route: <sip:20.20.20.20;lr>
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bKc558.02242c87.0
Via: SIP/2.0/UDP 20.20.20.20;branch=z9hG4bKc558.b31cbfa4.0
Via: SIP/2.0/UDP 30.30.30.30:5060;branch=z9hG4bK5cf203b8
Max-Forwards: 68
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as5288bf16
To: <sip:33987654321@proxy1.sip.sipprovider.nl:5060>
Contact: <sip:33123456789@30.30.30.30:5060>
Call-ID: 65b6ae983a5b0f7153cf19ab1f6e3975@30.30.30.30:5060
CSeq: 103 INVITE
User-Agent: FPBX-2.8.1(1.8.7.0)
Date: Sat, 10 Dec 2011 21:46:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H
Content-Type: application/sdp
Content-Length: 260
Supported: replaces

v=0
o=root 1902661069 1902661070 IN IP4 30.30.30.30
s=Asterisk PBX 1.8.7.0
c=IN IP4 30.30.30.30
t=0 0
m=audio 19638 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

<------------->
--- (18 headers 12 lines) ---
== Using SIP RTP CoS mark 5
Sending to 10.10.10.10 : 5060 (no NAT)
Using INVITE request as basis request - 65b6ae983a5b0f7153cf19ab1f6e3975@176.9.3 5.180:5060
No matching peer for '33123456789' from '10.10.10.10:5060'
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0xc (ulaw|alaw)/video=0x 0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone -event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 30.30.30.30:19638
Looking for 31703097761 in DLPN_siptst (domain siptst.gazelle-technologies.net)

<--- Reliably Transmitting (no NAT) to 10.10.10.10:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bKc558.02242c87.0;received=193.169. 138.200
Via: SIP/2.0/UDP 20.20.20.20;branch=z9hG4bKc558.b31cbfa4.0
Via: SIP/2.0/UDP 30.30.30.30:5060;branch=z9hG4bK5cf203b8
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as5288bf16
To: <sip:33987654321@proxy1.sip.sipprovider.nl:5060>;tag=as051390d2
Call-ID: 65b6ae983a5b0f7153cf19ab1f6e3975@30.30.30.30:5060
CSeq: 103 INVITE
Server: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<------------>
[Dec 10 22:46:52] NOTICE[3497]: chan_sip.c:20785 handle_request_invite: Call fro m '' to extension '31703097761' rejected because extension not found in context 'DLPN_siptst'.
Scheduling destruction of SIP dialog '65b6ae983a5b0f7153cf19ab1f6e3975@176.9.35. 180:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:10.10.10.10:5060 --->
ACK sip:31703097761@siptst.gazelle-technologies.net SIP/2.0
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bKc558.02242c87.0
Max-Forwards: 68
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as5288bf16
To: <sip:33987654321@proxy1.sip.sipprovider.nl:5060>;tag=as051390d2
Call-ID: 65b6ae983a5b0f7153cf19ab1f6e3975@30.30.30.30:5060
CSeq: 103 ACK
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '65b6ae983a5b0f7153cf19ab1f6e3975@30.30.30.30:5060 ' Method: ACK

<--- SIP read from UDP:10.10.10.10:5060 --->
INVITE sip:31703097761@siptst.gazelle-technologies.net SIP/2.0
Record-Route: <sip:10.10.10.10;lr;ftag=as1af1ad08>
Record-Route: <sip:193.169.138.26;lr>
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bK916b.e5835e31.0
Via: SIP/2.0/UDP 193.169.138.26;branch=z9hG4bK916b.ecb758a4.0
Via: SIP/2.0/UDP 30.30.30.30:5060;branch=z9hG4bK6ba11426
Max-Forwards: 68
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as1af1ad08
To: <sip:33987654321@proxy2.sip.sipprovider.nl:5060>
Contact: <sip:33123456789@30.30.30.30:5060>
Call-ID: 04f4973647f164937fbb1dd42d703aa6@30.30.30.30:5060
CSeq: 103 INVITE
User-Agent: FPBX-2.8.1(1.8.7.0)
Date: Sat, 10 Dec 2011 21:46:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H
Content-Type: application/sdp
Content-Length: 260
Supported: replaces

v=0
o=root 1295100043 1295100044 IN IP4 30.30.30.30
s=Asterisk PBX 1.8.7.0
c=IN IP4 30.30.30.30
t=0 0
m=audio 17974 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

<------------->
--- (18 headers 12 lines) ---
== Using SIP RTP CoS mark 5
Sending to 10.10.10.10 : 5060 (no NAT)
Using INVITE request as basis request - 04f4973647f164937fbb1dd42d703aa6@176.9.3 5.180:5060
No matching peer for '33123456789' from '10.10.10.10:5060'
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0xc (ulaw|alaw)/video=0x 0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone -event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 30.30.30.30:17974
Looking for 31703097761 in DLPN_siptst (domain siptst.gazelle-technologies.net)

<--- Reliably Transmitting (no NAT) to 10.10.10.10:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bK916b.e5835e31.0;received=193.169. 138.200
Via: SIP/2.0/UDP 193.169.138.26;branch=z9hG4bK916b.ecb758a4.0
Via: SIP/2.0/UDP 30.30.30.30:5060;branch=z9hG4bK6ba11426
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as1af1ad08
To: <sip:33987654321@proxy2.sip.sipprovider.nl:5060>;tag=as3db3db7e
Call-ID: 04f4973647f164937fbb1dd42d703aa6@30.30.30.30:5060
CSeq: 103 INVITE
Server: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<------------>
[Dec 10 22:46:52] NOTICE[3497]: chan_sip.c:20785 handle_request_invite: Call fro m '' to extension '31703097761' rejected because extension not found in context 'DLPN_siptst'.
Scheduling destruction of SIP dialog '04f4973647f164937fbb1dd42d703aa6@176.9.35. 180:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.7:5084 --->

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

<--- SIP read from UDP:10.10.10.10:5060 --->
ACK sip:31703097761@siptst.gazelle-technologies.net SIP/2.0
Via: SIP/2.0/UDP 10.10.10.10;branch=z9hG4bK916b.e5835e31.0
Max-Forwards: 68
From: "33123456789" <sip:33123456789@30.30.30.30>;tag=as1af1ad08
To: <sip:33987654321@proxy2.sip.sipprovider.nl:5060>;tag=as3db3db7e
Call-ID: 04f4973647f164937fbb1dd42d703aa6@30.30.30.30:5060
CSeq: 103 ACK
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '04f4973647f164937fbb1dd42d703aa6@30.30.30.30:5060 ' Method: ACK
siptst*CLI> sip set debug off
SIP Debugging Disabled
siptst*CLI> exit
Executing last minute cleanups
[root@siptst ~]#
mgazelle
Newsterisk
 
Posts: 5
Joined: Wed Dec 07, 2011 7:44 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Sat Dec 10, 2011 4:24 pm

'rejected because extension not found in context 'DLPN_siptst'
is there only one extension you're using? if it was me I'd set up another extension and get both extensions calling each other and working properly. That way you'll know the extension is definitely up and running properly. Once that is established you can then troubleshoot the incoming sip calls, but get that extension up and running first, and the only way to verify that is with another extension. Until then you're groping in the dark.
You don't need to buy more hardware to have another extension - you could run xlite (free) on a pc and use that as another extension.
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby mgazelle » Sat Dec 10, 2011 4:42 pm

There are 20 extensions working fine and I call make calls between all of them.
I can even call out, I just can not call my sip number
mgazelle
Newsterisk
 
Posts: 5
Joined: Wed Dec 07, 2011 7:44 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Sat Dec 10, 2011 5:58 pm

ok, post the section of your users.conf file that pertains to your sip provider. sanitise it first of course...
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby mgazelle » Sat Dec 10, 2011 6:08 pm

[trunk_4]
host = proxy2.sipprovider.nl
username = testuser
secret = pwd
trunkname = SIP PX2 ; GUI metadata
fromdomain=xx.xx.xx.xx
context = DID_trunk_4
hasexten = no
hasiax = no
hassip = yes
registeriax = no
registersip = yes
trunkstyle = voip
insecure = port,invite
canreinvite = no
fromuser = 33123456789
disallow = all
allow = g729,alaw,gsm,g726
mgazelle
Newsterisk
 
Posts: 5
Joined: Wed Dec 07, 2011 7:44 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Sat Dec 10, 2011 6:24 pm

hmmm, your users.conf is a bit different to mine. Here's mine, maybe give it a try, sorry I can't be more helpful.

[sipprovider.org]
host = sipprovider.org
username = myusername
secret = mypasswd
trunkname = sipprovider.org
context = DID_sipprovider.org
hasexten = no
hasiax = no
hassip = yes
registeriax = no
registersip = yes
trunkstyle = voip
disallow = all
allow = all
insecure = port,invite
fromdomian = sipprovider.org
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby mgazelle » Sat Dec 10, 2011 6:26 pm

Could you please post the content of your context DID_sipprovider.org which is referenced in the block?
mgazelle
Newsterisk
 
Posts: 5
Joined: Wed Dec 07, 2011 7:44 am

Re: solved: incoming calls on sip trunk 401 unauthorised

Postby tonj » Sat Dec 10, 2011 6:41 pm

I'm a bit unclear as to what you meant but here is a snippet out of my extensions.conf file:

[DID_sipprovider.org]
include = DID_sipprovider.org_default
[DID_sipprovider.org_default]
exten = s,1,Goto(default,13,1) <--13 is the extension number that rings when a call comes in on sip trunk
[CallingRule_sip]
exten = _X,1,Macro(trunkdial-failover-0.3,${sipprovider.org}/${EXTEN:0},,sipprovider.org,)
tonj
Oldsterisk
 
Posts: 50
Joined: Tue Sep 06, 2011 3:55 am


Return to AsteriskNOW Support

Who is online

Users browsing this forum: No registered users and 1 guest