Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

However, in some cases, (endpoint and aor types) the section name has a relationship to its function. In the case of endpoint and aor their names must match the user portion of the SIP URI in the "ToFrom" header for inbound SIP requests. The exception to that rule is if you have an identify section configured for that endpoint. In that case the inbound request would be matched by IP instead of against the user in the "ToFrom" header.

Section Types

Below is a brief description of each section type and an example showing configuration of that section only. The module providing the configuration object related to the section is listed in parentheses next to each section name.

...

Configure how res_pjsip will operate at the transport layer. For example, it supports configuration options for protocols such as TCP, UDP or WebSockets and encryption methods like TLS/SSL.

You can setup multiple transport sections and other sections (such as endpoints) could each use the same transport, or a unique one. However, there are a couple caveats for creating multiple transports:

  • They cannot share the same IP+port or IP+protocol combination. That is, each transport that binds to the same IP as another must use a different port or protocol.
  • PJSIP does not allow multiple TCP or TLS transports of the same IP version (IPv4 or IPv6).

Info

Reloading Config: Configuration for transport type sections can't be reloaded during run-time without a full module unload and load. You'll effectively need to restart Asterisk completely for your transport changes to take effect.

Expand
titleEXAMPLE BASIC CONFIGURATION

A basic UDP transport bound to all interfaces

Code Block
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0

Or a TLS transport, with many possible options and parameters:

Code Block
[simpletrans]
type=transport
protocol=tls
bind=0.0.0.0
;various TLS specific options below:
cert_file=
privkeypriv_key_file=
ca_list_file=
cipher=
method=

...

Expand
titleEXAMPLE BASIC CONFIGURATION

This example shows you how you might configure registration and outbound authentication against another Asterisk system, where the other system is using the older chan_sip peer setup.

This example is just the registration itself. You'll of course need the associated transport and auth sections. Plus, if you want to receive calls from the far end (who now knows where to send calls, thanks to your registration!) then you'll need endpoint, AOR and possibly identify sections setup to match inbound calls to a context in your dialplan.

Code Block
[mytrunk]
type=registration
transport=simpletrans
outbound_auth=mytrunk
server_uri=sip:[email protected]:5060
client_uri=sip:[email protected]:5060
retry_interval=60

And an example that may work with a SIP trunking provider

Code Block
[mytrunk]
type=registration
transport=simpletrans
outbound_auth=mytrunk
server_uri=sip:sip.example.com
client_uri=sip:[email protected]
retry_interval=60

What if you don't need to authenticate? You can simply omit the outbound_auth option.

DOMAIN_ALIAS

(provided by module: res_pjsip)

...

Entity RelationshipsRelationship Descriptions
Gliffy Diagram
nameres_sip_configrelationships
pageid25919621

ENDPOINT

  • Many ENDPOINTs can be associated with many AORs
  • Zero to many ENDPOINTs can be associated with zero to one AUTHs
  • Zero to many ENDPOINTs can be associated with at least one TRANSPORT
  • Zero to one ENDPOINTs can be associated with an IDENTIFY

REGISTRATION

  • Zero to many REGISTRATIONs can be associated with zero to one AUTHs
  • Zero to many REGISTRATIONs can be associated with at least one TRANSPORT

AOR

  • Many ENDPOINTs can be associated with many AORs
  • Many AORs can be associated with many CONTACTs

CONTACT

  • Many CONTACTs can be associated with many AORs

IDENTIFY

  • Zero to One ENDPOINTs can be associated with an IDENTIFY object

ACL, DOMAIN_ALIAS

  • These objects don't have a direct configuration relationship to the other objects.
Expand
titleUnfamiliar with ERD? Click here to see a key...

Image Added