Help with inbound SIP calls

Hoping someone can help me with this.

Running latest FreePBX Distro with all patches applied. It is a plain vanilla FreePBX system.

I have 2 Polycom phones setup on the system and can make calls between the phones.

I have a SIP trunk setup to my system and can make outbound calls.

When I try to make inbound calls I get the following output from the Asterisk console. It appears that the calls are hitting my server but the phones do not ring and I get “the number you have dialed is not in service”.

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] NoOp(“SIP/”, “Received incoming SIP connection from unknown peer to 3096214220”) in new stack
– Executing [[email protected]:2] Set(“SIP/”, “DID=3096214220”) in new stack
– Executing [[email protected]:3] Goto(“SIP/”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [[email protected]:1] GotoIf(“SIP/”, “0?checklang:noanonymous”) in new stack
– Goto (from-sip-external,s,5)
– Executing [[email protected]:5] Set(“SIP/”, “TIMEOUT(absolute)=15”) in new stack
Channel will hangup at 2011-08-22 08:23:14.725 CDT.
– Executing [[email protected]:6] Answer(“SIP/”, “”) in new stack
– Executing [[email protected]:7] Wait(“SIP/”, “2”) in new stack
– Executing [[email protected]:8] Playback(“SIP/”, “ss-noservice”) in new stack
– <SIP/> Playing ‘ss-noservice.ulaw’ (language ‘en’)
– Executing [[email protected]:9] PlayTones(“SIP/”, “congestion”) in new stack
– Executing [[email protected]:10] Congestion(“SIP/”, “5”) in new stack
== Spawn extension (from-sip-external, s, 10) exited non-zero on ‘SIP/’
– Executing [[email protected]:1] Hangup(“SIP/”, “”) in new stack
== Spawn extension (from-sip-external, h, 1) exited non-zero on ‘SIP/’


I went into “Administration” and changed “Allow Anonymous Inbound SIP Calls” to yes and am able to make inbound calls. I am not sure why this worked but I don’t think I want to leave it this way.

It worked because it allowed the calls to come in without an associated peer.

Your trunk config is not matching the inbound call.

See post #5.

I do not understand what you mean when you say “my trunk config is not matching the inbound call”

I have a Asterisk box (non-FreePBX) that is working correctly with the same SIP trunks. Here is the config for the trunk I have on that Asterisk box


I have 15 Asterisk system in place but I just can’t wrap my head around getting this to work with FreePBX.

There is no context “from-sip” in FreePBX it has to be from-pstn.

Other than that you simply use the same peer settings in the trunk module as you would in Asterisk sip.conf

Thanks for your help

Here is what I have in my trunk config on FreePBX for outgoing settings. There is nothing in Incoming settings as I am not sure what to put there. I still get


Are the calls arriving in the correct context on your Asterisk only server or are they hitting your default context? This would be equivalent to FreePBX “allow anonymous SIP”

The inbound peer is used when your need a second peer for inbound (such as when you have to use type=user or the host is different). Incoming is a bad label, it’s just another peer to Asterisk. FreePBX uses the peer marked “outbound” for any calls to be originated from the trunk.

I changed sip_general_additional.conf line that reads context=from-sip-external to context=from-trunk. The only issue is it will reset back. It should be set under the FreePBX interface Tools/Asterisk SIP Settings section Advanced General Settings/Dafault Context. The problem is that field in the interface doesn’t let the value stick like it should. I ended up putting it in the same section under “Other SIP Settings” as context=from-trunk. It puts it down further in the sip_general_additional.conf and overrides the first context line it sees.

Why can’t you just change the context in the trunk? I don’t understand why you are having this difficulty.