MiRTA PBX

Software version 3.51.0

http://www.mirtapbx.com

Indice generale

Login	5

Work Area	6

Language Selection Menu	7

Tenant Selection Menu	7

Menu Display Toggle Button	7

Mobile version	7

Multiple select	8

Configuration Section	9

Extensions	9

New SIP Extension/Define SIP Extension	10

NAT Control	13

Call Settings	13

Outbound Recording	13

Security	14

Web User Panel	16

Outbound Calls	16

Find me/Follow me Configuration	17

Additional Destinations	18

Note	19

Bulk extension creation	19

Virtual Extensions	19

Delete of Extension	22

Multiple Delete of Extensions	22

How dialing works	22

DIDs	24

New/Define DID	25

Voice	27

Fax	28

SMS	28

Bulk DIDs creation	29

Use DIDs storage	30

Outbound CallerID Regex	30

Media Files	30

Conditions	32

IVR	34

Hunt List*	35

Conference Rooms*	36

Call Queue*	36

Paging and Intercom*	38

Flow & Variables	39

Custom Destinations	40

DISA*	48

Feature Codes*	48

Short Numbers*	51

CallerID Black List*	52

AGI Scripts*	53

Settings	55

Mail to Fax	63

Voicemails	64

Provisioning	65

Phones	65

New Phone	66

Autoprovision Values	68

Button Layouts	69

Phone Directory	71

Status*	72

Call History*	72

Queue History*	75

Peers*	76

Conferences*	76

Faxes*	77

Voicemail Messages*	77

Balance*	78

Stats*	78

Administration section	81

Providers	81

Provider Costs*	84

CSV import*	85

Billing*	85

Balance Dashboard*	85

Outbound Call Rates	86

Provisioning	89

Phone Models	90

Phone Directory	93

Button Layouts	94

Custom Files	95

Variables	96

PBX Nodes	97

Process Logs	98

Core Status	99

Current Channels	99

Fax Status	100

BLF Status	101

Editing a node	102

Routing Profiles*	102

Tenants	104

Tenants Conduits*	108

Users*	109

User Profiles	110

General Privileges	112

Macro Privileges	113

DID List*	115

Translations*	115

Settings*	116

Proxy API	119

HELP	119

COUNTPEERS	120

PEERS	120

DIAL	120

CHANNELS	120

HANGUP	120

TRANSFER	120

Database Integrations	121

Billing	121

SIP TAPI integration	122

Provisioning Phone Examples	125

Grandstream GXP2130	125

SNOM 710	127

Cisco SPA504G	128

Yealink T28P	129

FAQ	132

Linux System	132

Extensions	133

Voiocemails	134

Miscellaneous	134

Phones	135

Provisioning	136

Setup Guides	137

How to setup outbound dialing?	137

How can I setup and use the Emergency Caller ID?	137

How can I build a more user friendly feature code?	139

Ask and set unconditional destination for a DID	140

Ask and dial with custom callerid	142

Condition override	144

Dial a number with different Caller ID	148

Using custom voicemail templates	149

How can I display the Caller ID name from my phone book?	150

How can I configure a BLF key for picking the call when it rings?	151

Appendix	154

Setting Asterisk to use TLS	154

Changing Server IP	154

Using Parking Lots	155

Regular Expressions	156

Clustering and High Availability	157

Installing and configuring MiRTA PBX	159

Mirta PBX URL Significance	161

Paragraphs marked with a * are still referring to MiRTA PBX 2.x

Login

Once connected to the website, a common login screen will let the user log in the system and reach the work area. All the elements of the Login screen can be customized using the web interface, the software can be completely “white labelled” and multiple themes can be host on the same installation and selected depending by the URL used to access the website. See section Admin/Themes.

Work Area

In the top right corner you can identify in order the Language Selection Menu, the Tenant Selection Menu, the Exit Button and the Menu Display Toggle Button.

On the left there are the Configuration, Status and Admin Sections to configure, check and manage your system. The menu available can be configured to show only the one interesting for the user by customizing the user profile in the Admin/User Profiles menu.

Language Selection Menu

Using this menu you can choose the language used by the interface. Please note only the English language is provided. If you want to use another language, you need to provide the translation by yourself using the Admin/Translations menu. More language hooks can be provided. If you don't want to display all the current language hooks available, you can disable them in the Admin/Settings. The language, if available, is automatically chosen based on the language accepted by the browser.

Tenant Selection Menu

Using this drop down box, the tenant to work on can be chosen. Please take in mind only the authorized tenants are shown. Even if you are an admin, you can see only the tenants enabled on your account. If you want, admin users can automatically see all the tenants by enabling the “Admins see all tenants” checkbox in the Admin/Settings menu.

Menu Display Toggle Button

The website is responsive, so it will resize based on the actual screen size. If you need more space you can toggle the left menu display.

Mobile version

The website can be comfortably used also from mobile devices with limited screen size.

Multiple select

In almost every place of the interface, when a select box is shown, multiple options can be picked up, ordered or deleted. There is no limit about the number of options to be selected.

Configuration Section

The Configuration Section is used to configure every working aspect of the PBX. It can used by admin and not admin users. The options selected within this menu are applied only to the selected tenant using the “Tenant Selection Menu”.

Extensions

The list of extensions defined for the selected tenant are shown along with the callerid, username and password associated. You can create one or multiple new extensions using the buttons on the top right.

For each extension a small icon will display the status, green for registered, red for off line, yellow for not yet registered.

New SIP Extension/Define SIP Extension

The definition of an extension is comprised of multiple sections. The most important one is the general one, where you can define the internal number for the extension and the password.

The username is automatically generated based on the extension number and the code assigned to the tenant. Extension number and SIP accounts are tied together. The username format <extension>-<tenant code> is mandatory (see later for exceptions) and cannot be changed.

The number assigned to an extension for a tenant can be the same number assigned to another extension for another tenant. MiRTA PBX is completely multi tenant, so each tenant configuration is completely independent from others. This is a general rule and apply on every aspect of the configuration.

The name provided will be used as CallerID for internal calls. This means the CallerID on the phone will be overwritten with the one specify here. If you don't want to have the CallerID forced to the one configured, but rather you want to use the CallerID coming from the phone (for example because the extension is not assigned to a single phone, but because it is assigned to another PBX with multiple extensions) you can set the “Trunk” checkbox. The trunk setting will effect also incoming call to the phone (or PBX). If the “Trunk” checkbox is set, the SIP INVITE sent to the account will include the number dialed.

When you select the Trunk checkbox, you have access to few more options to control how the CallerID Number for the calls generated by that extension will be altered:

You can get both the CallerID number and Name from the SIP Invite, just the number, just the name or neither of them. You can also specify from which portion of the SIP packet to get the CallerID number and name, Automatic (asterisk default) or from FROM, PAI or RPID section.

Username is automatically generated adding the tenant code to the number provided. The format used by default is using the “-”, but some phones has been found to not accept the minus sign. The joining character can be changed by pressing on the double arrows. Take in mind the usage of “_” is discouraged and needs to be used only when really needed.

Password can be autogenerated clicking on the “Generate” button. A new password is generated every time using the random number generated. It is highly advisable to use long and completely random passwords.

Codecs: Every extension can have a broad range of codecs allowed. Please remember the G.729/723.1 codecs, even if listed in the system, you might have to pay royalty fees to the G.729/723.1 patent holders for using their algorithm.

DTMF Mode is selectable between auto, info, inband and RFC 2833. Please check the phone configuration and the provider support for choosing the right DTMF setting. The most widely accepted format is RFC 2833.

Progress inband forces the system to generate ringing tones.

Can reinvite allows two endpoints, like two phones or the phone and the provider, to exchange the RTP data directly, without routing through the PBX. Usually if one of the party is behind NAT, you may experience one way audio. Usually set to No.

Call groups/Pickup groups defines who is permitted to perform a pick-up for which calls. If call group and pickup group matches, then it is possible to pickup using the specified feature code. Note you need to define the feature code to use.

Send MWI only if subscribed allows you to decide which kind of MWI you want to perform. The options are “Yes” using Subscribe or “No” using externnotify directive. Asterisk has been always picky regarding MWI notification… often phones think to have subscribed while asterisk has expired or not received the subscription ending with missing MWI. One of the best solution is to avoid the subscription mechanism and send always the MWI notification to phone, using the script referenced in the externnotify directive in voicemail.conf. Please check your voicemailconf if contains the following directive when using this option:

externnotify=/var/lib/asterisk/agi-bin/vmnotify.php

Voicemail MWI allows you to assign the MWI on the phone for a voicemail.

Call Limit sets the max number of channels allowed to be used by a phone. Setting it to 1 doesn't allow usually to transfer calls.

Do Not Disturb (DND) sets the extension in DND mode. This is a server assisted DND. It doesn't affect the phone DND eventually set. It can be a good idea to remove the ability for users to set DND on the phone … most of the time they will call you because their phone is not ringing and discovering they have activated DND on the phone can be challenging.

Inbound Dial Timeout sets the time in seconds one extension have to ring before going to the “No Answer” additional destination. You can avoid setting a Dial Timeout value and the default value will be used.

NAT Control

It is important when the phone is behind a NAT. Use force_rport, comedia in almost all the cases. If you experience one way audio, then check the NAT setting.

Qualify allows the PBX to contact periodically the phone to check if it is still online. This has the benefit of taking “open” the connection tracking on the firewall you can have between the phones and the Internet. Connections are made every 60 seconds. If you have slow phones, you can increase the time to wait for an answer.

Keep Alive is another way to take open a connection, using keep alive packets.

RTP Keep Alive permits to take open an RTP connection when no audio is passed when a party is not talking for a long time.

Call Settings

Allows to set some of the options regarding the call

T.38 Fax Gateway permits to use the extension to receive/send a fax in T.38 even if the device attached to the extension is not capable of T.38. This can be useful with some ATA of fax machine.

Volume TX and RX level permits to tune the volume for this extension

Music on hold allows to set the Music on Hold used by this extension

Language allows to set the language in asterisk standard audio files used by this extension

Outbound Recording

Always Record sets the recording preference for the extensions. If set to “Yes”, all the phone calls made by the extensions are recorded. If set to “Yes, but allows stopping” or “No, but allows starting”, then the recording can be respectively turned off or on by using the predefined #0 and #1 DTMF sequence while on the phone. The recorded file will be available for download in the Status/Call History menu.

Email Recordings to allows to set an email address to send the recordings once the call completes. To maximize

Minimum Size (Bytes) allows to receive those recordings bigger than the size set, in Bytes. Recording takes place only on bridged channels, so IVR prompts or Music On Hold will be not recorded.

Security

Host can be “dynamic”, accepting registration from any IP or it can be assigned to a specific IP address. In this way, no registration is needed.

Insecure allows the peer to be authenticated using the IP.

Transport permits to use a different transport for the signaling. If TLS is selected, it is needed to add a certificate to Asterisk. Please check the Appendix for special configuration.

RTP Encryption provides encryption to the RTP (audio) part. The key is transmitted over the SIP channel, so it will be useless to use it without setting the transport to TLS

Send RPID and Trust RPID permits to specify how to transmit the CallerID information from this extension.

Outbound Destinations permits to restrict the numbers the extension can dial. In other words, the destination allowed can be restricted. For example, the phone placed in the kitchen of the office can be restricted to place international calls. The Outbound destination can be:

All Allowed: Allowing every number

All Prohibited: The phone cannot place outbound calls

Allowed if matches: The call is allowed if the number dialed match the Regex associated

Prohibited if matches: The call is prohibited if the number dialed match the Regex associated

Web User Panel

Enabling the web user panel permits to login to the web interface providing the extension username or the specified Web User and the provided web user panel password. It is not possible to use the SIP password to login.

User Profile defines the user profile to assign to the user connecting to the web user panel.

Outbound Calls

This section allows to configure how the call is managed when dialing out the local virtual pbx. Use of the caller id can be blocked by selecting the “Block External Caller ID” checkbox. This checkbox can be selected/unselected using a feature code.

The External CID number can be chosen among various formats, usually resembling the E.164 standard. The various options can be enabled or disabled using the Admin/Settings menu. Under normal confition, the External CID number can be chosen only among the DIDs assigned to the tenant. However if the user has the privilege “Can Edit CID Numbers”, a small “Edit” box will appear beside the number, allowing the user to customize the External Caller ID number.

External CID name allows to define the alphabetic part of the Caller ID.

Emergency CID number allows you to define the Caller ID number to use when an emergency route is used to dial out. This can be chosen among the DIDs marked as “emergency”. The location of the DID is shown if entered.

Area Code allows to specify a prefix to add to numbers when the number of digits entered is between the number of digits specified next, inclusive. For example, if you area code is 055 and your local area numbers are from 4 to 7 digits, you can enter the following data and your number will be automatically completed with the area code. So, if you enter 453131, automatically the number dialed will be 055453131.

Routing Profile permits to assign to the extension a different routing profile than the one assigned to the tenant.

Find me/Follow me Configuration

It allows to define a simple “next hop” for calls when the dialed number is busy or not available. The FMFM configuration needs to be enabled using the relative check box. It is possible to use a feature code to enable or disable it.

FMFM Number is the number to dial when the extension is busy or not available.

FMFM Dial Method permits to choose between two dialing method, “normal” when the FMFM number is dialed after the “Inbound dial timeout” for the extension and “simultaneous” when the FMFM number is dialed together with the extension number.

