The PJSIP Configuration Wizard (module res_pjsip_config_wizard
) is a new feature in Asterisk 13.2.0. While the basic chan_pjsip
configuration objects (endpoint, aor, etc.) allow a great deal of flexibility and control they can also make configuring standard scenarios like trunk
and user
more complicated than similar scenarios in sip.conf
and users.conf
. The PJSIP Configuration Wizard aims to ease that burden by providing a single object called 'wizard' that be used to configure most common chan_pjsip
scenarios.
The following configurations demonstrate a simple ITSP scenario.
|
|
---|
Both produce the same result. In fact, the wizard creates standard chan_pjsip
objects behind the scenes. In the above example...
- An endpoint and aor are created with the same name as the wizard.
- The
endpoint/context
andaor/qualify_fequency
parameters are added to them. remote_hosts
captures the remote host for all objects.- A contact for the aor is created for each remote host.
sends_auth=yes
causes an auth object to be created.outbound_auth/username
andoutbound_auth/password
are added to it.- An
outbound_auth
line is added to the endpoint. sends_registrations=yes
causes a registration object to be created.- An
outbound_auth
line is added to the registration. - The
server_uri
andclient_uri
are constructed using the remote host and username. - An identify object is created and a match is added for each remote host.
Configuration Reference:
Parameter | Description |
---|---|
type | Must be wizard |
sends_auth | Will create an outbound auth object for the endpoint and default = |
accepts_auth | Will create an inbound auth object for the endpoint. default = |
sends_registrations | Will create an outbound registration object for each default = |
remote_hosts | A comma separated list of remote hosts in the form of default = |
transport | The transport to use for the endpoint and registrations default = the pjsip default |
server_uri_pattern | The pattern used to construct the registration default = |
client_uri_pattern | The pattern used to construct the registration default = {{sip:${USERNAME}@${REMOTE_HOST}}} |
contact_pattern | The pattern used to construct the aor contact. default = |
has_phoneprov | Will create a phoneprov object. If yes, both default = |
has_hint | Enables the automatic creation of dialplan hints. Two entries will be created. One hint for 'hint_exten' and one application to execute |
hint_context | The context into which hints are placed. |
hint_exten | The extension this hint will be registered with. |
hint_application | An application with parameters to execute when 'hint_exten' is dialed. Example: Gosub(stdexten,${EXTEN},1(${HINT})) |
<object>/<parameter> | These parameters are passed unmodified to the native object. |
Configuration Notes:
- Wizards must be defined in
pjsip_wizard.conf
. - Using pjsip_wizard.conf doesn't remove the need for pjsip.conf or any other config file.
- Transport, system and global sections still need to be defined in pjsip.conf.
- You can continue to create discrete endpoint, aor, etc. objects in pjsip.conf but there can be no name collisions between wizard created objects and discretely created objects.
- An endpoint and aor are created for each wizard.
- The endpoint and aor are named the same as the wizard.
- Parameters are passed to them using the
endpoint/
andaor/
prefixes. - A contact is added to the aor for each remote host using the
contact_pattern
and${REMOTE_HOST
}.
sends_auth
causes an auth object to be created.- The name will be
<wizard_name>-oauth
. - Parameters are passed to it using the
outbound_auth/
prefix. - The endpoint automatically has an
outbound_auth
parameter added to it. - Registrations automatically have an
outbound_auth
parameter added to them (if registrations are created, see below).
- The name will be
accepts_auth
causes an auth object to be created.- The name will be
<wizard_name>-iauth
. - Parameters are passed to it using the
inbound_auth/
prefix. - The endpoint automatically has an
auth
parameter added to it.
- The name will be
sends_registrations
causes an outbound registration object to be created for each remote host.- The name will be
<wizard_name>-reg-<n>
where n starts at 0 and increments by 1 for each remote host. - Parameters are passed to them using the
registration/
prefix. - You should not use a wizard in situations whereyou need to pass different parameters to each registration.
server_uri
andclient_uri
are constructed using their respective patterns using${REMOTE_HOST
} and${USERNAME
}.
- The name will be
- If
accepts_registrations
is specified,remote_hosts
must NOT be specified and no contacts are added to the aor. This causes registrations to be accepted. - If
accepts_registrations
is NOT specified or set tono
, then an identify object is created to match incoming requests to the endpoint.- The name will be
<wizard_name>-identify
. - Parameters are passed to it using the
identify/
prefix although there really aren't any to pass.
- The name will be
- If
has_phoneprov
is specified, a phoneprov object object is created.- The name will be
<wizard_name>-phoneprov
. - Both
phoneprov/MAC
andphoneprov/PROFILE
must be specified.
- The name will be
has_hint
causes hints to be automatically created.hint_exten
must be specified.
- All created objects must pass the same edit criteria they would have to pass if they were specified discretely.
- All created objects will have a
@pjsip_wizard=<wizard_name>
parameter added to them otherwise they are indistinguishable from discretely created ones. - All created object are visible via the CLI and AMI as though they were created discretely.
Full Examples:
Phones:
Configuration | Notes |
---|---|
This example demonstrates the power of both wizards and templates. Once the template is created, adding a new phone could be as simple as creating a wizard object Of course, you can override ANYTHING in the wizard object or specify everything and not use templates at all. |
Trunk to an ITSP requiring registration:
Configuration | Notes |
---|---|
This is an example of trunks to 2 different ITSPs each of which has a primary and It also shows most of the endpoint and aor parameters being left at their defaults. In this scenario, each wizard object takes the place of an endpoint, aor, auth, |
Trunk between trusted peers:
Configuration | Notes |
---|---|
This one's even simpler. The |
6 Comments
Max
Does pjsip_wizard.conf completely replace pjsip.conf or "type = transport" should still go there?
George Joseph
The wizard only processes type=wizard so all other types must go in pjsip.conf
Max
Thanks! IT would be nice to clarify what's the minimum set of files required in /etc/asterisk/ in order to use pjsip_wizard.conf. Do I need sorcery.conf? pjsip_notify.conf? anything else?
George Joseph
Good point. I'll fix the page up this week.
Max
There are multitude of asterisk gui/web management tools out there. Are there any which understand pjsip_wizard.conf?
George Joseph
As far as I know, there aren't any tools which use the wizard.