How to Connect to a Provider via SIP TRUNK with IP and Port Authentication

Hello everyone,

I’m currently setting up a SIP TRUNK with a provider that uses IP and port-based authentication. There are no username or password credentials involved.

I would like to know:

  1. How to correctly configure such a TRUNK in Asterisk (I’m using Asterisk 22.1.0).
  2. The specific parameters to include in the pjsip.conf file.
  3. If any special adjustments are needed for the endpoint,registrations identify, or transport sections.

If you have configuration examples or any tips, I would greatly appreciate your help!

Thank you in advance.

Delete the type=registration section.
Only if the port number is not that used internally, add a type=transport for it, and use that in the endpoint definition, for the provider.
Remove all references to type=auth sections from the other sections for the provider.
Type=identify relates to the provider’s address, not yours.

Thank you for your reply. Here is the configuration in my pjsip.conf file:

[trunk_provider]
type=endpoint
transport=transport-udp
context=from-trunk
disallow=all
allow=ulaw
aors=trunk_provider_aor

[trunk_provider_aor]
type=aor
contact=sip:sip.provider.com:5060

[trunk_provider_identify]
type=identify
endpoint=trunk_provider
match=X.X.X.X; IP provider

When I try to send a call over the TRUNK. I send an INVITE request, but I get no response.
Does this seem correct to you?

You can rule out the type=identify as the problem, as it isn’t used for outgoing requests. That means that either contact= is wrong, or you have a NAT or firewall issue.

Please provide the result of capturing an enabled full log, with “pjsip set logger on” in effect, and a description of the location of NAT and firewalls, if any in your network. Note that your current configuration isn’t suitable for use behind NAT. This is not specific to IP authentication.

Also, I never understand why people obfuscate the provider identity, as one of the things that people may want to do is to access the provider’s configuration documenation.