Request Confirmation allows to ask to the callee to accept the call, playing the standard message or a custom message. If the callee refuses the call, the call is managed as he was BUSY.

FMFM Caller ID allows to choose which Caller ID to display to the called number. Two special options are available:

Use Original will use the caller Caller ID

Use Incoming DID will use the DID receiving the call as Caller ID

FMFM Caller ID Num and Name prefix defines a prefix to add to the Caller ID chosen when dialing the FMFM number

FMFM Dial Timeout defines the second to dial the FMFM number before going to the Additional Destination, if defined

Additional Destinations

They permit to specify the destination of the call when the extension is not answered, Busy or Offline. A special destination “Unconditional” allows to redirect the phone calls to another destination. Every kind of Additional Destination can be enabled or disabled using Feature Codes.

When defining the Additional Destinations, you may choose a special destination, usually not available, “Voicemail Same Number”. This destination will automatically create a voicemail with the same number as the extension and a random PIN. If the voicemail was already available, it will be just assigned to the destination-

Email missing call note permits to specify an email where to receive an email when a call is missed.

Note

If enabled in the Misc section of Configuration/Settings, you can set the Branch and Department for the extension and have them grouped when enabling jqgrid view in Extensions page

Bulk extension creation

It is possible to create multiple extensions at once by pressing the “Bulk SIP peer” button. The definition web page will be the same except for the number range requested.

Virtual Extensions

A virtual extension is an extension that is not connected automatically to a SIP device, so you can connect multiple devices to the same extension number. When one of them will be busy, the virtual extension will be shown as busy. When the virtual extension number is dialed, all SIP devices connected will ring.

All usual options regarding an extension are available in the virtual extension. When an extension is part of a virtual extension, the additional options beside the main one are no more valid because the one from the virtual extension will take place.

A virtual extension can be used for Hot Desking, where a single physical phone is used by multiple workers, in this case you need to create a virtual extension for each of your workers and they will “assign” the phone they found on their desk to their own number using feature code.

Let's make an example: you have three employees and just two desks, but they will be never work all together, so this will be a perfect case for Hot Desking. Each employee has a virtual extension, so for example:

Bob, virtual extension 401

John, virtual extension 402

Mary, virtual extension 403

On your desks you'll configure the phones, so you'll have device 250-OIL on the desk near the window and the device 251-OIL on the desk near the door. You have defined two feature code, *56[EXT] for assigning the device to the EXT virtual extension and *57[EXT] to remove.

Bob is coming in the office and he sits on the desk near the window. He “assign” the device 250-OIL to his virtual extension, so he lift the receiver and dials *56401. From now on, the virtual extension 401 will have the device 250-OIL. Mary is coming and do the same, but from the 251-OIL extension. Now, dialing 401 will ring the phone on the desk beside the window and dialing 403 will ring the one near the door.

It is lunch time and Bob leaves the office for a break. He removes his phone number from the extension dialing *57401. Mary has instead finished his day and goes home, she removes his number from the phone too, dialing *57403.

John arrives in the office and both desks are empty, so he sits in the one near the window and assign the phone to his virtual extension, by dialing *56402.

Bob is back and the only desk available is the one near the door, so he assigns his virtual extension to that phone, by dialing *56401.

Now, dialing 401 will ring the phone on the desk near the phone and dialing 402 will ring the one near the window. Dialing 403 will go to the “On Offline” Additional Destination for Mary number.

Delete of Extension

To delete an extension, it is enough to just press on the delete button at the end of the extension definition. A message will request confirmation. Deleting the extension will unregister and clean it from the asterisk peer cache, denying any other operation for the deleted extension.

Multiple Delete of Extensions

From the extensions list is possible to delete multiple extensions at once. On the top right corner you can locate a small garbage icon.

When pressed, a new column will appear on the left, allowing to select the extensions to delete by pressing the newly appeared button “Delete Selected”.

How dialing works

Dialing an extension follows a series of steps based on the extension status and its configuration.

Here some examples:

Online Extension without any FMFM number defined and without any additional destination defined

Extension is called. Nobody answers. After the “Inbound Ring Timeout” the call drops.

Offline Extension without any FMFM defined and without any additional destination defined

Extension is called. Call drops immediately

Online Extension with an FMFM number defined and without any additional destination defined

Extension is called. Nobody answers. After the “Inbound Ring Timeout” the FMFM number is dialed for the FMFM Dial Timeout

Online Extension without FMFM number defined and with an additional destination to Voicemail for the No Answer

Extension is called. Nobody answers. After the “Inbound Ring Timeout”, voicemail answers

Online Extension with FMFM number defined and with an additional destination to Voicemail for the No Answer

Extension is called. Nobody answers. After the “Inbound Ring Timeout”, FMFM number is called. Nobody answers. After the “FMFM Dial Timeout”, voicemail answers

DIDs

To every tenant can be assigned a group of DIDs, numbers to be dialed from the outside. Each DID can be configured to reach a certain extension or Queue or Hunt Group or IVR or any combination of the elements defined for the tenant. The same DID cannot be assigned to more than one tenant and there is no correlation between the dialing profile assigned to a tenant, the trunk provider used and the incoming DID. For this reason is highly important the incoming INVITE from the trunk provider contains all the info to identify correctly the DID it is addressing.

Due to the fact there is a lack of strong standardization among trunk providers on how to transmit the DID information, a “best guess” is used to identify the correct DID, using any of the format currently in use around the world.

New/Define DID

A DID can be configured to accept voice, fax or try to guess the calling party (if voice of fax). Autodetection relies on signalling at the start of the call and cannot be always reliable. The time to detect the fax tone can be set in the Admin/Settings page.

The number must be entered in three parts, starting with the international prefix, the area code and the number. Even if your telephone standard doesn't allow the usage of any “short” form for dialing the number, requesting for example, to dial always the area code, the number is requested to be entered this way. Using the Admin/Settings menu is possible to enable the use of a “single box DID” to just enter the number in a single box, but this is highly discouraged.

It is possible to use regular expression inside the number. In case multiple regular expressions match the number dialed, the ordering is based alphabetically on the Comment.

Comment is just a comment and it is not used in any way.

Max channels allows you to set the maximal number of channels available on the DID. Any additional call received will be refused with a busy signal.

Use CNAM service allows you to assign the Caller ID Name based on this popular service offered in most countries. You can configure the service in the Admin/Settings page.

Use as Emergency CallerID permits you to mark this DID as one of the available to be used when an emergency call is dialed. Due to the fact the emergency numbers are not standard among all countries, it is your duty to assign the “emergency flag” to the dialing rules for emergency numbers. When a call is dialed and it is using a dialing rule marked as “emergency”, the Caller ID number used for the extension is the one defined as “Emergency” among the ones with this flag set.

Inbound Call Rate allows you to define a call rate for inbound calls.

Voice

This section allows to define how to route the call when a voice call is received.

Unconditional Forward is a destination that can be set on the DID to send the call to a particular destination. It is enable/disabled by the checkbox and that checkbox can be easily controlled by a feature code. This is not the destination to be set for common usage, you need to use the one in the Voice section.

Always record permits to force the recording of the call, whichever is the future of the call. Recordings will be available through the Call History menu.

Email recordings to defines if and to who the recordings needs to be sent once the call is over. Multiple destinations email can be entered with any delimiter, like space, comma and point and comma.

Minimum Size (Bytes) allows to receive those recordings bigger than the size set, in Bytes. Recording takes place only on bridged channels, so IVR prompts or Music On Hold will be not recorded.

Using the Prefix CallerID Num is possible to define a string to be added to any CallerID number received to identify for example the DID the call is coming from. The same can be achieved by defining a Custom Destination.

Prefix CallerID Name is the same as above, but for the Caller ID Name.

Destination multiple drop down allow to define the list and the order of the objects receiving the call.

Fax

This section allows to define what to do with the call if a fax is received on the number defined. Receiving Fax over the Internet has often a low success rate, even if T.38 protocol is used.

Receive fax can be used to select if autodetect, force or disallow the reception of a Fax over the current DID.

Fax Station ID and Fax Header allows you to customize your virtual fax.

Fax Protocol can be selected among T.38 (the preferred way to receive faxes), T.38 with fallback to G.711 or only G.711.

Email destinations box permits to enter one or multiple comma delimited email address to forward the received fax. Received fax are sent in PDF format. Partially received faxes are sent in the same way.

It is possible to store the fax received for later reviewing using the Store Fax Received control.

SMS

You can specify how to pull or receive SMS on this DID.

Protocol let's you choose the protocol used. More info can be found in the embedded help.

The SMS can be then delivered to a SIP phone as SIP message or to any other destination

Bulk DIDs creation

It is possible to create multiple DIDs at once with the Bulk DIDs creation button. In this way a range of number is requested. All the numbers generated are configured in the same way.

Use DIDs storage

In the Admin/Settings page is possible to choose to use the DIDs storage. In this way the DIDs needs to be entered by the Admin/DIDs List menu and can be later chosen using a drop down box from the Define DID page. DIDs cannot be deleted, but they are just not assigned to any tenant.

Outbound CallerID Regex

DIDs are used by extensions as CallerID, but it is possible to select a Regex to pickup the most useful CallerID for that call, so you may use your italian office CallerID when dialing to Italy or your american one when dialing to US.

Media Files

Media files are used for music on hold, welcome messages and for every kind of message played to the user.

Each media file is internally addressed by its MD5 sum and a local copy is stored on each node to reduce the load on the database server. A name can be assigned to the media file to easy identify in the system. To reduce the asterisk load when playing, it can be automatically converted into slin format (16 bit Signed Linear PCM). Unfortunately it seems not available any player for MS Windows able to play the slin format, so if you plan to convert your media files to slin, you'll be not able to listen to them from the web interface.

It is possible to dial a number, internal or external and have a message recorded. The call will come with the number to dial as caller ID, so if your phone can have some problem receiving a call from its same number, check the “Block Caller ID” to hide it.

A module for doing transcript of text using any of the engines configured (currently IBM Watson and AT&T) is available and is subject to their limitation. You can choose the Language among the available languages.

When using the TTS facility, you can choose to create immediately the file and store in the system or create every time it is needed. This is useful when you have some variables in the text or when you have external scripts changing the text to be played to the caller.

It is possible to upload a file and convert it to the desired format or leave it as is. Please note not any kind of wav file can be played, so if unsure, leave it on “Automatic”.

Transformation can be applied only when the file is uploaded or when the “Dynamically during the call” is selected.

Conditions

Conditions allow to manage the call flow, playing for example a different messages or routing the call based on hours, or days, or calling party. Conditions can also apply to extension state or user input.

Several type of Condition can be configured:

Weektime	a complete week planner allows to easily identify in which day/hour to trigger the destination.

Calendar	a complete calendar with dates

Hours	specify distinct hours range

Caller ID	the routing decision is made using the Caller ID of the call. For example, allowing coworkers calling the main number to reach directly the support staff without waiting in the Queue.

Weekday	allows to route calls based on the day of the week

Date	permits to route the calls based on specified dates. A date, like Christmas, can be made “recurring”, so it will trigger every day, regardless the year.

Extension Status	the routing decision is made based on the status of an extension. This condition is really powerful when connected to the custom setting of extension status or a Flow/Variable.

Variable Value	check the value of a variable defined in the Flow/Variable sections

AGI Script	execs an AGI script and check the variable AGIRESULT. If set to true, the condition is matched, otherwise the “not match” condition is followed.

Authenticate	request a PIN to be entered

Tenant – number of channels	permits to check the number of channels used by the tenant

DID – number of channels	permits to check the number of channels used by the selected DID

Answering Machine Detection	useful when using Call Campaigns, allows to identify answering machine

IVR

IVR allows to define Interactive Voice Response to manage voice menus.

Welcome Message is the media file to play to the calling user while waiting for the user choice

Menu selection timeout is the time in seconds to wait for the user choice before going to the “On timeout” destination.

Digit timeout is used when the “Allow Dialing Extensions” or the “Allow Dialing Features Code” is selected allows to determine the amount of seconds to wait before considering the number entered as “complete”

Loop on timeout permits to continue to play the welcome message and to wait for the selection every time the Menu selection timeout expires.

Loop on wrong key press allows to restart playing the welcome message and to wait for the selection if the user choose an unsupported key.

Allow Dialing Extensions permits to the calling user to dial directly an extension instead of picking one of the digits.

Allow Dialing Feature Codes, like above, but for feature codes.

Hunt List*

Hunt List permits to define a list of extensions or external numbers to dial at all once or in sequence.

The Type of the Hunt List can be:

Ring All – All extensions and external numbers can be dialed all at once

Cycle – Extension and external numbers are dialed in the order specified and once the bottom of the list is reached, the “hunt” starts over.

Sequence – Extensions and external numbers are dialed in the order specified. When the bottom of the list is reached, the destination specified in the “On timeout” is followed

Check if exten are in use allows to skip dialing extension already in use

Request confirm to answer if set, requests the dialed user to accept or reject the call. If the call is rejected, the hunt list continues trying to locate a phone

Ring Time allows to specify the time each extension or external number has to be dialed before skipping to the next item.

Conference Rooms*

A conference room or meeting room is a virtual place where all phones dialing are joined in a single conversation. Conference rooms can be protected by a PIN and a special Admin PIN is reserved to the administrator, so he can mute/unmute partecipants. The maximal number of users allowed in the conference can be set.

