PJSIP Trunk - Invalid URI - Outbound Calls Failing

I have created a Trunk and Outbound route to route my traffic to a specific IP. However I have disabled registrations as this isn’t required/currently supported. The Trunk is marked as out of service and outbound calls report the following in the log:
Endpoint ‘MyTrunk’: Could not create dialog to invalid URI ‘MyTrunk’. Is the endpoint registered and reachable?

Is there a way to bring the trunk into service without registering with the next hop?

Inbound calls seem to be using the “anonymous” endpoint to pipe the calls through if this helps.

Not registered means that the next hop isn’t registered with you. Either it needs to register, in which case registration is the only way you will know how to reach it, or it doesn’t, in which case you should provide its address.

However, I was under the impression that FreePBX doesn’t allow inbound registrations from trunks, in which case it is more likely that it is not responding when probed with OPTIONS (referred to a qualify).

If you are using the Outbound Proxy field to force sending to an IP address different from what the server domain resolves to, format it like this:

(replace with the desired destination IPv4 address)

If that’s not your issue, post all your non-default trunk settings (redact IP addresses, username, password, phone number, etc.)

Also, tell us what you are connecting to (commercial SIP trunking service, another PBX, an SBC, etc.)

That is undesirable, because it requires allowing SIP guests, a security issue. To fix this, set the Match (Permit) field to the list of IP addresses from which the trunk can send calls.

I currently don’t have Outbound Proxy field filled in.
Everything is fairly basic I must admit (first time implementing PJSIP).

Does the Match address need to be my target address or the listening address of my FreePBX?

I am targeting and receiving calls from an SBC.

It needs to be all the addresses from which the endpoint can send SIP. These are the remote addresses. They may or may not be the address to which you send outbound requests.

I will set Match now.

One thing I have noted is my SBC endpoint is sending OPTIONS and they are receiving 401.
Outbound OPTIONS from FreePBX are being responded with a 200OK but the endpoint is still showing unavailable.

Asterisk will accept any response to OPTIONS, as the response proves there is something there.

Perhaps something on FreePBX is causing me an issue then?

Unlikely. A careful look at the response will probably show why it isn’t being recognised.

This falls into the category of things that get so well exercised, that problems in Asterisk would be found very fast.

Just a fairly standard 401 Unauthorized. But I don’t want authorisation or registration enabled for my implementation.

Show the configuration for the trunk. Post screenshots.

Thank you everyone for your help - typically I had a typo on the SIP server IP…

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.