Issues with Inbound route not working

Hello,

I just recently got my FreePBX server all up and running including my polycom phones. Were using a 40 channel sip trunk to place and receive outside calls. The outbound routes worked fine, but I’m having problems getting my in bound route to work. When I called the number I got a “This number is not in service message”. I decided to check the Asterisk log to see if it was asterisk saying that our our trunk. So i connect to the asterisk console and placed the call again and saw this:

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [[email protected]:1] NoOp("SIP/XXX.XXX.XXX.XXX-00000027", "Received incoming SIP connection from unknown peer to XXXXXXXXXX") in new stack
    -- Executing [[email protected]:2] Set("SIP/XXX.XXX.XXX.XXX-00000027", "DID=XXXXXXXXXX") in new stack
    -- Executing [[email protected]:3] Goto("SIP/XXX.XXX.XXX.XXX-00000027", "s,1") in new stack
    -- Goto (from-sip-external,s,1)
    -- Executing [[email protected]:1] GotoIf("SIP/XXX.XXX.XXX.XXX-00000027", "0?checklang:noanonymous") in new stack
    -- Goto (from-sip-external,s,5)
    -- Executing [[email protected]:5] Set("SIP/XXX.XXX.XXX.XXX-00000027", "TIMEOUT(absolute)=15") in new stack
Channel will hangup at 2012-08-28 08:28:27.127 EDT.
    -- Executing [[email protected]:6] Answer("SIP/XXX.XXX.XXX.XXX-00000027", "") in new stack
    -- Executing [[email protected]:7] Wait("SIP/XXX.XXX.XXX.XXX-00000027", "2") in new stack
Really destroying SIP dialog '[email protected]' Method: OPTIONS
    -- Executing [[email protected]:8] Playback("SIP/XXX.XXX.XXX.XXX-00000027", "ss-noservice") in new stack
    -- <SIP/XXX.XXX.XXX.XXX-00000027> Playing 'ss-noservice.ulaw' (language 'en')
    -- Executing [[email protected]:9] PlayTones("SIP/XXX.XXX.XXX.XXX-00000027", "congestion") in new stack
    -- Executing [[email protected]:10] Congestion("SIP/XXX.XXX.XXX.XXX-00000027", "5") in new stack
  == Spawn extension (from-sip-external, s, 10) exited non-zero on 'SIP/XXX.XXX.XXX.XXX-00000027'
    -- Executing [[email protected]:1] Hangup("SIP/XXX.XXX.XXX.XXX-00000027", "") in new stack
  == Spawn extension (from-sip-external, h, 1) exited non-zero on 'SIP/XXX.XXX.XXX.XXX-00000027'

So I know the call made it into the server, but my inbound route for that DID is not working.

The settings on the inbound route are as follows:

Description: Main
DID: XXXXXXXXXX (matches the DID the trunk is reporting)
CallerID Number: (blank)
CID Priority Route: unchecked
Alert Info: (blank)
CID name prefix: (blank)
Music On Hold: default
Signal RINGING: checked
Pause Before Answer: (blank)
Privacy Manager: no
Detect Faxes: yes
Fax Detection type: sip
Fax Detection Time: 4
Call Recording: allow
CID Lookup Source: none
Language: (blank)
Destination: IVR Main

Whats the next steps I should be doing to figure out why it’s not wanting to route the inbound calls?

Your trunk settings are wrong, I doubt it’s a registration issue:

Your trunk is not matching:

Received incoming SIP connection from unknown peer

The unknown peer part indicates this.

As Big Dicko sez you can also allow anonymous SIP.

You willl need to either register the inbound trunk with the provider or allow anonymous inbound calls if using ip based routing.

The trunk settings were given to me by the provider. They do IP based filtering. So i did have to set allow anonymous.

Though I have run into another issue some what related to this. The inbound route points to a IVR I set up. I’ve enabled Direct Dial to extensions. This works, but I have also added in a custom extension 3999 defined in the extensions_custom.conf file. From any extension it can be dialed and functions fine, but when trying to dial it from the IVR it reports back as invalid. After some digging I believe the “from-internal-custom” is not being included anywhere in “from-did-direct-ivr” definitions.

I’ve tired just adding in a include to the from-did-direct-ivr for the custom extension, but when i do that calling the IVR does this whole mess again playing “Your call can not be completed as dialed” I take the include out and reload asterisk then everything functions correctly.

Put you custom extension in

ext-local-custom

and/or

from-did-direct-ivr-custom

the IVR should find it in there. Or easier define your custom extension in the gui.

Adding it to ext-local-custom did not help. I have tired both a include to it and just simply moving all the programming for it under the ext-local-custom.

It just gives me a “invalid” response in the ivr.

---- Just saw your edit

I do have the custom extension defined in the gui. Under Admin > Custom Extensions unless there is another place i should be doing it. Though this not a normal “phone” extension it requires a authentication and then input from the caller. After the input it fires off and run a external program and based on that programs out put it does something else, and sort of repeats this a couple times. Then Hangs up when done.