The conference can be recorded. The audio file is available through the Call History.

Call Queue*

Call queue permits to hold all the incoming call in a queue and distribute the calls to the agents available.

Strategy can be one of the following:

Ring All – All agents are rang at the same time

Round Robin – agents are rang, one at the time, in a round robin way

Random – agents are rang in a random order

Least Recent – The least recent agent is rang

Fewest Calls – The agent with the fewest calls is rang

Linear – agents are rang in the order specified. Due to some asterisk limitation, it is not possible to change the Strategy of a already defined Queue to “Linear”. The queue needs to be destroyed and recreated.

Always Record allows to always record the call. The call record is available trough the Call History.

Play to the caller permits to define if playing the defined Music on Hold for the tenant or a generic Ringing

Agents lists the agents in the queue. For each extensions, two kind of agent are available, the first is normal and the “following to A.D.” permits to forward the call to the Additional Destination defined for the extension.

Queue timeout is the amount of time the caller can be hold in the queue before being sent to the destination specified in the “On timeout”

Agent Timeout is the amount of time an agent is ring before moving on the next agent.

A special action can be configured when No Available Members are present in the queue.

Periodic Announce section allows definition of the announce to play to the callers in the queue with the Announce Frequency. The Periodic Announce can be chosen between the media file loaded.

The user can exit the Queue by pressing the “Queue Exit Key” and he will be directed to the destinations chosen by the “On Exit Key”. A special destination can be selected, named “Exit the Queue and call back when it is your turn” allowing the caller to hangup the call and being called back when he is in front of the queue, ready to be served.

The position of the user can be played with the “Announce Pos. Frequency”, if different than zero.

It is possible to redefines the messages usually played to the user choosing them between the media file uploaded

Paging and Intercom*

Almost all SIP phones allows to page them and use as intercom: the ability to establish a mono directional or bidirectional communication without making them ring.

The number defined can be called directly by all extensions and it can be chosen if to make a bidirectional call (intercom) or just use the service as paging device.

Some phones requires adjustment to the configuration to allow them to auto answer. For example, the Polycom VVX 300 requires the following setup:

Cisco SPA phones instead requires this parameter set:

Flow & Variables

A flow is a predefined set of destinations that can be used in other Configuration directive. It is like a Macro, allowing to use the same steps of destinations in several place and maintain in a single location.

A flow can have a number associated, so dialing that number, will make the action assigned.

Assigned to each flow there is a variable that can be used to track a PBX status, like day/night or even something more fancy. The variable name can be referenced in the destinations, when allowed and several values can be assigned to each of the states, so the change in value will change also the status of the BLF for the flow number.

Check the “Condition Override” in the Setup Guides for an example

Custom Destinations

Custom Destinations allow the definition of custom destinations to be used in other Configuration settings.

There are several type of custom destinations:

Forward call to – will permit to forward the call to an outbound number, using a timeout for the dialing. The dialing timeout has to be entered separated by a comma. The CallerID can be chosen among the usual Caller ID available and use the Original Caller ID of the call received.

Alter Caller ID to – will permit to change the Caller ID to a custom one. Standard Asterisk variables, like ${CALLERID(num)} can be used.

Alter Caller ID Name to – will permit to change the Caller ID Name to a custom one. Standard Asterisk variables, like ${CALLERID(name)} can be used.

Custom Dial() with param – will permit to use the Dial Command as argument to a generic Dial command. Param1

Use Feature Code – Like to “Forward call to”, but a feature code can be used

Set Extension to not in use: Set the extension state to “not in use”

Set Extensions to in use: Set the extension state to “in use”

Toggle Extension state: Change the extension state from “in use” to “not in use” or vice versa.

Call Through: asks the number to dial and then connect to it.

Connect to Queue at position: permits to connect a call to a queue at an arbitrary position

Connect to a conference by entering the PIN: prompt for the PIN of a conference and connect to the conference having that PIN

Count this channel in custom group. Some calls can be “marked” and counted, so you can use a condition to check how many calls of that type are currently running

Dial as: permit to dial a number as it was dialed by the phone

Email to: permits to send an email. You can check the variables available on the context help over Email template label.

Originate a call and connect to destination: permits to originate a call and connect to a destination

Play mediafiles in /var/lib/asterisk/sounds: allows you to play a mediafile stored in filesystem

Play to the called party when answer allows to play a message to the called party when he answers

Read a variable

DISA*

DISA stands for Direct Inward System Access and is a way to let inbound callers to reach any internal extension. Once answered the system will play a message inviting the caller to enter the extension number to be connected to. The system allows also to dial outbound numbers, usually protected by a PIN code.

The Welcome message is played to the calling party, usually asking to enter the extension to dial. If present, the PIN is requested to access this feature. It is highly advisable to set a PIN when outbound calls are allowed.

Feature Codes*

Feature Codes are the key to access any aspect of the PBX, trigger special features or just performs tricky operations. Feature codes can start with the * (star) or with the # (sharp) and can be associated to a number of action from the following list. When requested, the special string [NUM] and [EXT] can be used in the feature code. The [NUM] will be replaced with the number dialed. For example, if a feature code is set to *62[NUM] for “Mask the callerid on calling [NUM]” then if the number *625558764 is dialed, then the [NUM] is assigned to the number 5558764. The [EXT] instead will be replaced with an extension number. If a feature code is set to *8[EXT] to Pickup Extension [EXT] and you have defined extension 100, then dialing *8100, the extension 100 will be picked up.

Feature code *1 is reserved (due to asterisk limitation) to enable/disable recordings.

List standard feature codes:

Feature Code	Description
Answer the call	Usually not needed, it just answer the call
Barge with extension [EXT]	Barge with extension [EXT]
Dial by name directory	Access to Dial by name directory menu
Dial by name using the [NUM] dialed	Use the dialed [NUM] to call using dial by name
Disable FMFM extension	Disable FMFM for the calling extension
Disable on busy forwarding for calling extension	Disable on busy forwarding for calling extension
Disable on no answer forwarding for calling extension	Disable on no answer forwarding for calling extension
Disable on offline forwarding for calling extension	Disable on offline forwarding for calling extension
Disable unconditional forwarding for calling extension	Disable unconditional forwarding for calling extension
Echo test	Perform an echo test, repeating all what is said
Enable FMFM	Enable FMFM for the calling extension
Enable on busy forwarding for calling extension	Enable on busy forwarding for calling extension
Enable on no answer forwarding for calling extension	Enable on no answer forwarding for calling extension
Enable on offline forwarding for calling extension	Enable on offline forwarding for calling extension
Enable unconditional forwarding for calling extension	Enable unconditional forwarding for calling extension
Force Recording of the call	Activate the recording for the call
Hangup the call	Hangup the call
Intercom with extension [EXT] (two way audio)	Perform an intercom (two way audio) with the extension dialed [EXT]
Login to all Queues	Login the calling extension to all queue
Logout from all Queues	Logout the calling extension to all queue
Mask the callerID on calling [NUM]	Activate the Privacy Mode while calling the [NUM]
Page extension [EXT] (one way audio)	Perform a page (on way audio) with the extension dialed [EXT]
Park the call	Park the call
Pickup Extension [EXT]	Pickup extension dialed [EXT]
Pickup Group	Pickup a call from the current group
Play Beep	Play a simple beep
Play the callerid of the calling party	Play the callerid of the calling party
Record a Message	Record a message. The message is recorded and added to the list of media files with the date and time of the recordings. Usually it is renamed and used in some menu
Retrieve the voicemail of the calling extension	Retrieve the voicemail of the calling extension
Retrieve the voicemail of the [EXT] dialed	Retrieve the voicemail of the extension [EXT]
Say the parked calls extensions	List the parking lot used by calls parked
Set Extension [EXT] state to in use	Set the state of the extension [EXT] to “IN USE”
Set Extension [EXT] state to not in use	Set the state of the extension [EXT] to “NOT IN USE”
Set FMFM number to [NUM] and enable it	Set the number [NUM] dialed as FMFM for the calling extension.
Set on busy forwarding for calling extension to [NUM]	If the [NUM] dialed is not an internal extension, then the [NUM] is checked among the Custom Destinations. If one of the Custom Destinations is matching the [NUM], then it is used, otherwise a new Custom Destination is automatically created and set as Busy Forwarding.
Set on no answer forwarding for calling extension to [NUM]	If the [NUM] dialed is not an internal extension, then the [NUM] is checked among the Custom Destinations. If one of the Custom Destinations is matching the [NUM], then it is used, otherwise a new Custom Destination is automatically created and set as No Answer Forwarding.
Set on offline forwarding for calling extension to [NUM]	If the [NUM] dialed is not an internal extension, then the [NUM] is checked among the Custom Destinations. If one of the Custom Destinations is matching the [NUM], then it is used, otherwise a new Custom Destination is automatically created and set as Offline Forwarding.
Set unconditional forwarding for calling extension to [NUM]	If the [NUM] dialed is not an internal extension, then the [NUM] is checked among the Custom Destinations. If one of the Custom Destinations is matching the [NUM], then it is used, otherwise a new Custom Destination is automatically created and set as Unconditional Forwarding.
Spy extension [EXT]	Spy on extension [EXT]
Toggle state of extension [EXT]	Change the state of the Extension [EXT] from IN USE to NOT IN USE and vice versa
Unmask the callerID on calling [NUM]	Remove the Privacy Mode while calling the [NUM]
Voicemail for Extension [EXT]	Retrieve the voicemail for extension [EXT]
Wait five seconds	Wait five seconds
Wait one second	Wait one second
Wakeup Alarm - Disable the time set	List all wake up alarms set for the calling extension and allow to delete one of them
Wakeup Alarm - Play the time set	List all wake up alarms set for the calling extension
Wakeup Alarm - Set the time from DTMF HHMM	Set a wake up alarm by requesting to enter the hour in the HHMM format

New Feature Codes are automatically created when any of the object is created, as follows:

Object	Feature Code
Extensions	Allowing to dial the extension listed
Custom Destinations	Allowing to dial the destination defined
Media Files	Rerecord, Playback and Background the media file
Conditions	Check condition
IVRs	Execute IVR
Hunt Lists	Execute hunt lists
Conference Rooms	Access conference room
Queues	Access queue
Flows	Execute flows
DISA	Access DISA
Voicemails	Send the call to the voicemail
Whisper to extension [EXT]	Whisper to extension [EXT]

Short Numbers*

Short numbers are a way to assign shortcut for dialing numbers.

CallerID Black List*

It is possible to avoid to receive calls from a list of caller ID by entering them in this list. Calls from those numbers will be hangup directly.

Call Campaigns

Using call campaigns is possible to dial automatically a series of numbers and play a predefined message or connect to an extension, queue, conference room. It can be used for advertising, marketing or just as an appointment reminder. A call campaign can start automatically or be manual started/stopped.

“Call for meeting” call campaign can be manually started and stopped while the “Next Meeting” automatically starts at 2016-04-17 and ends 2016-04-24.

Name is the internal name for the call campaigns

CallerID allows to specify which CallerID to use when dialing the numbers

Type can be “On demand start/stop” or “Scheduled”

AGI Scripts*

It is possible to use AGI Scripts as normal call flow elements or as conditions.

AGI Scripts are usually located in /var/lib/asterisk/agi-bin and some examples are provided along with the AGI used by MiRTA PBX.

Each AGI Script can have at least 5 parameters and some can be assigned by the admin and others can be assigned by the user.

When the AGI Script is used as a condition, the variable AGIRESULT is tested and if it is TRUE, the call flows as the condition is matched.

A simple AGI Script to say the date and time. Remember to set the execution bit.

#!/usr/bin/php

<?php

require_once('phpagi/phpagi.php');

$agi = new AGI();

$agi->exec('sayUnixTime',$argv[1].",".$argv[2].",".$argv[3]);

?>

Another simple AGI Script randmizing a number and comparing with the one provided as parameter.

#!/usr/bin/php

<?php

$number=rand(1,10);

$agi = new AGI();

$agi->Verbose("Your guess is with the number ".$argv[1]);

$agi->Verbose("The random number $number as been selected");

if ($number==$argv[1]) {

$agi->set_variable('AGIRESULT',"TRUE");

} else {

$agi->set_variable('AGIRESULT',"FALSE");

}

?>

Settings

Every tenant can have its own settings. The settings page is divided in sections.

Recover VM messages dialing your own same number. Dialing your own same number is not really useful, so why don't assign this action to recover the VM messages?

When recovering your same number VM, prompt for password permits to skip requesting the voicemail password.

Dial timeout identifies the standard time the dialing command will ring an external number or resource before reporting as “No Answer”.

Extension Dial timeout identifies the time the dialing command will ring an extension, so this is the time an extension will ring before going to the “No Answer” destination.

Max call duration sets the maximal time, in second, a call can last connected.

Dialout digit allows you to define a digit to use for dialing out. If not set, all not local numbers are dialed outbound

Voice Message Language lets you specify the default language to use in the Voicemail and all other voice messages.

Parking log timeout specifies how long in second a call can stay parked before returning to the parking extension.

Default CallerID for autocreated custom destinations. This is the callerid to use when the system needs to generate a Custom Destination, like for example when an unconditional transfer is set using a feature code.

