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?

Thanks to everyone who responded! I’m considering switching providers, but only if all else fails.

The provider sent me a sample configuration for FreePBX, but it uses the chan_sip trunk, while FreePBX 16 only has chan_pjsip. I don’t understand how to implement this configuration on my version, since I don’t have the necessary settings fields.

Outgoing conf:

Options for PEER:

type=peer
remotesecret=Pa$sword
nat=force_rport,comedia
insecure=invite,port
host=123456.xx.xx
fromuser=12345678
fromdomain=123456.xx.xx
dtmfmode=rfc2833
directmedia=no
defaultuser=12345678
disallow=all
allow=ulaw&alaw
qualify=15000

Incoming conf:

Registration string: 12345678:[email protected]

Can I do this on the FreePBX 16? Or can I downgrade on an old version?

Thank you for the answer! I’m not behind NAT.

Can I use chan_sip on FreePBX 16? This could be a solution, since the examples the provider sent me were written for the chan_sip trunk.

Chan_Sip is just too old to be reliable/secure. If you are already thinking on changing suppliers, do yourself a favor and go ahead. You can get a pjsip trunk and redirect the current numbers to the new provider while you wait for a port to happen. Either that, or the supplier gets you a pjsip trunk to configure.

TLDR: Do yourself a favor and forget about chan_SIP

I found out that I can enable chan_sip in FreePBX 16. If I enable it, will it break the settings I made earlier?

I understand that this is an outdated technology, but I want to get a working trunk on chan_sip, look at the Asterisk configs and try to replicate this result using chan_pjsip.

And thank you all for your help again!

Just restart asterisk after enabling and it should be fine as far as I know. Do keep a record or a backup just in case.

Regarding the “replicate” part, pjsip is way more advanced and has many times more the amount of asterisk modules associated with it. Configuring is quite easy though, just needing to set a couple options depending on each provider, but they should help with that.

Have a nice day Native

If I enable both drivers, will the network ports change? Can the ports be configured through the GUI?

Okay, I found the port field in the trunk settings. One last question remains: can I set the same port, 5060, for both the chan_sip and chan_pjsip trunks?

No. chan_sip and chan_pjsip must have different port numbers.

Thanks! Is this configured only in the trunk settings, or somewhere else?

In Asterisk SIP Settings, the local pjsip port is called Port to Listen On and the local chan_sip port is called Bind Port.

However, your thread is titled “Trunk without registration”, while the chan_sip config you got from provider includes a registration string. Which is it?

On my old telephony platform, it’s a trunk without registration. All the configs in this thread are what the provider’s support team sent me. I’m trying to figure this out.

Unfortunately, the provider’s support is not very supportive.

I’m planning to dump some SIP traffic on the old platform. Perhaps this will help me understand what options are missing in the settings on the new platform.

This is the dump I received. xxx.xxx.xxx.xxx is the IP address of my old telephony platform. yyy.yyy.yyy.yyy is the IP address of my provider. 5555555555 is the fake number the provider passes to me as Called-ID. 7777777777 is my cell phone number. 3333333333 is the real number I dial to call my telephony platform.

Session Initiation Protocol (INVITE)
Request-Line: INVITE sip:[email protected];user=phone SIP/2.0
Method: INVITE
Request-URI: sip:[email protected];user=phone
[Resent Packet: False]
Message Header
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:9291;branch=z9hG4bK-61119e001f8b29a9-a3c020c-1T13289
Transport: UDP
Sent-by Address: yyy.yyy.yyy.yyy
Sent-by port: 9291
Branch: z9hG4bK-61119e001f8b29a9-a3c020c-1T13289
Call-ID: isbc6994545419649493417-1772448872-20443
[Generated Call-ID: isbc6994545419649493417-1772448872-20443]
From: sip:[email protected];user=phone;tag=sbc09036994545419649493417
SIP from address: sip:[email protected];user=phone
SIP from address User Part: 7777777777
SIP from address Host Part: sipgw5107.com
SIP From URI parameter: user=phone
SIP from tag: sbc09036994545419649493417
To: sip:[email protected];user=phone
SIP to address: sip:[email protected];user=phone
SIP to address User Part: 5555555555
SIP to address Host Part: xxx.xxx.xxx.xxx
SIP To URI parameter: user=phone
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Min-SE: 90
Session-Expires: 3600;refresher=uac
Contact: sip:[email protected]:9291;user=phone
Contact URI: sip:[email protected]:9291;user=phone
Allow: INVITE,CANCEL,BYE,ACK,REFER,UPDATE,INFO,PRACK
Supported: timer,100rel
Diversion: sip:[email protected];privacy=off;screen=no;reason=unconditional,sip:[email protected];privacy=off;screen=no;reason=unknown
Max-Forwards: 70
User-Agent: VCS 5.9.2.71-04
Content-Length: 424
Content-Type: application/sdp
Message Body

