Inbound Call not work

16 posts / 0 new
Last post
chanty
chanty's picture
Inbound Call not work

I am having a two SIP account(022xxxxx1 and 022xxxxx2) from my ITSP. My FreePBX is under NAT. Outbound call is OK but I am not able to make Inbound call to work.
My configuration steps are as below:

1. Create Extension (ex: 101, 102)
2. Create SIP Trunk using 022xxxxx1 account
3. Create an Inbound Routes as below
Descrition: 022xxxxx1
DID number: 022xxxxx1
Fax Detect: NO
Set Destination: Extentions->101
Submit->Apply
4. Other setting are in default setting
5. Try to call from 022xxxxx2 to 022xxxxx1 to test but not work
6. I try see the Asterisk Log Files but I can not see any call come into my FreePBX

Did i miss anything? What should goes wrong?

Thanks,

chanty
chanty's picture
I had been working on this

I had been working on this for a long way. Now, it is just one more step to complete. Please, help.

dicko
dicko's picture
your point . . 6. I try see

your point . .

6. I try see the Asterisk Log Files but I can not see any call come into my FreePBX

suggests that either your firewall is not passing the call to astrisk or your vsp is not sending it to your firewall.

A little more detail as to how you set up your network (that includes routers) would help you get an answer.

chanty
chanty's picture
I did DNAT on my router as

I did DNAT on my router as below:

1. Proto = UDP, Dst.Address= (mypublic_ip), Dst.port=5060 --> FreePBX IP (Private_IP)
2. Proto = UDP, Dst.Address= (mypublic_ip), Dst.port=10001-20000 --> FreePBX IP (Private_IP)

and also config NAT Setting in Asterisk SIP Setting as below:

NAT = Yes
IP Configuration = Static
External IP = (mypublic_ip)
Internal IP = (my_private_LAN_ip)

FYI: sip show registry is Success state.

dicko
dicko's picture
then from the asterisk cli

then from the asterisk cli (
rasterisk
#wait for connection . . .
sip set debug on

)

will show connections from your provider when you get an incoming call,

if you don't see them as the call is made then you or the vsp did something wrong, if you do see them then what they say will "clue you"

chanty
chanty's picture
Yes, I can see log when call

Yes, I can see log when call coming in with "sip set debug on". Below are the log:
---------------------------------------------
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c:
<--- SIP read from UDP:203.176.131.8:5060 --->
INVITE sip:s@172.16.31.125:5060;cid=175 SIP/2.0
Via: SIP/2.0/UDP 203.176.131.8:5060;branch=z9hG4bK-d8754z-18fb574b438d7138-1---d8754z-;rport
Via: SIP/2.0/UDP 203.176.131.8:5061;branch=z9hG4bK73670ef937d067d1b709b083f1cdfc61;rport=5061
Max-Forwards: 69
Record-Route:
Contact: "Anonymous"
To:
From: ;tag=cd817637537ae295700b9eb8666de1c4
Call-ID: tcjE.xrVu.1qafd2qYsDW8UoBI1vYR05~o~o
CSeq: 200 INVITE
Expires: 300
Content-Disposition: session
Content-Type: application/sdp
User-Agent: Sippy
Content-Length: 327
cisco-GUID: 1944352642-3538751969-3183476770-430351960
h323-conf-id: 1944352642-3538751969-3183476770-430351960