Call waiting. Even if call waiting is usually set on the phone, rejecting or allowing the receiving of a call while online with another call, you can enforce also from the server, reporting busy an extension in use.

Inbound CallerID Modifications sets the CallerID modification to apply to all inbound calls.

Recording name permits to specify which format to use for storing the recording file in the system.

Recording format. The recording format for monitoring calls can be choosen between Uncompressed 16-bit PCM Audio in Wav container and MS GSM audio, still in Wav container.

Play a beep when starting/stopping “on call” recording allows to play a beep when the recording is activated or deactivated while on call, using #0 and #1

The system can be configured to use a Text to Speech engine, currently only AT&T and IBM Watson service. You can choose the voice to use and provide tenant API username and password

You have several choice when coming to dial by name directory: “Yes” will always play the directory name of the person selected, “Yes with confirm”, after having played the directory name, will ask for confirm (1). “No”, will connect directly to the person selected

CNAM service allows to use the popular service in the US and optional in any other country providing number to names conversion. You can configure the caching of values received and the number of days to hold those cached values.

Outbound fax prefix permits to specify a prefix to be automatically applied to any fax sent, in this way you can route the fax calls to a different provider with better fax support. The prefix will be applied to “Send fax” and to extensions configured as “T.38 Fax Gateway”

Show only Fax DIDs will permit to pickup as callerID only DIDs able to receive a fax

API Key. The API Key is used for the proxyapi.php API script.

Read Only API Key is an additional API key that can be used only for gathering statistical data, without being able to place calls.

Music On Hold allows to choose the files to use as Music On Hold for the given tenant. If no files are choosen the standard asterisk Music On Hold files are used. The files need to be in wav or slin format. Alternatively, a binary source of music can be selected, like a public streaming service entering the URL in the “Streaming Service” field, like http://s9.voscast.com:7136/

Using the “More” button you can access the full Music On Hold configuration page, allowing to upload several MOH files to be selected in the dialplan.

Security section allows to configure the list of IP address from which the extensions are allowed to connect. Leaving it empty allows any IP.

You can enable a “Working hours restrictions” by selecting a WeekTime Condition. Extensions will be able to place calls only inside the selected timeframe.

Volume TX and RX level increase or decrease the volume of extensions. You can also activate a DTMF volume control.

Different distinctive ringing can be selected based on the type of calls. Not all phones support the list of distinctive rings available.

On call start/end, run AGI script permits to choose an AGI script to run when a call placed by an extension is started/ended.

On internal call busy permits to select a call reservation, so when a call to an extension is busy, the caller will be prompted to press a digit and being called back when free. You can also select to generate a “callwaiting” tone to the caller when the dialed number is busy.

CallerID on blind transfer allows to set which callerID use when a blind transfer is performed

Generate a confidence ringing when dialing out allows to select if to generate or not the “fake” ringing when placing outbound calls.

This settings specifies if store or not the SMS send for internal messaging

DB data retention can be specified for each tenant.

Web calls are calls generated using an HTTP request. A simple proof of concept is supplied with the webcall.php script. The generation of calls can be restricted using a password or by IP. The webcall.php script can be run either from the command line or by invoking using GET or POST method.

When run in CLI mode, the arguments are in order: source number, destination number, tenant code and secret key.

When run in GET/POST mode, the following variables needs to be assigned: source, dest, tenant, secret.

For example, getting the URL:

https://demo.mirtapbx.com/mirtapbx/webcall.php?source=104&dest=102&tenant=DEVEL&secret=H63JpSdPEWequMpr

Will make extension 104 to ring, once answered, extension 102 is dialed.

Call History destination view permits to change the way the system shows the destination in Call History. Use Dialed and Expanded digits are shown.

Use branches and departments enables two additional fields in Extension definition, allowing to manage the extensions by branches and departments, when activating the jqgrid view.

Call History view permits to change how to show the Call History, if in the way asterisk generates it or trying to collapse all the legs in a single row.

In Additional Info a comment for the tenant can be added.

Mail to Fax

Mail to Fax permits to define one or more email accounts on your preferred hosting company, retrieve and authenticate the emails sent to them and use the attached PDF to deliver a fax to the number specified in the subject.

In the above case, an email account fax@mirtapbx.com was created on web-hosting company and it is automatically polled every minute to check for new email. If an email is found, the sender email is checked against the Authentication Data. The only authentication type currently allowed is “Sender Email”. Just put the email or domain separated by CR or ; or ,

If you plan to use a Gmail email to receive the faxes, you'll find a lots of problems authentication unless you lower the security of you account:

https://www.google.com/settings/security/lesssecureapps

Voicemails

Voicemails can be created directly when creating an extension or using this menu. A voicemail box or mailbox have a number associated and a PIN number. When creating the voicemail from extension page, the PIN is automatically generated. Voicemails can be listened from the phone, by creating a feature code to access them, dialing you own voicemail and accessing the operator panel or using the web interface, using the menu Status/Voicemails. Voicemail email can be customized using an email template.

Name is the name shown in the voicemail message.

Email is the email to send the voicemail message, with the attached voice message.

Timezone can be used to choose in which time zone the message will be sent.

Pager is another mailbox to be used for receiving small notification when new messages arrive.

Envelope playback controls if asterisk needs to play the date and time before playing any voicemail message.

Attach message allows to choose if to attach or not the recorded message to the email.

Automatic delete will delete automatically any received voicemail message once delivered by email.

Allow review permits to the caller to review the message left and maybe rerecord.

Greetings controls what message to play to the caller when hitting the voicemail box.

Language specifies the language to use when playing messages to the caller.

You can specify the Max number of messages, once the voicemail hits that number of messages, no more messages can be stored or received.

With Min len of voicemail message in seconds, if a message left was shorter than the limit set, the message will be discarded.

Enabling Operator/Extras permits to the caller to access the voicemail messages entering the PIN or performing special actions if the operator key is used. Press * to be prompted for the Pin or press 0 to access the operator destination defined.

Greetings allow you to upload a custom message for voicemail internal messages.

Provisioning

Provisioning is the action of configuring a phone automatically, by providing only basic informations. MiRTA PBX supports a wide range of phone provisioning with a general file format. New phones brand and model can be added using the Admin/Provisioning menu.

Phones

Files used for provisioning are usually text or XML file containing informations like the user and password and the ip address or hostname of the SIP server. Informations contained in the provisioning files need to keep confidential and the leakage of these informations can lead to unauthorized usage of voice traffic. To avoid any snooping on provisioning content, usage of HTTPS is recommended. Be aware some phones requires a valid SSL certificate to provision using HTTPS and some other (Cisco) require a certificate signed by the manufacturer. The correct provisioning file is requested based on the MAC address of the phones. To avoid any brute forcing of the MAC address, a special password is needed in the URL to recover the file. Based on the model of the phone, a special string needs to be append to the end of the provisioning URL, like {mac}.cfg for Panasonic phones or {MA}.xml on Cisco phones. Check your phone manual for the right way to identify the MAC address in the provisioning URL.

New Phone

Each phone can be named. The phone name is just used as reference and is not used anywhere else.

Model permits to select the provisioning template to use. Provisioning templates can be created using the Admin/Provisioning menu.

Mac Address is the key identifying the phone needing to be provisioned.

Password is a random key needed to prevent any brute forcing of the mac address. It is needed to be added to the provisioning URL.

Based on the definition of the phone model, one or multiple lines can be shown, allowing to select one or multiple accounts from the Extensions defined for the tenant.

One or multiple button layouts can be defined and assigned to the phone.

One or multiple phone books can be defined and assigned to the phone.

Autoprovision Values

When configuring the provision for a phone, you make a connection between the extensions in the pbx and the lines in the phone. Unfortunately it is not enough. The phone may request additional configuration you can enter by using the Autoprovision Values button.

The Autoprovision Value button is shown only once the phone has been saved.

Two kind of autoprovision values can be needed:

The general one can be configured by clicking on the name and MAC address of the phone on the right and will be used to configure values defined in the template file applying on the whole phone. These values are realted to “PHONE” type variables.

The line related one can be configured by clicking on the Line desired and usually are already prefilled with values read from the extension configuration. Other values, like the server name and SIP port needs to be manually filled. Please refer to the Admin/Provisioning section on how to defined predefined values and build custom templates.

Button Layouts

Button layouts are another kind of variable type and are referring to the ability to define the meaning of the buttons on the phone, usually used for BLF or direct pickup. They can be defined in the template using any {$loop_<name>} setting. The name will be the one used to define the Button Layouts. For example, if in the template we have something like:

{loop_attendant-console}

<Unit_1_Key_{$key} ua="na">{$type};sub={$parameter}@demo.mirtapbx.com;nme={$label}</Unit_1_Key_{$key}>

{/loop_attendant-console}

We can use this template defining a button layouts named “attendat-console”. In this case only few variables are used, the other can be left empty.

Phone Directory

If the phone model has been configured correctly, you can use one of the phone book defined in the tenant to load the phone directory. Not all phones support this feature.

Status*

Using the Status menu, a complete overview of the status of the system can be obtained. As other parts of the system, status is realtime. The info reported by the Status menu are related to the selected Tenant and are available to the not-admin profile.

Call History*

The info for every call, internal or external, inbound or outbound is saved in the Call History along with basic information regarding the source and the destination.

For every call the info regarding the start time, the caller ID, the extension source of the call (if call is originated by the internal network), destination, duration, answered duration (billsec), disposition, cost and if any recording is available for the call.

Call History is retained for the amount of days configured in the Admin/Settings menu.

The disposition of the call is a link to access additional information gathered by the VoIPMonitor system.

Info like the progress time, who hangup, the codec used in the call, the IP of the caller and the called are easily shown few seconds after the call has ended. A basic MOS calculator is included.

The packet jitter and the latency can be easily show in the graphs following the raw data above.

A basic decoding of the call SIP message is available under the graphs.

Using the floppy disk link is possible to download the complete pcap of the call or just check a detailed pcap dump.

Queue History*

The info reported in the Call History are not enough when the call is processed using a Queue. More info for each call using the queue system can be found in the Queue History.

Along with the Date, the Queue name and the Caller ID, a detailed disposition of the call is shown with the agent who get the call, the hold time of the caller and the call time. The original position of the caller when accessed the queue is also reported.

More detail of the call can be seen following the DETAIL link.

Peers*

Info on all the connected peers are shown along with all the info gathered during the registration process, like the brand and firmware version of the phone and even the internal IP address.

Using the big red cross is possible to unregister a phone. Unregistering a phone is needed every time the configuration for the phone, like its password or the codec are changed. Some phone model, like Tiptel and Yealink, allow to remotely reboot the phone using the circled red arrow.

Conferences*

Using this menu, the status of all the conference rooms taking place on the server, for the selected tenant can be shown.

Faxes*

All faxes received by the system for the selected tenant can be viewed here if the fax has been configured for storage

Voicemail Messages*

Voicemail messages received by the tenant can be viewed here if they are configured for storage

Balance*

The actual balance of the selected tenant can be seen

Using the insert button at the bottom, the admin can charge or load the account with some money.

Stats*

Several statistics are available in the system for inbound, outbound and queue/agents calls. Clicking on the values will show the calls counted.

Stats are available for User Activity showing Outbound Calls Answered, Busy, No Answered and Failed, Inbound Answered, Busy, No Answered and Failed.

Stats are available for DID Activiy showing Inbound Calls Answered, Busy, No Answered and Failed for each DID.

Stats are available also for Queue Activity and Agent Activity, showing the calls entered in the queue and how the call ended, if answered, transferred, abandoned or time out, along with the holding time.

The same values can be read divided by each agent and each queue:

Administration section

The access to this part of the menu is allowed only to Admin users and usually any setting made is valid for all tenants.

Providers

MiRTA PBX uses Asterisk Realtime Architecture so informations are pulled by asterisk directly from the database. All information for providers can be stored in the real time database, except for the “registration” command. If your provider is requiring you to register with the “register =>” command in sip.conf, this info cannot be stored in the realtime architecture and you are forced to save it in the sip.conf file and then reload the sip part. Be warned that reloading the sip part of asterisk makes all realtime peers to be disconnected. In other words, if you reload asterisk or just the sip part, all phones will lost their registration and cannot receive any call until a new registration takes part. Unfortunately it is not possible to trigger the registration from the PBX. The phone has a timer and it makes a new registration only when the time is arrived. It is suggested to use a low timer, maybe 60 seconds, to make registrations more frequent.

There is no limit in the number of providers that can be defined. Some clients prefer to have one distinct provider for each tenant, others are using the same provider for all the tenants. Both options have pros and cons to consider. It is suggested to have more than one provider to use as a primary/backup solution or to round robin the call between them.

For every provider a custom Name can be chosen. That name will be used in the other screen to identify the provider.

The Peer Name needs to match the name given in the sip.conf (if the provider is defined in sip.conf, otherwise it will be just used as internal name)

The Technology is the type of provider. SIP, IAX2, DAHDI and local providers are available.

Additional Headers are additional SIP headers your provider might request.

Digits to add allows you to enter any special security code some providers are requiring to process a call. This code will never be shown in the Call History.

Digits to remove let's you specify the number of digits to remove from the number dialed

Penalty is the number of calls processed by the Provider and it is used to distribute calls among providers whit a round robin strategy.

Caller ID Modification allows to specify the action to apply to the caller id used for dialing.

Status permits to temporary disable a provider.

