Search the Asterisk Blog

The PJSIP Configuration Wizard

By George Joseph

Been wanting to try the new PJSIP stack but finding the configuration a little daunting?  Then this blog post is for you!

While the basic 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 sip.conf scenarios.  The PJSIP Configuration Wizard introduced in Asterisk 13.2 aims to ease that burden by providing a single object called ‘wizard’ that be used to configure most common PJSIP scenarios.

Here’s a typical example of a trunk to an ITSP configured in pjsip.conf:

In this scenario, it takes 5 objects (endpoint, aor auth, registration, identify) to define this one trunk and you’ll notice that some of the information is repeated in multiple objects.  There are certainly cases where having this flexibility is necessary but for many, especially when the same pattern needs to be repeated many times, it’s not.

Here’s the same scenario defined with the PJSIP Configuration Wizard in pjsip_wizard.conf:

A lot simpler, isn’t it?  The wizard automatically creates an endpoint with the same name as the object and the rest of the objects are created depending on the wizard’s parameters.  You’ll notice that some of the parameters names are simply ‘<name>’ and others are in the form of ‘<object>/<name>’.  The simple ones govern the wizard itself.  For instance, ‘sends_auth’ tells the wizard to create the auth object and add it to the endpoint’s ‘outbound_auth’ parameter, and ‘sends_registrations’ tells the wizard to create the outbound registration object.  The parameters qualified by ‘<object>’ are simply passed on to the object in question so ‘aor/qualify_frequency ‘  sets ‘qualify_frequency’ on the aor.  Some parameters like ‘remote_hosts’ are use by all the objects removing the need to specify the same value in each object.  If you use the Asterisk CLI ‘pjsip show’ commands, you’ll see that the wizard creates the same objects as those specified individually in pjsip.conf.  In fact, as far as the rest of Asterisk is concerned, they are identical.

Users/Phones are another common scenario: If you have a lot to configure you can use the wizard plus the power of the template feature common to all Asterisk configuration files:

Nifty, huh?
Want more information?  Visit the PJSIP Configuration Wizard page on the Asterisk Wiki

There Are 6 Comments

  • Kyle says:

    Great! Now, if only I could stop at that than it would be near-perfect, but there’s like 20 other config files in /etc/asterisk and it’s far from obvious which ones are legacy leftovers due to distro maintainers slacking off and which ones are actually necessary.

    What’s the absolute bare minimum set of files which got to be in /etc/asterisk in order to make pjsip_wizard.conf from this blog post work?

    • Joshua Colp says:

      There is no real good answer to that because “work” can mean different things to different people, as different functionality requires different configuration. Super awesome company[1] is an example though of a business PBX and can be installed using “make basic-pbx”.


      • Kyle says:

        Excellent illustration but I was thinking on smth even smaller and directly connected to the example in this port:

        – 2 user’s endpoints and 1 trunk configured in pjsip_wizard.conf
        – user’s extensions are 1000 and 1001

        That’d cover needs of most beginners perfectly, but the natural expectation is that following is possible:
        – 1000 can call 1001
        – 1001 can call 1000
        – if 1000 calls anything else it goes to trunk
        – if 1001 calls anything else it goes to trunk

        AFAIK, in order to make this happen we need matching extensions.conf with simple dialplan and pjsip.conf with transport definition, maybe smth else I’ve forgotten about. If we’d like extras like echo-test and voicemail that would require couple of more config files etc.

        • George Joseph says:

          There’s nothing more to it than that. The rest is stuff you’d have to do for any Asterisk setup, like the dialplan, voicemail, etc. If you try it and find something, be sure to let us know!

          • Kyle says:

            The things which seems confusing to me is DLPN_DialPlan1: is it supposed to be defined in extensions.conf? Also, what about hint_application – why do we define it here and not in dialplan?

          • Kyle says:

            Btw, both “hint_context” and “hint_application” do not have counterparts in the example pjsip.conf you’re using so I think it would be helpful to explain it in a bit more details.

Add to the Discussion

Your email address will not be published. Required fields are marked *

About the Author

George Joseph

See All of George's Articles