____________

Session Initiation Protocol (100)
Status-Line: SIP/2.0 100 Trying
Status-Code: 100
[Resent Packet: False]
[Request Frame: 2034]
[Response Time (ms): 24]
Message Header
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:9291;branch=z9hG4bK-61119e001f8b29a9-a3c020c-1T13289;received=yyy.yyy.yyy.yyy;rport=9291
Transport: UDP
Sent-by Address: yyy.yyy.yyy.yyy
Sent-by port: 9291
Branch: z9hG4bK-61119e001f8b29a9-a3c020c-1T13289
Received: yyy.yyy.yyy.yyy
RPort: 9291
From: sip:[email protected];user=phone;tag=sbc09036994545419649493417
SIP from address: sip:[email protected];user=phone
SIP from address User Part: 7777777777
SIP from address Host Part: sipgw5107.com
SIP From URI parameter: user=phone
SIP from tag: sbc09036994545419649493417
To: sip:[email protected];user=phone
SIP to address: sip:[email protected];user=phone
SIP to address User Part: 5555555555
SIP to address Host Part: xxx.xxx.xxx.xxx
SIP To URI parameter: user=phone
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Call-ID: isbc6994545419649493417-1772448872-20443
[Generated Call-ID: isbc6994545419649493417-1772448872-20443]
Server: 0000000
Content-Length: 0

_____________

Session Initiation Protocol (200)
Status-Line: SIP/2.0 200 OK
Status-Code: 200
[Resent Packet: False]
[Request Frame: 2034]
[Response Time (ms): 36]
Message Header
Via: SIP/2.0/UDP yyy.yyy.yyy.yyy:9291;branch=z9hG4bK-61119e001f8b29a9-a3c020c-1T13289;received=yyy.yyy.yyy.yyy;rport=9291
Transport: UDP
Sent-by Address: yyy.yyy.yyy.yyy
Sent-by port: 9291
Branch: z9hG4bK-61119e001f8b29a9-a3c020c-1T13289
Received: yyy.yyy.yyy.yyy
RPort: 9291
From: sip:[email protected];user=phone;tag=sbc09036994545419649493417
SIP from address: sip:[email protected];user=phone
SIP from address User Part: 7777777777
SIP from address Host Part: sipgw5107.com
SIP From URI parameter: user=phone
SIP from tag: sbc09036994545419649493417
To: sip:[email protected];user=phone;tag=e097bd03-99120000-ec12e608
SIP to address: sip:[email protected];user=phone
SIP to address User Part: 5555555555
SIP to address Host Part: xxx.xxx.xxx.xxx
SIP To URI parameter: user=phone
SIP to tag: e097bd03-99120000-ec12e608
CSeq: 1 INVITE
Sequence Number: 1
Method: INVITE
Call-ID: isbc6994545419649493417-1772448872-20443
[Generated Call-ID: isbc6994545419649493417-1772448872-20443]
Contact: sip:[email protected]:5060;transport=UDP
Contact URI: sip:[email protected]:5060;transport=UDP
Server: 0000000
Content-Type: application/sdp
Content-Length: 204
Message Body

What trunk without registering settings should I configure on FreePBX to get the same response?