Pressing on the “Use realtime account” allows to enter the details of the SIP account used.

Provider Costs*

To be able to route calls using the Least Coast Route (LCR), you need to define the costs for every destination using each provider.

Every row can be changed using the buttons at the left bottom corner. To make it easier to load the data, a CSV import function is available.

CSV import*

Once the file has been loaded in the system using the “Load file” button, the format of the file needs to be selected, by providing the Delimiter, the Enclosure, the Decimal point used and the Escape value. It is important to decide what to do with the old data already associated with the Provider Costs. If you want to add the loaded file to the current costs or to replace. Once these values has been set, a first check will show in the table the decoded values by pressing the “Check” button. The check button can be pressed multiple time while the settings are adjusted.

Once the fields are correctly decoded, it is time to assign each field in the file loaded to the field in the Provider Cost Table. It is possible to apply some adjustment by using the available action drop down.

For Prefix you can add a prefix or remove some digits from the start of the prefix

For the Cost per Minute you can set the value to a specified amount, increase or decrease by a specified amount or increase or decrease by a percentage entered like 10%

Billing*

Billing menu allows to access to the billing part of the system

Balance Dashboard*

Using the Balance Dashboard is possible to have a general view of all the tenants account with the credit or debit associated.

A date filter is available to restrict the balance to the selected dates. It is possible to recalculate the balance in case the call rates have been changed or to export the data in a CSV file.

Outbound Call Rates

Each tenant has associated an outbound call rate. Using this menu is possible to define an outbound call ate. An unlimited number of outbound call rates can be defined.

The call rate section is similar to the Provider Cost seen before, but with some additional columns available.

Country is just a descriptive column

Network is an other descriptive column

Prefix is the prefix to match the call. The best matching prefix is used.

Cost/Minute is the cost for each minute of conversation

Minimum Cost is the minimum amount charged for the call

Rounding Cost Digits is the number of digits used for the rounding

Rounding Time is the ceil used for time rouding.

Let's make an example. A call rate is 0.10/minute with a setup cost of 0.03, a minimum cost of 0.5 and a rounding time of 6 seconds.

The first call lasts just 10 seconds. Due to the rouding time, the call duration is increased to 12 seconds. The initial cost for the call is 0.03 (setup cost), plus 12 seconds at 0.10/minute are 0.02, so the total cost will be 0.05. But the minimum cost for the call is 0.5, so the call cost is set to 0.5.

The second call lasts 8 minutes and 58 seconds. Due to rouding time, the call duration is increased to 9 minutes. The initial cost for the call is 0.03, plus 9 minutes at 0.10/minute are 0.90, so the total cost will be 0.93. This is already greater than the minimum cost.

The data can be loaded or exported using a CSV file as in the Provider Cost.

Provisioning

Provisioning of phones is phone independent, meaning MiRTA PBX has no knowledge of the various brands or models, but offers a generic framework to create a template and use some variables. Some variables are already stored in the system, but more can be added easily.

Provisioning is made over HTTP and HTTPS. Obviously it is preferable to provision over HTTPS to avoid having SIP credentials to travel in clear over the Internet. Some brand of phones are quite picky about the certificate authority used for the SSL, so in case of problems, it can be good to make a test using HTTP or check the phone configuration about third party CA.

Some phone templates are provided as proof of concept, but they are not supposed to be neither complete neither accurate.

Phone Models

Several phone models can be defined. For each phone model the number of lines needs to be defined, usually with the starting and ending line number. Please refer to the phone's provisioning guide to customize or create new templates.

The MAC request contains the text file that needs to be delivered to the phone for the provisioning while the start and end lines are used to provision different accounts.

The template may contain variables in the general format ${name|default|type|options}.

Some variables are predefined and are read directly from the system configuration:

line_active – Always 1

displayname – Name of the Extension assigned

username – SIP username

authname - SIP username

number – Number of the Extension assigned

secret – Password of the Extension assigned

tenantcode – Tenant code for the Extension

line – Order position of the line (usually 1, 2, 3, etc)

line_m1 - Order position of the line (usually 1, 2, 3, etc)

key - Order position of the line (usually 1, 2, 3, etc)

mac – Mac Address of the phone, without :

provisionpassword – Password for provisioning URL

It is possible to define loops in the template using the {line_loop} and {/line_loop} keywords.

Each variable used needs to be defined in the “Variables” menu. In case a variable is not defined, an alert message will be shown.

A default value can be defined for the variable, using the | character, like:

{$server_host|demo.mirtapbx.com}

To help users in configuring their system, you can specify the editing box type, so if by default is a text type as in:

It can be shown as radio button when configured this way:

{$srtp|off|radio|on,off}

Or using a select box type when configure this way:

{$server_host|demo.mirtapbx.com|select|demo.mirtapbx.com,demo02.mirtapbx.com}

If your variable configuration must contains a |, like in the local dialplan definition of some phones, you can use %% as separator instead of the |, so for example, the last variable will be defined this way:

{$server_host%%demo.mirtapbx.com%%select%%demo.mirtapbx.com,demo02.mirtapbx.com}

You can use labels to define some values, so for example you can name the first server as “Primary” and the second as “Backup” as follows:

{$server_host|demo.mirtapbx.com|select|Primary=demo.mirtapbx.com,Backup=demo02.mirtapbx.com}

Phone Directory

It is possible to define the template for the phone directory to be used in conjunction with a phone book. You can use the codes defined for the phone book, like:

NAME, PHONE1, PHONE2, PHONE3, PHONE4, PHONE5, PHONE6, PHONE7, FIRSTNAME, LASTNAME, COMPANY

Button Layouts

Button layouts can be defined in the template by using any keyword like {loop_sdext38} {/loop_sdext38} or {loop_attendant-console} and {/loop_attendant-console}. The button layout name will be sdext38 and attendant-console respectively. Inside the button layout structure you can use any of the variables defined as BUTTON (see below). No variables are automatically set except for the “key” variable set to the ordering of the key. By default the following variables are defined and can be used: type, parameter, label, account, extension. There is no default meaning for these variables. The meaning will be defined in the template. For example, a Yealink button template can be defined as following:

{loop_memkey}

[ memory{$key} ]

path = /config/vpPhone/vpPhone.ini

Line = {$line}

type = {$parameter}

Value = {$extension}

Callpickup =

DKtype = {$type}

{/loop_memkey}

For a Cisco SPA

{loop_attendant-console}

<Unit_1_Key_{$key} ua="na">{$type};sub={$parameter}@demo.mirtapbx.com;nme={$label}</Unit_1_Key_{$key}>

{/loop_attendant-console}

Grandstream uses a different approach and needs a different way to provision Button Layouts. Instead of a loop, you need to define a block and use the sharp to identify each of the buttons:

{block_gxp}

