How to configure Asterisk when Wazo does not implement a functionality

22 February 2017

Customizing your Asterisk configuration on Wazo

Wazo is a full featured IPBX using Asterisk. It has many functionalities implemented in its configuration interface and many API to configure your telephony system. But sometimes what you need is simply missing. This article will show some common ways to modify your Wazo server to use features from Asterisk that are not available in the wide range of Wazo tools.

Dialplan

Dialplan is used to modify the flow of a call. The easiest way to add dialplan to Wazo is through its web interface in the Services -> IPBX -> Configuration files menu. The xivo-extrafeatures context is available to all users and can be used to add new extensions to your dial plan. New contexts can also be added using the Asterisk dialplan syntax.

Customizing asterisk configuration files

Extra dialplan files can be added in /etc/asterisk/extensions_extra.d/.

The Wazo dialplan

The dialplan shipped with Wazo can be found in /usr/share/xivo-config/dialplan/asterisk reading this dialplan may help find available options that can be tweaked using subroutines and debug call flow problems.

Subroutines

Most resources (a group, a user, a conference room, etc.) on a Wazo can execute a dialplan subroutine before being reached. This allows the administrator to add custom dialplan before calling the Asterisk application.

For example:

With the following contexts in xivo-extrafeatures.conf

[aastra-autoanswer]
exten = s,1,SIPAddHeader(Alert-Info: info=alert-autoanswer)
same = n,Return()

If a user has the aastra-autoanswer subroutine, his phone will answer automatically, instead of ringing.

User preprocess subroutine

Configuration files

Asterisk configuration files are in /etc/asterisk. Most configuration files are generated by wazo-confgend. To view the generated output of a configuration file, use the command that is in the configuration file.

For example, the content of /etc/asterisk/sip.conf is:

; autogenerated from wazo-confgend

#exec /usr/bin/wazo-confgen asterisk/sip.conf

To view the generated configuration file you can do the following command:

wazo-confgen asterisk/sip.conf

You can add or overwrite values to a section using the following syntax:

; autogenerated from wazo-confgend

#exec /usr/bin/wazo-confgen asterisk/sip.conf

[general](+)
accept_outofcall_message=yes
outofcall_message_context=astsms

This example adds or modify the options accept_outofcall_message and outofcall_message_context in the general section of the sip.conf file.

Note that these changes will have to be redone at each upgrade modifying the configuration file. The old version will be kept in a .dpkg-old file:

> ls /etc/asterisk/sip.conf*
sip.conf  sip.conf.dpkg-old

Some configuration files also include another directory that should be used when available, e.g.:

/etc/asterisk/manager.conf

[general]
enabled = yes
webenabled = yes
port = 5038
bindaddr = 0.0.0.0

#include manager.d/*

All files in /etc/asterisk/manager.d/ will be read when reloading the configuration and these files will not be modified during an upgrade.

Here's a summary of what happens when Asterisk starts, and what configuration files will be read on Wazo. Thanks to J Az from the Wazo forum for this diagram!

Asterisk configuration read flow

If you do these kinds of customizations on your own, make sure you read the Wazo upgrade notes before upgrading: major updates of Asterisk can break your custom configuration if you're not careful.

Community Supported

Wazo Platform is supported by its community. Use our various channels to reach out.

Publications

Video @ Kamailio World: Dangerous Demos

Video @ the Telecom Application Development Summit: What can you do with Wazo?

Video @ the Telecom Application Development Summit: WAZO Keynote: xCPaaS

Get Connected, Contribute & Build value!

Designed with by Xiaoying Riley for developersCopyright 2016-2023 The Wazo Authors (see the AUTHORS file)