PJSIPThe modern SIP channel driver in Asterisk (chan_pjsip), replacing the older chan_sip. Configured in pjsip.conf using endpoints, AORs, auths, and transports. Configuration Wizard
This module allows creation of common PJSIP configuration scenarios without having to specify individual endpointIn PJSIP configuration, the SIP entity Asterisk communicates with: a phone, trunk, or other user agent. Defined by an endpoint section in pjsip.conf., aor, auth, identify and registration objects.
For example, the following configuration snippet would create the endpoint, aor, contact, auth and phoneprov objects necessary for a phone to get phone provisioning information, register, and make and receive calls. A hint is also created in the default contextA named section of the dialplan that groups extensions. Calls enter a specific context and can only reach extensions visible from it, making contexts the basic unit of call routing and security. for extensionA dialplan entry that matches a dialed number or pattern within a context and triggers a sequence of prioritized steps. 1000.
[myphone]
type = wizard
sends_auth = no
accepts_auth = yes
sends_registrations = no
accepts_registrations = yes
has_phoneprov = yes
transport = ipv4
has_hint = yes
hint_exten = 1000
inbound_auth/username = testname
inbound_auth/password = test password
endpoint/allow = ulaw
endpoint/context = default
phoneprov/MAC = 001122aa4455
phoneprov/PROFILE = profile1
The first 8 items are specific to the wizard. The rest of the items are passed verbatim to the underlying objects.
The following configuration snippet would create the endpoint, aor, contact, auth, identify and registration objects necessary for a trunkA connection between Asterisk and another PBX or an ITSP/carrier, used to send and receive external calls. to another pbxPrivate Branch Exchange, a private telephone switch. Asterisk is a software PBX that routes calls between internal extensions and the outside world. or ITSP that requires registration.
[mytrunk]
type = wizard
sends_auth = yes
accepts_auth = no
sends_registrations = yes
accepts_registrations = no
transport = ipv4
remote_hosts = sip1.myitsp.com:5060,sip2.myitsp.com:5060
outbound_auth/username = testname
outbound_auth/password = test password
endpoint/allow = ulaw
endpoint/context = default
Of course, any of the items in either example could be placed into templates and shared among wizard objects.
For more information, visit:
https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/PJSIP-Configuration-Wizard/
pjsip_wizard.conf
[wizard]
Provides config wizard.
type- Must be 'wizard'.transport- The name of a transport to use for this object.remote_hosts- List of remote hosts.outbound_proxy- Shortcut for specifying proxy on individual objects.sends_auth- Send outbound authentication to remote hosts.accepts_auth- Accept incoming authentication from remote hosts.sends_registrations- Send outbound registrations to remote hosts.sends_line_with_registrations- Sets "line" and "endpoint parameters on registrations.accepts_registrations- Accept inbound registration from remote hosts.has_phoneprov- Create a phoneprov object for this endpoint.server_uri_pattern- A pattern to use for constructing outbound registration server_uris.client_uri_pattern- A pattern to use for constructing outbound registration client_uris.contact_pattern- A pattern to use for constructing outbound contact uris.has_hint- Create hint and optionally a default application.hint_context- The context in which to place hints.hint_exten- Extension to map a PJSIP hint to.hint_application- Application to call when 'hint_exten' is dialed.endpoint/*- Variables to be passed directly to the endpoint.aor/*- Variables to be passed directly to the aor.inbound_auth/*- Variables to be passed directly to the inbound auth.outbound_auth/*- Variables to be passed directly to the outbound auth.identify/*- Variables to be passed directly to the identify.registration/*- Variables to be passed directly to the outbound registrations.phoneprov/*- Variables to be passed directly to the phoneprov object.
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.