<P6001>{$type#1}</P6001>

<P6201>{$account#1}</P6201>

<P6401>{$label#1}</P6401>

<P6601>{$extension#1}</P6602>

<P6002>{$type#2}</P6002>

<P6202>{$account#2}</P6202>

<P6402>{$label#2}</P6402>

<P6602>{$extension#2}</P6602>

<P6003>{$type#3}</P6003>

<P6203>{$account#3}</P6203>

<P6403>{$label#3}</P6403>

<P6603>{$extension#3}</P6603>

<P6004>{$type#4}</P6004>

<P6204>{$account#4}</P6204>

<P6404>{$label#4}</P6404>

<P6604>{$extension#4}</P6604>

{/block_gxp}

Custom Files

Using Custom Files you can let your phones download any additional file, like firmware, images or ring tones.

Files are addressed based on the name, using any of the valid key for the phones.

Files stored here are available in any tenant.

Using the “donwload” icon you can download the file manually.

Variables

To be able to use a variable in the template, you need to define it providing a description. The description will be used as label in the input form.

There are three kind of variable:

PHONE – This kind of variable is used to provision general setting for the phone

LINE – This kind of variable is used for provisioning lines

BUTTON – This kind of variable is used for button layouts

PBX Nodes

The MiRTA PBX system can be composed of several pbx nodes. License is enforced only for the number of pbx nodes. In the main screen, the number of connected peers for each node is shown. A series of extra actions are available and a check for ODBC connectivity is performed.

Asterisk may have some problem when it is started and MySQL database is not yet ready. There are a total of 4 ODBC datasource used, two for configuration (asterisk1 and asterisk2) and two for CDR (asteriskcdrdb1 and asteriskcdrdb2). While the datasource for the configuration is automatically restarted if disconnected, the CDR datasource will not. That happens only at start. If any of the datasource is not connected, a red exclamation point is shown as following:

The available extra actions are:

Process Logs

Each process run on the system writes some info. A severity of 10 means “All is fine”. An higher severity means some problems. It can be useful to check periodically

Core Status

Core Status offers some info about the running system

Current Channels

Current Channels shows the running channels info.

Fax Status

Fax Status shows the status of the fax module

BLF Status

BLF Status shows the status of the BLF subscriptions

Editing a node

They need to be defined in the system along with the IP and a manager user to connect to the manager interface of asterisk.

The manager user and password are usually stored in /etc/asterisk/manager.conf on each PBX node. It is a good idea to restrict access to the manager interface to just the web server and the other PBX nodes.

Routing Profiles*

Routing profiles permit to define how outbound calls are managed and which provider has to be selected. They permit basic call alteration, like remove of digits or add of prefix. LCR can be enabled to allow the selection of the cheaper provider available.

Once created, you can manage the call profile using the “Manage” link on the right. It is easy to duplicate a Call profile using the “Duplicate” link.

The call profile needs to define for every node, based on the regular expression specified, what action to do. It can be possible to add some digits, like the international prefix or removed some digits, like the area code.

Following some usefull regular expression:

^ means start of number

^00.* matches any number starting with 00

^0[1-9].* matches any number starting with 0 but with the second digit other than zero

When a number is dialed, the list of routing profile matching is selected. They are ordered based on Order then for Priority. When multiple providers are selected with the same priority and order, the penalty is taken into account and the call is sent to the provider with the lower penalty adjusted (multiplied) with the weight. Once a call is processed, the penalty for the provider selected is increased.

LCR can be enabled for a destination. In this case the call is routed using the provider with the lower price for that destination.

Call routing are configured in the following screen.

Tenants

There is no limits on the number of tenant that can be defined.

When defining a tenant you need to provide the tenant code that will be used to create all username for the tenant. It is really important to choose a good tenant code. Please avoid using numbers or any characters different than normal alphabetic letters (mixing upper case and lower case is good). The reason for avoiding any number or character signs is due to some phone limitation to manage BLF and speed dial keys when associated with non numeric characters.

Parking lots numbers can be changed, but you need to restart the res_parking module. You can do it using the Admin/PBX Nodes, choosing the “Parking” icon. No calls are needed to be parked to restart the res_parking module.

The code is the string that will be used to identify each tenant user. It will be appended to each number to uniquely identify each user. It is highly advisable to use only alphabetic characters for the code, avoiding dashes, symbols or numbers.

Allow onnet calls from this tenant let you choose if allowing on net calls from this tenant. An on net call is a call going to a DID hosted on your system.

Allow onnet calls to this tenant let you choose the opposite, if allowing on net calls to this tenant.

Allow any Caller ID usage when dialing out allows or disallow usage of any callerid for outgoing calls. When not allowed, if the extension tries to use a Caller ID not belonging to the tenant, the first Caller ID is used.

Alert email is an email used to report any issue with the tenant.

Default timezone allows to have tenants in different time zones.

The routing profile is selected and allow to specify how the tenant will dial out and which providers (trunks) will be used.

The status allows you to disable a tenant, so it cannot place or receive calls.

Using the Recording Storage you can configure where the call recordings are stored. Take in mind the call recordings can became really big if the clients records all the calls.

You have several ways to store the call recordings:

Use Defaults stores the recording in the location configured in Admin/Settings

Database stored the recording in the database. Using this storage engine lets you configure and apply the retention period.

Filesystem stores the recordings in the local server filesystem. In the directory specified.

FTP stores the recordings in a remote FTP server, using the credentials provided and the directory specified

The billing code is just a label, it can be used to link the tenant with an external billing software.

Call rate is used to define which client rate to apply to the tenant calls.

Payment type specify if checking or not for the tenant balance before authorizing an outbound call. If the “Postpaid” mode is selected, no check is done and the client can make as much calls as he wants. In “Prepaid” mode, for every call the actual tenant balance is checked and the max duration of the call is reduced to allow the tenant to spend only the 50% of his remaining credit. This way the tenant, even with very little funds, can make multiple contemporary calls because each call will “book” only 50% of the remaining credit.

Max number of features allows to define how many Extensions, IVRs, Hunt List, etc. etc. the client is allowed to have. If the number is zero, then the menu entry will be hidden.

Tenants Conduits*

Each tenant is completely separate from each other, but it can be useful to be allowed to call from one tenant extension to another tenant extension directly. It can be in both ways or just one way. The classical example is the head quarter and the foreign office. The head quarter needs to call any extension in the foreign office, while the foreign office needs to use any of the public available DIDs. To achieve this configuration, a conduit is created on the head quarter tenant specifying a prefix and the destination tenant. Any extension on the destination tenant can be dialed by dialing the prefix followed by the extension number. The caller ID is adjusted as needed. If no conduit is present to allow the called extension to call back the caller, then the external caller ID is used.

Users*

There are two kind of users in the system, admin and not admin. A “not admin” user can manage only the list of tenants assigned and have access to only the “Configuration” and “Status” menu. A “not admin” user will be not be able to change or add new DIDS.

An “admin” user can see all tenants or just the tenants assigned to him. Please keep in mind an admin can always change the list of tenants assigned to him. If the “Admin sees all tenants” option is selected, then admin users can manage all the tenants regardless by the fact if they are assigned or not assigned.

Order of the tenants is not important.

User Profiles

New user profiles can be created, assigning different user privileges.

There are three kind of User Profiles:

“Reserved” user profiles can be managed only by users with a specific privilege, so for example a “Restricted Administrator” cannot create another restricted administrator or an “Admin” user.

“User Level” user profiles cannot be assigned to normal web interface users, but can be used only in the “Configuration/Extensions” to be assigned to the extension user.

Any other user profile can be used on normal users.

A normal user profile can be restricted to show only some menus.

A list of Privileges are available and some are “macro privileges”, used for the default User Profiles.

General Privileges

Access the web panel – Allow access to the Web Call Panel

Can add tenants – Can add new tenants

Can delete faxes – Can delete faxes

Can edit AGI Scripts – Can edit AGI Scripts

Can edit all tenants – Can edit all tenants, even the one not assigned to own user

Can edit conference's server – Can edit the server where the conference is taking place

Can edit DID numbers – Can edit the DID numbers

Can edit own extension – Can edit own extension's configuration

Can edit own tenants – Can edit own tenant

Can edit own voicemail – Can edit own voicemail

Can manage Balance – Can manage balance

Can manage reserved profile users – Can manage users with a reserved profile

Can send faxes – Can send faxes

Can Upgrade – Can upgrade the software

Can use all routing profiles – Can use all routing profiles

Can use own routing profiles – Can use only own routing profiles

Can view own status – Can view own status

Has web panel – Can use the web call panel

Macro Privileges

These privileges are used directly in conjunction with the default User Profiles. These privileges are changed over the time when new features are added.

Full power administration – This privilege needs to be assigned only to the admin user profile. An user with a profile containing this privileges has usually no limits. This is expanded in the following privileges:

Can Upgrade

Can Edit AGI Scripts

Can Manage Balance

Can Edit DID Numbers

Can Add Tenants

Can Edit All Tenants

Can Use All Routing Profiles

Can Manage Reserved Profile Users

Can Send Faxes

Can Delete Faxes

Can Edit Conference Server

This privilege can access the following menu entries:

All Configuration Menu

All Status Menu

All Admin Menu

Tenant administration – This privilege allows to completely manage a tenant configuration. It is meant to be assigned to a client for its own configuration. It has no specific privileges, but just menu access to:

All Configuration Menu

All Status Menu

Restricted administration – This privilege can be used for resellers. It allows to use the system quite as the administrator, but limited to the user and tenants created. It has the following privileges:

Can Edit AGI Scripts

Can Manage Balance

Can Edit DID Numbers

Can Add Tenants

Can Edit Own Tenants

Can Use Own Routing Profiles

This privilege can access the following menu entries:

All Configuration Menu

All Status Menu

All Admin Menu

DID List*

When a system runs a large number of tenants and hosts a large number of DIDs, can be usefull to have a complete list of all the DIDs configured in the system.

The list can be exported in CSV format.

Translations*

It is possible to provide your own translation to the MiRTA PBX. Just select your language and edit any sentence with your language equivalent.

Settings*

Using these settings, the system can be adjusted to suits any needs.

The Software version can be checked against the latest version released. Every night, at midnight, a script will contact a central host and pull all versions details available, alerting if any new version is available. Upgrades needs to be done on each node and the database will be upgraded only when an user log on. It is highly advisable to apply upgrade during off hours and report immediately any issue detected.

Dialing section permits to configure the codes used for dialing.

International prefix is the prefix used to place international calls. Usually 00 for European Countries and most of the other country in the world, it is 011 for the United States.

Trunk prefix is in use only in some countries.

Voice message language is the default language to use for prompts in the voicemail messages. Please enter the letters used for the asterisk sounds directory.

License key contains the license. The license is usually bound to the URL used to access the web interface and contains the max number of nodes authorized. Only the asterisk servers count as nodes.

The API Key is used for the proxyapi.php API interface.

Data Retention specifies the number of days to retain the call pcap and call graph and the Call history days. A batch job is run at midnight cleaning all the unwanted data.

Recordings allows to specify where to store recordings. If Filesystem is choosen, the records files will be stored in the specified folder.

Recording format allows to specify which codec to use for the recordings. PCM uncompressed is the one with better quality and needs around 1 MByte of space for every minute. GSM is highly compressed and needs just 100KByte of space for every minute of recording. An optional script recompressing every recording file to MP3 format is available but the resulting quality is really low.

Test it service allow to place a form on a web page to allow potential clients to place a call between two numbers. A trytestit.html page is available in the /pbx folder to show how to use the test it service. A limit on the call duration can be applied and a captcha can be requested to be solved to allow the call to be placed. For extra security, the IP of the web server hosting the application can be listed to restrict potential abuse of the service. It is strongly suggested to choose a tenant with a very restrictive Call Routing, so no premium rate calls can be made using the testit service.

The last part of the configuration allows to Show status of extension by placing a small flag beside each extension to show the state (green for registered, red for offline).

Single box DID will compact the DID to just a single box. It is highly discouraged to use this feature.

DID select forms allows you to specify which format for the DID will be made available in the Caller ID selection.

Ignore digits after # allows the usage of some phones automatically appending garbage at the end of each speed dial key.

Admins see all tenants allow the admin users to manage any tenant defined in the system.

Use advanced filters enable advanced filters in almost all data windows. Having advanced filters activated is needed to be albe to correclty select the statistical details.

Proxy API

An interface based on a REST API is available to perform a series of operations on the pbxes.

To be able to access the proxyapi.php script, a set of parameters needs to be used:

reqtype – identify the type of request

tenant – is the tenant code for the request performed

key – is the API Key to use for authentication. It can be the general API Key defined in the Admin/Settings or the tenant specific key defined in the Configuration/Settings

format – optional, can be json or plain and select the format for the response

All parameters can be passed using a GET or a POST method.

HELP

This is the simplest request type and return a basic help on every request type

For example:

https://demo.mirtapbx.com/mirtapbx/proxyapi.php?reqtype=HELP&tenant=DEVEL&key=uq9VMJK8CEJ78MZR

Will return:

Parameters:

reqtype - Request type

tenant - Sometime optional if the Admin API key is used, otherwise provide the tenant code

key - Use the Admin API key or the Tenant API key

format - Optional, can be json or plain

callback - Optional, for cross domain script, the function to use as callback (requires format json)

Request type (reqtype):

COUNTPEERS - Return the number of peers on each node and the total

- Additional parameters:

tenant - optional if using the Admin API key,

returns only peers from the selected tenant

PEERS - Show the peers registered on all nodes of the network

- Additional parameters:

tenant - optional if using the Admin API key,

returns only peers from the selected tenant

CHANNELS - Show the channels for the selected tenant

Additional parameters:

tenant - optional, show channels for the tenant

PHONEBOOK - Manage phone books:

Additional parameters:

tenant - select the tenant

phonebook - select the phone book by name

subreqtype - select the sub request type:

query - perform a query

field - name of the field

value - value to search for (use % for partial searches)

add - add a record

values - a json encoded associative array with name of the fields and values

delete - delete a record

peid - peid value returned by search

INFO - Get info about system

Additional parameters:

info - type of info:

queues (list of queues)

queue (info about the queue based on id)

agents (info about the agents in all queues)

outdialed (info about the calls dialed out by extensions)

call (info about the call originated with the api using the returned id or unique id)

recording (get the recording for the call, you can use the unique id or the originated id)

id - optional, id of object requested

DIAL - Dial a number and connect to another number

Additional parameters:

tenant - tenant where to place the call

source - first number to dial

dest - number to connect

var - variables to set, will be prefixed tenant code

account - account name to simulate the call from

dialtimeout - dial timeout in seconds

timeout - max duration for the call in seconds

sourceclid - use this clid for dialing source number

destclid - use this clid for dialing dest number

HANGUP - Hangup a channel

Additional parameters:

tenant - optional, tenant for the channel to hangup

channel - channel to hangup

TRANSFER - Transfer a channel

Additional parameters:

tenant - optional, tenant for the channel to transfer

channel - channel to transfer

extrachannel - extra channel to transfer (optional)

dest - number to transfer the channel to

In case of wrong API key, no message is returned on the screen, but the error is logged in the web server error log.

COUNTPEERS

Parameters: tenant (optional)

Return the number of peers on each node, plus the total of peers defined. If the tenant parameter is used (mandatory if the tenant key is used), only the number of peers belonging to the selected tenant are returned.

PEERS

Parameters: tenant (optional)

Returns the name of the peers on each node with additional informations. If the tenant parameter is used (mandatory if the tenant key is used), only mandatory if the tenant key is used), only the peers belonging to the selected tenant are returned.

DIAL

Parameters: tenant, source, dest

Two additional parameters are needed, source and dest. A call will be placed in the selected tenant (always mandatory), dialing source and once answered, dialing dest.

CHANNELS

Parameters: tenant (optional)

Returns the list of active channels on each node with additional informations. If the tenant parameter is used (mandatory if the tenant key is used), only the channels belonging to the selected tenant are returned.

HANGUP

Parameters: tenant (optional)

Ends a channel.

TRANSFER

Parameters: tenant (optional), channel, extrachannel (optional), dest

Transfer a channel to another extension. If the tenant parameter is used (mandatory if the tenant key is used), only a channel beloging to the tenant can be transferred. If the extrachannel is used, then both the channel and the extrachannel are transferred to the dest destination.

Database Integrations

MiRTA PBX database is quite stable and can be used to perform any direct integration with external provisioning or billing systems.

Billing

For integrating the billing in an external software, it is important to understand how the call cost is computed and stored in the system.

The main table to refer is asteriskcdrdb.cdr. This is the standard asterisk table with some columns added. In particular, altought the new Asterisk 12 assure now the uniqueness of the uniqueid+sequence columne, a real, database driven, unique column ID has been added and it will be used for computing costs.

Costs of completed calls are computed by a batch script every minute. When a prepaid profile is used, a temporary cost is inserted to prevent the client to run over its credit.

Every day the sum of all the costs of the calls are consolidated in a single record in the bi_billings table

Details for call costs are stored in the cc_callcosts table with the following structure:

cc_id	– ID of the call cost, used as link in the asteriskcdrdb.cdr table with the column cdr_cc_id

cc_te_id	– Tenant ID

cc_uniqueid	– Uniqueid of the call. Be warned that is not a unique id as one can easily think, but it is a unique identification for the call, but a call in asterisk can have several legs and so multiple records with the same uniqueid can be present in the cdr

cc_cdr_id	– Link with the column ID in the asteriskcdrdb.cdr table

cc_cost	– Call cost

cc_bi_id	– Link with the column bi_id in the bi_billings table

Consolidated billings can be found in the bi_billings table with the following structure:

bi_id	– ID of the call cost, used as link in the cc_callcosts table with the column cc_bi_id

bi_te_id	– Tenant ID

bi_description – A description of the cost or the credit loaded on the customer account

bi_date	– Date of the billing

bi_amount	– Credit or Debit for the client

SIP TAPI integration

SIP TAPI integration is made using the freely available SIPTAPI application: http://sourceforge.net/projects/siptapi/

*** IMPORTANT ***

The SIP TAPI integration is made by dialing your own extension and then connecting to the destination. It is important the “Recover VM messages dialing your own same number” is set to No.

The following example has been made using version 0.2.13.

Download and uncompress the zip package

On 32bit Windows

=================

1. Copy siptapi.tsp from 32bit folder into your Windows system32 directory (usually C:\Windows\System32)

2. Install and configure SIPTAPI using the telephony options from control panel

On 64bit Windows

=================

1. Copy siptapi.tsp from 64bit folder into your Windows system32 directory (usually C:\Windows\System32). This gives you full TAPI support with 64 and 32bit TAPI applications

2. If you want to configure SIPTAPI not only from the telephony control panel and from 64bit applications, but also from 32bit applications, copy the 32bit siptapi.tsp from 32bit folder into your WoW64 directory (usually C:\Windows\SysWow64)

3. Install and configure SIPTAPI using the telephony options from control panel

Open Control Panel and click on the Phone and Modem Option

In the Advanced tab add a new Provider

Select “SIP TAPI Service Provider...” and press Add.

Configure it by entering the PBX host address, the extension and the password

Open you TAPI compatible application, like Outlook and dial any contact. You need to configure the application to dial using the SIPTAPI.

Provisioning Phone Examples

Grandstream GXP2130

This is an executive phone compatible with the predefined “Grandstream GXP” template.

Log into the phone interface

Locate the Upgrade and Provisioning menu

Configure as shown below

In detail, select Upgrade via “HTTPS”, clean Firmware Server Path if not used, enter the Config Server Path as shown on the Configuration/Provisioning/Phones page, in this example:

demo.mirtapbx.com/mirtapbx/autoprovision/RuLPYWuESutnFCtc/

Do not enter the protocol!

Set the DHCP options to No if not used, save and apply. Reboot your phone.

SNOM 710

Locate the Advanced Settings and choose the “Update” tab. Enter the server url ending with {mac}.xml like https://demo.mirtapbx.com/mirtapbx/autoprovision/uhn73YrfXp2Jmf9U/{mac}.xml

Cisco SPA504G

This phone has several layer of configuration, so the first step will be to reach the correct one. Once logged in, click on the “Admin login” and then on “Advanced” on the top right corner.

You can now configure the provisioning, by enabling it and entering the provisioning URL. The phone can request automatically its MAC address if the $MAC.xml variable is set in the provisioning URL, like:

https://demo.mirtapbx.com/mirtapbx/autoprovision/twNX3K4HrYqcNjbZ/$MA.xml

Unfortunately Cisco decided to not allow the usage of third party CA and request you to use their CA for your SSL service. If you can't, you are forced to provision over HTTP.

Yealink T28P

Starting with firmware version 72, Yealink changed the provisioning configuration format, so you need first to check your version and pickup the right template.

Provisioning Yealink is easy, you need to enter the URL in the Provisioning page as follows:

To have the phone automatically insert the phone MAC address, you need to enter the special variable $mac like:

https://demo.mirtapbx.com/mirtapbx/autoprovision/24cWZKq2wppjEqmV/$mac.cfg

It is possible your phone will refuse to provision due to a not recognized SSL certificate. In this case you can upload your own CA or just force the phone to accept any certificate by disabling the option “Only Accept Trusted Certificates”

FAQ

Linux System

When a conference is going to start, I get the message:

app_meetme.c:1296 build_conf: Unable to open DAHDI pseudo device

It seems the dahdi kernel module is not started or not compiled/available for your running kernel. It is possible you have upgraded your kernel and restarted your system. Try restarting the dahdi by using the command:

/etc/init.d/dahdi restart

If it doesn't fix the issue, try recompiling dahdi module, going in /usr/local/src/dahdi-linux-complete-* and running:

make

make install

/etc/init.d/dahdi restart

How can verify if my server SSL certificate is set correctly?

I found really useful to use https://www.sslshopper.com/ssl-checker.html

Can I rotate asterisk logs?

By default, asterisk logs are rotate at midnight, but old logs are not deleted. Not only, but they are rotate in the old asterisk way and not like most Linux sysadmin are expecting. In the standard install, the newest logs have the highest number. If you'd like to have the standard Linux way, you can change the logging in /etc/asterisk/logger.conf by setting the following parameters:

rotatestrategy = rotate

exec_after_rotate=gzip -9 ${filename}.2

This way the last two logs will be also compressed.

Don't forget to reload the logger module:

asterisk -rx 'logger reload

If you'd like to delete the older logs, you can add to crontab:

find /var/log/asterisk/full -type f -mtime +10 -exec rm {} \;

The web interface session is expiring too often, I need always to reauthenticate, how can I make it run longer?

You should change the session timeout value in php.ini and then restart the web server process, by default is 2880 seconds, set as long as you like

session.gc_maxlifetime = 2880

How can I setup a longer session duration?

Please edit /etc/php.ini, locate session.gc_maxlifetime and set to the number of second of your choice. restart httpd after that.

How can I upgrade to PHP 5.5 to use AWS S3 Storage?

System is usually shipped with the standard PHP version, but that is not suitable for AWS S3 because it requires PHP 5.5. On CentOS 6 64bit You can upgrade with the following steps:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

yum -y install yum-plugin-replace

yum replace php-common --replace-with=php55w-common

yum install php55w-opcache

rpm --import https://mirror.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy

service httpd restart

Extensions

Can I use an extension to connect a remote PBX to the system?

Yes, but you need to enable the “trunk” feature for the extension or otherwise the Caller ID of the call coming from the remote PBX will be overwritten.

When I use server side attended or unattended transfer (#* and ##), there is no enough time to dial the destination extension!

The default timeout is set to 3 seconds, but the “transfer” message is played inside this time, so it may seem shorter. You can increase the timeout of the transfer by editing the /etc/asterisk/features.conf and changing the value for transferdigittimeout to the amount of seconds you like. Once done, reload the module from within asterisk with “module reload features”

When I try to recover the Voicemail, it says the PIN is invalid

Most of the time, there is a problem with DTMF, check the log for the call in /var/log/asterisk/full if you see this message:

dsp.c: Inband DTMF is not supported on codec g729. Use RFC2833

In this case, change the DTMF setting on the PBX from “auto” to RFC2833 and if possible, also on the phone

Voiocemails

A caller leaves a voicemail for an extension, but that voicemail is not appearing

The voicemail box can be locked, please check if in there a .lock file in the INBOX folder, like in this example:

#find /var/spool/asterisk/voicemail/pulmonarycriticl/100/

/var/spool/asterisk/voicemail/pulmonarycriticl/100/

/var/spool/asterisk/voicemail/pulmonarycriticl/100/Cust2

/var/spool/asterisk/voicemail/pulmonarycriticl/100/Urgent

/var/spool/asterisk/voicemail/pulmonarycriticl/100/INBOX

/var/spool/asterisk/voicemail/pulmonarycriticl/100/INBOX/.lock

/var/spool/asterisk/voicemail/pulmonarycriticl/100/Work

/var/spool/asterisk/voicemail/pulmonarycriticl/100/Cust3

/var/spool/asterisk/voicemail/pulmonarycriticl/100/Old

/var/spool/asterisk/voicemail/pulmonarycriticl/100/tmp

/var/spool/asterisk/voicemail/pulmonarycriticl/100/tmp/Av5Vqa.wav

/var/spool/asterisk/voicemail/pulmonarycriticl/100/tmp/Av5Vqa

Just remove it.

About the source of the lock… maybe your asterisk server has crashed in the middle of a voicemail message.

Miscellaneous

My clients are getting ghost calls from weird numbers not logged in MiRTA PBX

Those ghost calls are attempts made by “hackers” to place rogue calls, usually to premium rate numbers. They start by analyzing large part of Internet trying to connect to port 5060, the standard port used by PBX and phones. If they detect an answer, they try placing some calls using different formats. If one of these calls has success, then they start to send hundred of calls to premium rate numbers. They get some money rewards by phone companies. To avoid this issue, you can place the phone behind a firewall or NAT router, allowing only the PBX to connect or you can configure the phone to accept calls only from registered reserver. This option has several names depending by the phone brand.

When a call has no callerid, is received as “asterisk”. How can I change it?

You can change setting the “callerid” parameter in the sip.conf and then reload sip from asterisk. Remember it will disconnect all clients connected.

Phones

How can I avoid to receive a new call while I am already in a conversation?

You can receive another call while on line because the feature “Call Waiting” is active on your phone. Turn it off and the second call will get a BUSY signal. Disabling on the phone depends by the phone model, for example on Yealink it is here:

How can I allow a SNOM phone to auto answer on paging?

SNOM has a security setting to prevent auto answer, so it has to be enabled to make it to work. On version V8 you need to go to Advanced / Behaviour (tab) / Phone Behaviour / Intercom policy

Provisioning

My phone refuse to provision, but when I download the configuration, it seems perfect

If you are trying to provision over https, then check if the SSL certificate is valid. Phones require a valid certificate for provisioning. Verify the date and time on the phone because the certificate has a start and end date of validity. As last chance, try provisioning with http, but just to verify if the problem is in the certificate (some phones are really picky about certificates), then change the key and the extension password.

Setup Guides

How to setup outbound dialing?

It is supposed you have configured the tenant, several extensions and tested dialing from one extension to the other, but now you want to dial out using the setting your SIP provider has sent to you.

To setup outbound dialing you need to follow three main steps:

1) Configure a Provider using Admin/Providers

Please remember you can configure the SIP part using the realtime engine, but if your provider needs your server to “register”, you need to modify by hand the sip.conf and enter the “register =>” command and then reload the sip part (all registrations from peers will be cleared)

2) Configure the Routing Profiles using Admin/Routing Profiles

3) Assign the Routing Profile to the tenant using Admin/Tenants

If you can't dial out, please check the Call History, some info about the reason your dialing was unsuccesful will be displayed.

How can I setup and use the Emergency Caller ID?

To be able to use Emergency Caller ID, you need to follows the following steps:

Create a routing rule using Admin/Routing Profiles for all the “emergency numbers” you like to use with the Emergency Caller ID. So for example you need to create specific rule for 112, 113, 911, 999 or whichever number is used in your country. It can be good to add also a normal number to check if the Emergency Caller ID usage has been configured correctly.

Please don't forget if multiple routing rules matches your dialed digits, they are evaluated by Order and Priority. It can be a good idea to assign common rules to order 2 and emergency routing rules to order 1.

To match only and exactly 911 for example, you need to use the ^911$ regex.

Assign the “Emergency Route” flag to the extension. It will be shown as a little medical kit icon on the routing rules page.

Select the DIDs you want to use as Emergency Caller ID using the Configuration/DIDs page. Before to be able to use a DID as “Emergency Caller ID”, the flag “Use as Emergency CallerID”. A box will be automatically shown to let you insert a note about the location of this DID. The “Emergency Enabled DID” will be marked in the DIDs list with a little medical kit icon.

Assign the specified Emergency Caller ID to the extensions using the Configuration/Extensions page. Locate the”Outbound Calls” section and assign the desired DID to be used as Emergency Caller ID when an emergency route is used.

How can I build a more user friendly feature code?

Some clients find the feature codes too rough and they prefer to have some more user friendly even if more slower to use. Normally, a feature code asks nothing, but accept all the parameters on the dialing itself, like for example *72[NUM] can be configured to set unconditional destination for a DID to the NUM dialed. However, feature codes and custom destination are the building blocks you can use to create something more complex and maybe user friendly. Let's see some example.

Ask and set unconditional destination for a DID

Our client likes to dial a feature code, like *72 and be prompted with a message asking to enter a number. That number will be set as unconditional destination for a DID. These the steps:

Create a recording asking for the number to use for forwarding your DID and load in the Media File sections.

You can create also a recording to confirm the configuration.

Create a custom destination to read a number entered by the user and use the above recording as prompt.

Create the “raw” feature code setting the unconditional forward for the number and playing the confirmation message.

Create a custom destination to use the above feature code with the variable entered.

Create a feature code asking for the number and using that number to execute the above feature code.

Ask and dial with custom callerid

Caller ID spoofing can be really comfortable when doing some kind of dialing, so we are going to create a feature code asking for the caller ID, then asking for the number to dial and then dialing that number using that caller ID.

First we are going to upload two media files, one asking for the Caller ID and the other asking for the number to dial.

We start by creating a Custom Destination “Read a variable” for capturing the caller ID as shown below:

And another one for the number to dial:

Then we are going to create two more Custom Destinations, to set the Caller ID and to dial a number:

Now we can arrange all together in a feature code:

Condition override

Some time can be useful to have a condition for Open/Close hours of the office, but a button on your BLF keyboard to override the condition, closing it during Open hours (maybe because you are going to have an extra coffee) or opening during Close hours.

Let's start by creating your time condition in the usual way:

Destination will be your normal destination for Open/Close hours:

In your DID, you have assigned the Condition in the usual way:

Now we are going to create a BLF key to override this condition.

We need to create the BLF number, using a Flow. Just assign for example the number 150 to the key, so this client will monitor 150.

It can be useful to start creating the custom destination to toggle the BLF state:

And use it in the Flow definition:

Remember to set the initial state, just assign NOT IN USE (green light) to normal condition and IN USE (red light) to condition override.

Now we need a condition to test for the BLF state and invert/override the condition.

Assembling all in the DID destination, we get:

Dial a number with different Caller ID

Some time an office can have an extension serving more companies, so when dialing out for company “Kartoon Cars” a different Caller ID needs to be used than when dialing out for company “Sleep Flex”. To accomplish this, we use two feature codes with two custom destinations. The idea is to dial *11 plus the number to dial out when you want to use the first Caller ID and *22 plus the number to dial out when you want to use the second Caller ID.

Let's start by configuring two custom destinations as following:

And in a similar way, but for the other Caller ID number.

Once configured, you need to create a feature code using each one of the custom destination created.

Using custom voicemail templates

On some old install, done before the custom voicemail templates feature was developed, it can be needed to configure the voicemail setting to use the custom voicemail templates.

You need to edit the voicemail.conf file and configure the following entries (two lines):

emailbody=VM_NAME:${VM_NAME}\nVM_DUR:${VM_DUR}\nVM_MSGNUM:${VM_MSGNUM}\nVM_MAILBOX:${VM_MAILBOX}\nVM_CALLERID:${VM_CALLERID}\nVM_CIDNUM:${VM_CIDNUM}\nVM_CIDNAME:${VM_CIDNAME}\nVM_DATE:${VM_DATE}\nVM_CONTEXT:${VM_C ONTEXT}\n

mailcmd=/var/lib/asterisk/agi-bin/processvoicemail.php

Once configured, run “asterisk -rx 'voicemail reload' to update the running configuration.

The variables available are:

${VM_NAME} – Name

${VM_DUR} – Duration

${VM_MSGNUM} – Message number

${VM_MAILBOX} – Mailbox

${VM_CALLERID} – CallerID

${VM_CIDNUM} – CallerID Number

${VM_CIDNAME} – CallerID Name

${VM_DATE} – Date

${VM_CONTEXT} – Context (almost useless)

How can I display the Caller ID name from my phone book?

You need to load the numbers and the Caller ID names in a phone book (you can have multiple phone books for a single tenant) and then in the DIDs destination, pickup the “Set Caller ID Name by Phone Book …"

How can I forward my calls to a mobile phone after 30 seconds?

If you want any call to your extension to be forwarded to your mobile phone after 30 seconds, you need to start configuring the inbound dial timeout for your extension to 30 seconds.

Then you have two ways to make the call being forwarded to your mobile phone number:

Using the FMFM configuration: using a feature code or the web interface, enter your mobile phone number in the Find me/Follow me Configuration and activate it.

You can activate/deactivate the FMFM using a feature code

Using a Custom Destination and use it in the Additional Destination: you need to define a Custom Destination (type Forward to) and enter the mobile phone number and the dial timeout. You can also configure which CallerID will be used for the outgoing call.

Once the Custom Destination has been created, it can be used in the Additional Destinations for “No Answer” for your extension. Don't forget to enable it. You can enable/disable it using a feature code.

How can I configure a BLF key for picking the call when it rings?

The configuration depends from phone to phone, but the first thing to create is a feature code for picking up a random phone ringing. In this example, I have defined *56[EXT] as pickup:

Now, let's see how to configure usage for this feature code in the BLF for Yealink:

Appendix

Setting Asterisk to use TLS

Asterisk can use TLS as transport for the signalling, increasing the authentication security and providing extra privacy about the number dialed and other info usually transmitted in clear over the SIP channel. TLS will encrypt only the signalling part, without offering any extra security to the RTP (voice) part.

In the [general] section of sip.conf, add the following info, replacing the IP address with the IP address of the server. Provide the certificate and key in pem format.

tlsenable=yes

tlsbindaddr=213.133.102.85

tlscertfile=/etc/asterisk/certificates/demo.mirtapbx.com.pem

tlsdontverifyserver=no

tlscipher=DES-CBC3-SHA

tlsclientmethod=tlsv1

transport=udp,tls

Changing Server IP

If for some reason you need to change the server IP address, you need to change it in several places:

/etc/odbc.ini – contains the IP for the database server

/etc/asterisk/sip.conf – contains the server itself definition used to allow the server to call itself. If you are running your server behind a NAT, it can be needed to change also the externip parameter. Once changed, you need to reload SIP (asterisk -rx 'sip reload'). Please note all extensions will be deregistered.

/etc/asterisk/manager.conf – allows the web interface to access the manager interface. Once changed, you need to reload the manager interface (asterisk -rx 'manager reload')

/etc/hosts – it is important to have the server host to resolv correctly to the new IP. Please don't use 127.0.0.1 as server IP

/var/lib/asterisk/agi-bin/devstate.conf.php – lists the servers available in the pool to distribute the extension state. Status exchange is done over port 19771 using UDP protocol. Once the new IP has been inserted, you need to kill devstatesender.php and devstatereceiver.php processes, these will be automatically restarted.

If you have changed the IP for the database server, you need to change it in /etc/odbc.ini, /var/www/html/pbx/include/db.inc.php, /var/lib/asterisk/agi-bin/include/db.inc.php.

Finally, you need to change the server IP defined in the web interface, using Admin/PBX Nodes. It can be a good idea to update the Always Allowed IP in the Admin/Security/GeoIP Fail2ban.

It can be possible you need to request a new license for the server due to the change in IP. Please remember asterisk will still works and call will be processed normally even with an expired or not valid license.

Changing Server Name

The server name is what is returned from “uname -n” and it is used by asterisk to know on which server it is running. If you need to change the server name of an host, after having changed at OS level, so “uname -n” return the new name, you need to change in Admin/PBX Nodes. It is possible loading the page takes a lots of time due to the system not able to connect to the right server, just wait until the page is loaded. When you change the peername, there is a change in table names too. If you are using sipregs table, you may need to change the referenced tables in /etc/asterisk/extconfig.conf and reload.

Using Parking Lots

Parking lots are a convenient way to put on hold or transfer calls from one extension to another one. They can be monitored using a BLF key.

Parking lots are defined as a range of extensions, by default from 700 to 720, reserved for transferring, holding and later retrieving of calls.

Due to a limitation in asterisk configuration, once parking lots are created, they cannot be changed without a module restart. You can restart the module using the “parking” icon in Admin/PBX Nodes. Due to this limitation, the definition of parking lots is reserved to admins when the tenant is defined. The tenant admin can define how long a call is held in a parking lot before returning to the parking extension, using the Configuration/Setting menu.

A call can be parked in several ways:

- by transfering the call to one of the parking lot extension, like it was an extension. If the transfer will be “blind”, parking lot number will not be played (but you know it because you dialed it).

- by using a feature code to “Park the call”, in this way the parking lot number will be played to the caller, if you blind transfer to the feature code, the parking lot number will not be played. You need to find another way to get the list of the parking lot where the call got parked.

- by using a feature code to “Park the call to [NUM]” and dialing the feature code along with the parking lot number, in this way the parking lot number will be played to the caller, if you blind transfer to the feature code, the parking lot number will not be played (but you know it because you dialed it).

A call can be retrieved by a parking lot by dialing the parking lot number

The list of parked calls can be retrieved using the feature code “Say the parked call extensions”

A parking lot can be monitored using BLF by using the parking lot number followed by “-” and the tenant code, like for monitoring parking lot 800 in the DEVEL tenant, use a BLF for 800-DEVEL.

When you park a call in a parking lot, by blind or attended transfer, the callerid of the call is saved in the parking lot. When the parking lot timeout, the parking phone will receive a call using that callerid. Not only, when retrieving a call from a parking lot, the phone can display the callerid of the parked call. To be able to see the callerid of the parked call, a small change is needed on the definition of the extension, enabling the “Trust RPID” setting and most important, allowing the processing of RPID info in the phone. For Yealink for example, it is needed to set the “Caller ID Source” to RPID-PAI-FROM.

Regular Expressions

Regular expressions are a powerful method of defining number ranges. They are used in several part of the system. Here some examples:

Regexp	Description	Matches	Not Matches
^05545$	Set start and end of string	05545	055453131 5545
^05545	Matches anything starting with 05545	0554531 0554566	5545 055
05545$	Matches anything ending with 05545	998705545	055453
^055.*	Matches anything starting with 055	05545	99055
^0558*99	Matches anything starting with 055 and with zero or more 8	055899 05588899 05599
^0557+	Matches anything starting with 055 and with one or more 7	05577 0557	055
^0558?987	Matches one or zero 8 inside the number	0558987 055987	0558999
^(05545|05546)99	Matches either sequences	0554599 0554699	0554799
^055(45)*99	Matches zero or more instances of the sequences	055454599 0554599 05599	05544599
^0559{3}8	Matches a sequence of three 9	0559998	05599
^0559{2,3}8	Matches from two to three sequence of 9	055998 0559998	05599998
^055[1-9]	Matches any digits from 1 to 9	0551234	0550345

Clustering and High Availability

Several MiRTA PBX are able to work in cooperative mode, building a cluster of servers, providing superior performance and high availability. MiRTA PBX cannot be used for load balancing without any external tool, but can be used for a load sharing cluster. The best way to setup the system is by using DNS SRV. DNS SRV is often referred as a way to provision high availabilty. It is a special DNS record listing all the servers providing a service. For each service offered a “priority” and “weight” are defined, so the load can be shared among several servers. A typical DNS SRV record has the following format (from Wikipedia)

_sip._udp.example.com 86400 IN SRV 10 60 5060 bigbox.example.com.

_sip._udp.example.com 86400 IN SRV 10 20 5060 smallbox1.example.com.

_sip._udp.example.com 86400 IN SRV 10 10 5060 smallbox2.example.com.

_sip._udp.example.com 86400 IN SRV 10 10 5066 smallbox2.example.com.

_sip._udp.example.com 86400 IN SRV 20 0 5060 backupbox.example.com.

The first four records share a priority of 10, so the weight field's value will be used by clients to determine which server (host and port combination) to contact. The sum of all four values is 100, so bigbox.example.com will be used 60% of the time. The two hosts smallbox1 and smallbox2 will be used for 20% of requests each, with half of the requests that are sent to smallbox2 (i.e. 10% of the total requests) going to port 5060 and the remaining half to port 5066. If bigbox is unavailable, these two remaining machines will share the load equally, since they will each be selected 50% of the time.

If all four servers with priority 10 are unavailable, the record with the next lowest priority value will be chosen, which is backupbox.example.com. This might be a machine in another physical location, presumably not vulnerable to anything that would cause the first four hosts to become unavailable.

The load balancing provided by SRV records is inherently limited, since the information is essentially static. Current load of servers is not taken into account.

The most common setup for MiRTA PBX comprises two servers acting each one as asterisk, web and database server. A possible DNS SRV record for this setup can be the following:

sip.udp.pbx.domain.com 86400 IN SRV 10 10 5060 voip1.domain.com.

sip.udp.pbx.domain.com 86400 IN SRV 20 10 5060 voip2.domain.com.

In this way all the phone will register on voip1.domain.com and in case of any problem, the phone will move on voip2.domain.com. If a phone is registered on voip2 and a call arrives from voip1, the system will route the call accordingly and the client will not notice any difference. A tenant can have half the phones on a server and half on another server without noticing any difference. Even if this configuration is possible, it is not really advisable due to the additional load due to the routing of the calls between the servers. It can be good to work towards having all the phones for a tenant on the same server.

A more advanced setup will consist in creating two pools of servers as following:

sip.udp.pbxA.domain.com 86400 IN SRV 10 10 5060 voip1.domain.com.

sip.udp.pbxA.domain.com 86400 IN SRV 20 10 5060 voip2.domain.com.

sip.udp.pbxB.domain.com 86400 IN SRV 20 10 5060 voip1.domain.com.

sip.udp.pbxB.domain.com 86400 IN SRV 10 10 5060 voip2.domain.com.

The first pool, pbxA.domain.com will list voip1.domain.com as primary server and voip2.domain.com as secondary server. The second pool will list voip2.domain.com as primary and voip1.domain.com as secondary. All the phones using pbxA as DNS SRV address will normally connect to voip1. It is perfectly normal to find around 10% of the phones connected to the secondary server due to normal packet loss. All the phones using pbxB as DNS SRV address will use voip2.domin.com as primary. Carefully choosing which pool configure on tenant's phones, the load of the system can be effectively shared among multiple servers while providing resilience.

Installing and configuring MiRTA PBX

Installing MiRTA PBX is not an easy job, but some of you can decide to practice on the MiRTA PBX maintenance it by doing all the installation from scratch.

The following instructions are not a step by step guide, they assume a good knowledge of Linux, Asterisk and Mysql.

Access http://demo.mirtapbx.com/mirtapbx_support and download the installMirtaPBX.sh files in /usr/local/src:

If you are running CentOS 6 64 bit, start by upgrading the kernel on your server by running

./installMirtaPBX.sh Kernel

Unfortunately the version 3 kernel repository seems no more available, so for now, just stick with the 2.x kernel supplied by CentOS.

Once upgraded, disable SELinux by editing /etc/selinux/config

Reboot with the new kernel.

Continue the installation by running the install script without parameters:

./installMirtaPBX.sh

Edit /etc/asterisk/manager.conf and allow the local server IP to connect as manager user.

Edit /etc/asterisk/sip.conf and replace srv01 with your own server name as shown with "uname -n", so if can connect to itself.

Copy /var/www/html/pbx/include/db.inc.php.sample to /var/www/html/pbx/include/db.inc.php

Edit it and add

$mtpbxname='****';

$mtpbxkey='*******';

Using the mtpbxname and key I will provide you.

Comment out the row

$dbconn->SetCharSet('utf8');

if you are not using UTF8 database.

Copy the /var/lib/asterisk/agi-bin/include/db.inc.php.sample in /var/lib/asterisk/agi-bin/include/db.inc.php

Copy the /var/lib/asterisk/agi-bin/devstate.conf.php.sample in /var/lib/asterisk/agi-bin/devstate.conf.php

Edit it by putting the manager password located in /etc/asterisk/manager.conf and the IP of the server in the array $server

Move to /var/www/html/pbx and run

php dodbupgrade.php

A series of warning will be listed, ignore them.

Run:

php checkupgrade.php

and contact me to verify the server has registered correctly with the license server.

It can be a good idea to change /etc/php.ini date.timezone to match your timezone.

Restart the server

Log into the web interface using admin/nabucco347

You'll be moved automatically to the Admin/Settings page. Fill the data regarding the Internaltional Prefix and Trunk prefix, the license I'll provide you, Voipmonitor media DB Data retention (I suggest 1 day) and other retention period as you prefer. In the Advanced Customization I suggest to select the “Show status of extension”, at list a way to show DIDs in DID select and the “Admin see all tenants”.

Change the admin password

Edit the Admin/PBX Nodes and add a node with the server name as shown in "uname -n", ip address and manager user and password as above.

When accessing the Admin/PBX Nodes, you should see at least 1 peer connected (the server itself).

Upgrade to the latest version.

Mirta PBX URL Significance

Upon install the software prepares the portal URL at (hostname)/pbx, in a stand-alone Apache web server this would be /var/www/html/pbx.

Future software upgrades and cron jobs are dependent on this location path, as well as other real-time functionality.

Therefore, changing the URL structure in any way is highly unrecommended, and should only be attempted with coordinated Mirta support.