Trunk without registration on FreePBX 16

Hello, everyone.

I’m migrating my telephony from a commercial platform to FreePBX.
All registered trunks from various providers migrated fine.
There’s still a toll-free number that we received through a trunk without registration, and I can’t get this trunk up and running.
I’ve created a routing for it.

The provider says they’re sending me traffic, but I’m not receiving anything in return.

The provider sent me a sample setup for pure Asterisk as support, but I have FreePBX 16, and there’s no field to enter a portion of the Asterisk configuration. There are only fields for entering specific values, but not all the necessary ones.

I need help: how do I implement the following configuration on FreePBX 16?

Or can I enter it directly into the Asterisk configuration?
Won’t FreePBX overwrite the Asterisk configuration I’ve written?

PEER Details
disallow=all
context=default
allow=ulaw,alaw,g729
bindaddr=0.0.0.0
bindport=5060
srvlookup=yes
echocancel=no
dtmfmode=rfc2833
qualify=yes
insecure=invite,port

USER Context
reinvite=yes
host=xxx.xxx.xxx.xxx&xxx.xxx.xxx.yyy
port=5060
insecure=invite,port
type=friend

Hello friend,

I believe that trunk provider should help you a bit more with this. Do you really need to keep that trunk?

Regardless, I believe this is a Chan_SIP so you would put in Outgoing:

type=peer
host=xxx.xxx.xxx.xxx
disallow=all
allow=ulaw,alaw,g729
dtmfmode=rfc2833
qualify=yes
insecure=invite,port
context=from-trunk

You might need to duplicate for a second host.

Incoming/User Details:

reinvite=yes
host=xxx.xxx.xxx.xxx&xxx.xxx.xxx.yyy
port=5060
insecure=invite,port
type=friend

Hopefully you can figure out from here. I am not the most expert in this myself…

This doesn’t look like pure Asterisk; it looks like an attempt to give a FreePBX configuration for the, obsolete, chan_sip driver.

It also contains obvious mistakes, which make me think it cannot be trusted, specifically:

Only one host address is possible in chan_sip. (chan_pjsip allows multiple source addresses, but, I think is still restricted to one destination.)

This is ignored without a secret. insecure=port is rarely needed, unless using TCP, or TLS, and tends to indicate the starting point for the configuration was copy and paste, without considering the meaning.

type=friend was over-used, and needs a specific section name, to give the user name. That section name needs to appear in the From header, from the provider, which is rather unlikely, otherwise this just degenerates to type=peer, with an added security vulnerability.

I’m fairly sure that this was never a valid alternative. The deprecated form of this is canreinvite, and the official current one is directmedia. Turning this on for a provider is unusual, and most FreePBX configurations do things that make it ineffective, as FreePBX tends to need access to the media stream. It isn’t going to necessary to fix your problem.

I think this will only have an effect if you used domain names, rather than IP addresses, and I believe chan_sip support for this is limited.

Generally, if you are using the two sections chan_sip method, you need to duplicate more settings than are shown here, between the two. chan_sip doesn’t always need the in and out hack, but chan_pjsip can handles cases where the former needs it, but without two sections.

I would remove g729, unless you have a specific need for it.

You’ve already said that there is no registration. That configuration indicates there is no authentication. I’d try the chan_psjip configuration, with server set to “xxx.xxx.xxx.xxx”, and match/permit set to “xxx.xxx.xxx.xxx,xxx.xxx.xxx.yyy”. Set both registration and authentication to none.

If it doesn’t work, provide us with the full log, and use the cli command “pjsip set logger on”, to allow capture of the SIP exchange.

If you think “reinvite” will be needed, enable direct media, however, if it is really needed, you are going to have to disable lots of features.

1 Like

Also, are you behind NAT? If so, what have you done to compensate for that?