v=0
o=Sippy 140464876 0 IN IP4 203.176.131.7
s=cpc_med
t=0 0
m=audio 46302 RTP/AVP 112 0 8 105 3 101
c=IN IP4 203.176.131.7
a=sendrecv
a=rtpmap:112 SILK/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 iLBC/8000
a=fmtp:105 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c: --- (17 headers 15 lines) ---
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c: Sending to 203.176.131.8:5060 (NAT)
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c: Using INVITE request as basis request - tcjE.xrVu.1qafd2qYsDW8UoBI1vYR05~o~o
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c: Found peer 'NextVoiz' for '022611818' from 203.176.131.8:5060
[2012-07-21 12:04:37] VERBOSE[7185] chan_sip.c:
<--- Reliably Transmitting (NAT) to 203.176.131.8:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 203.176.131.8:5060;branch=z9hG4bK-d8754z-18fb574b438d7138-1---d8754z-;received=203.176.131.8;rport=5060
Via: SIP/2.0/UDP 203.176.131.8:5061;branch=z9hG4bK73670ef937d067d1b709b083f1cdfc61;rport=5061
From: ;tag=cd817637537ae295700b9eb8666de1c4
To: ;tag=as0ccc9f65
Call-ID: tcjE.xrVu.1qafd2qYsDW8UoBI1vYR05~o~o
CSeq: 200 INVITE
Server: FPBX-2.10.1(1.8.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="39e7d1df"
Content-Length: 0
---------------------------------------------------
FYI: 203.176.131.8 is my VSP. 172.16.31.125 is my FreePBX.

I see something like "Contact: "Anonymous"" and "SIP/2.0 401 Unauthorized" . Does it mean anything?

I did config "Allow Anonymous Inbound SIP Calls? = Yes" in General Setting.

dicko
dicko's picture
"SIP/2.0 401 Unauthorized"

"SIP/2.0 401 Unauthorized" means that you do not authorize the call :-)

Either "register" against the VSP, or perhaps you will need to allow anonymous calls in your general settings and deploy a very restrictive firewall, especially as you are using a provider in Cambodia and that part of the world is notoriously full of voip hackers.

chanty
chanty's picture
I already allowed anonymous

I already allowed anonymous calls in General Setting but I still don't get incoming call. Any further check?

chanty
chanty's picture
Here is another debug

Here is another debug output:

--------------------------------------------------
[2012-07-24 00:26:33] VERBOSE[3493] chan_sip.c: Reliably Transmitting (no NAT) to 172.16.31.124:5060:
OPTIONS sip:101@172.16.31.124:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 172.16.31.125:5060;branch=z9hG4bK56d0e587
Max-Forwards: 70
From: "Unknown" (sip:Unknown@172.16.31.125);tag=as653c1a58
To: (sip:101@172.16.31.124:5060;transport=udp)
Contact: (sip:Unknown@172.16.31.125:5060)
Call-ID:

:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.10.1(1.8.13.0)
Date: Mon, 23 Jul 2012 17:26:33 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
--------------------------------------------------

What i noticed it "From: "Unknown" (sip:Unknown@172.16.31.125);tag=as653c1a58 ".

What does it mean?

dicko
dicko's picture
That there is no CallerID

That there is no CallerID attached to tha call.

chanty
chanty's picture
OK, does it have anything to

OK, does it have anything to do Incoming Call? or does Incoming call fail because of "SIP/2.0 401 Unauthorized" only? How to fix this "SIP/2.0 401 Unauthorized" ? I already run through debug (-vvvvvvvvvvr) but cannot any clue.

dicko
dicko's picture
I would start by allowing

I would start by allowing anonymous inbound connections (temporarily, and only if there is no "registration" option available fom your VSP).

Then create a "catch-all" inbound route, then you should see how asterisk /freepbx is processing the call more simple in a post mortem analysis of /vr/log/asterisk/full (providing your logger*.conf heirarchy is actually writing relevant detaials to that file)

SkykingOH
SkykingOH's picture
I would also delete all your

I would also delete all your trunks because if you explicitly match the inbound with a wrong secret or some other auth function it will stop and not check any other peers.

Scott Holtzman, CTO
Micro Advantage, Inc.

  • Hosted Open Source FreePBX
  • Hosted PBXTended
  • On Net connections for Time Warner and other Major Carriers
  • Asterisk FreePBX Consulting

    http://www.microadv.com

chanty
chanty's picture
Thanks for reply. I did as

Thanks for reply.

I did as below:

1. config to allow anonymous call=yes, DID=any and forward the incoming call to 101 extension which is any IPphone using 172.16.31.123.
2. I also tried to delete all information in User Context and User Detail. Still i can not see any weird log appear.
3. My FreePBX is 172.16.31.125

Below is the log that I got from /var/log/asterisk/full when I called from outside:

