Accepted SIP peers

Hi Everyone,

FreePBX distro
Asterisk 11.8.1

I am having issues with a trunk from our SIP provider. The trunk has 10 DIDs.

Setting up and the trunk registers with no problem. Showing registered on my end and on the provider’s end. Calling the main number works with no issues. Calling out works with no issues. Inbound calling to any of the DIDs fails with “number not in service”.

Looking at the Asterisk console, I see the call coming in and coming from the correct DID number but showing “Received incoming SIP connection from unknown peer to (DID number)”.

Contacted provider and they told me that the main number always comes from the host listed as HOST=Whatever in the peer details of the trunk setup, but when any DID is dialed that traffic will come from one of several other switches of the provider.

We can lock down SIP traffic to only the provider’s IPs and then allow anonymous SIP connections on the Asterisk box and all works well but I’d really prefer not to do that.

The provider recommended duplicating the trunk for each of their IPs/FQDN and then setting the HOST=value on each one to a different IP or FQDN until we’d listed them all. That is not working.

I have setup quite a few Asterisk boxes of different flavors (Asterisk, Trixbox, FreePBX) and I usually don’t have any problems with trunks but haven’t delved in depth in Asterisk in several years so I am sure I’m missing something obvious. Is there a simple place to set the FQDN or IP address for all “good” peers to alleviate this problem or any other idea to resolve?



You could leave the host as dynamic and just test the fromdomain variable , assuming they always send the same domain string.

You ever post something and then know that you shouldn’t have? :wink: Stupid mistake on my part. Creating addition trunks worked to make the additional FQDNs “known” - WHEN I ENABLED THE TRUNKS! I apologize.

So, I know that works. Is there a simpler way to make the additional addresses known than to create these additional trunks?

Thanks again,

SkykingOH. I have tried setting host=dynamic and host=hostname&dynamic. The trunk will not register with either. So, I’ve setup a 2nd trunk and tried setting it as dynamic. Still no joy. I was able to keep from having to use a separate trunk for each hostname by setting up the second trunk as -
host=host2&host3&host4, etc.

Thanks for taking the time to answer!