[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c:
<--- SIP read from UDP:172.16.31.123:5060 --->
REGISTER sip:172.16.31.125:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.31.123:5060;branch=z9hG4bK17858208872224111339;rport
From: 101 <sip:101@172.16.31.125:5060>;tag=160795492
To: 101 <sip:101@172.16.31.125:5060>
Call-ID:

CSeq: 5 REGISTER
Contact: <sip:101@172.16.31.123:5060>
Max-Forwards: 70
Expires: 60
User-Agent: huawei
Content-Length: 0

<------------->
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: --- (11 headers 0 lines) ---
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: Sending to 172.16.31.123:5060 (NAT)
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c:
<--- Transmitting (no NAT) to 172.16.31.123:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 172.16.31.123:5060;branch=z9hG4bK17858208872224111339;received=172.16.31.123;rport=5060
From: 101 <sip:101@172.16.31.125:5060>;tag=160795492
To: 101 <sip:101@172.16.31.125:5060>;tag=as69d3b3af
Call-ID:

CSeq: 5 REGISTER
Server: FPBX-2.10.1(1.8.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="72750ac2"
Content-Length: 0


<------------>
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: Scheduling destruction of SIP dialog '24356107655042-115961218530010@172.16.31.123' in 32000 ms (Method: REGISTER)
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c:
<--- SIP read from UDP:172.16.31.123:5060 --->
REGISTER sip:172.16.31.125:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.31.123:5060;branch=z9hG4bK8238767927951840;rport
From: 101 <sip:101@172.16.31.125:5060>;tag=160795492
To: 101 <sip:101@172.16.31.125:5060>
Call-ID:

CSeq: 6 REGISTER
Contact: <sip:101@172.16.31.123:5060>
Authorization: Digest username="101", realm="asterisk", nonce="72750ac2", uri="sip:172.16.31.125:5060", response="3bc4413f36685328b2cd4f7b655bf5ea", algorithm=MD5
Max-Forwards: 70
Expires: 60
User-Agent: huawei
Content-Length: 0

<------------->
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: --- (12 headers 0 lines) ---
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: Sending to 172.16.31.123:5060 (no NAT)
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: Reliably Transmitting (no NAT) to 172.16.31.123:5060:
OPTIONS sip:101@172.16.31.123:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.31.125:5060;branch=z9hG4bK529481e6
Max-Forwards: 70
From: "Unknown" <sip:Unknown@172.16.31.125>;tag=as0021ea29
To: <sip:101@172.16.31.123:5060>
Contact: <sip:Unknown@172.16.31.125:5060>
Call-ID:
:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.10.1(1.8.13.0)
Date: Tue, 24 Jul 2012 12:13:27 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c:
<--- Transmitting (no NAT) to 172.16.31.123:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.31.123:5060;branch=z9hG4bK8238767927951840;received=172.16.31.123;rport=5060
From: 101 <sip:101@172.16.31.125:5060>;tag=160795492
To: 101 <sip:101@172.16.31.125:5060>;tag=as69d3b3af
Call-ID:

CSeq: 6 REGISTER
Server: FPBX-2.10.1(1.8.13.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Expires: 60
Contact: <sip:101@172.16.31.123:5060>;expires=60
Date: Tue, 24 Jul 2012 12:13:27 GMT
Content-Length: 0


<------------>
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c: Scheduling destruction of SIP dialog '24356107655042-115961218530010@172.16.31.123' in 32000 ms (Method: REGISTER)
[2012-07-24 19:13:27] VERBOSE[3375] chan_sip.c:
<--- SIP read from UDP:172.16.31.123:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.31.125:5060;branch=z9hG4bK529481e6
From: Unknown <sip:Unknown@172.16.31.125>;tag=as0021ea29
To: <sip:101@172.16.31.123:5060>
Call-ID:
:5060
CSeq: 102 OPTIONS
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, REFER, NOTIFY, INFO, PRACK, UPDATE, MESSAGE
Content-Length: 0

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

?

chanty
chanty's picture
any input?

anyone, please. It is just one more step!

m4biz
m4biz's picture
I've the same problem.

I've the same problem.
Did you solved the issue?
Thanks in advance.