Integration and Turn-up

This is where we talk about the installation of the muPBX into the existing network, install the phones, and any additional equipment. Then we talk about turn-up to the VoIP service provider.

Calling Rules - The Asterisk Dial Plan

X - matches any digit from 0-9
Z - matches any digit from 1-9
N - matches any digit from 2-9
[1237-9] - matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
. - wildcard, matches one or more characters
! - wildcard, matches zero or more characters immediately (only Asterisk 1.2 and later, see note) 

_NXXXXXX - matches a NANP 7 digit telephone number such as 555-1212
_1NXXNXXXXXX - matches an area code and phone number preceeded by a one such as    1-860-555-1212
_9011. - matches any string of at least five characters that starts with 9011, but it does not match 
the our-character string 9011 itself.
_9011! - matches 9011 too
_# - matches a single # keypress 

_X! - matches any numeric pattern of one or more digits (but not * or #)
_[*#0-9]! - same as previous entry but also includes * and # characters
_[*0-9]! - same as the previous entry except excludes the # character

s - if there is no pattern at all, then using s will often match 
The s pattern can be useful for incoming calls where no DID is available and in certain other situations 
where the extension matches nothing.

If editing the /etc/asterisk/extensions.conf file: An extension name is a pattern if it starts with the 
underscore symbol (_).

ATA Fax - GrandStream HT502

The GrandStream HT502 was the easiest to set up and the most reliable for IP faxing. With that being said, it is recommended that you use a standard PSTN CAS line from your Local Access Service Provider. Fax over IP is somewhat unreliable and susceptible to network issues that are beyond your control. T.38 is supposed to fix this but not too many people have it in place and it hasn't been tested with the muPBX. If you must use fax over IP with the muPBX, I suggest this method.

1. Use the HT502UserManual.pdf for administrative access.
a) Use the procedure "Configure the HT502 Via Web Browser". This seemed the simplest.
b) Make sure to connect to the LAN port and not the WAN port. GS has the WAN disabled by default.
c) Connect the Ethernet to the HT502 before following the GS procedure.
d) The HT502 default password is "admin".

2. Change the IP address and enable the admin access on the WAN port. See HT502_Basic Settings as a reference.
a) Set the Static IP address, subnet mask, and default router for your network.
b) Set the Time Zone
c) Set the WAN side HTTP/Telnet access to "yes".
d) Click on "Update" then reboot.

3. Using a web browser, log into the HT502. For example: (external link)

4. Set the Advanced Settings. Use HT502_Advance Settings as an example.
a) Set Firmware Uprade and Provisioning to "TFTP".
b) Set the Firmware Server Path: ""
c) Click on "Update" then reboot.

5. Set the FXS Port 1. Use HT502_Advance Settings as for an example.
a) Set the Primary Sip Server to the muPBX.
b) Set the Outbound Proxy to the muPBX.
c) Set the SIP User Id, Authenticate Id and Password to the same value.
d) Set the Name.
e) Set the "DTMF in Audio" to "no"
f) Set the "DTMF in RFC2833" to "yes".
g) Set the "Send Hook Flash Event" to "yes".
h) Disable Call Waiting, Caller Id, Call Waiting Tone, and Visual MWI.
i) Click on "Update" then reboot.

6. Using the muPBX GUI provision the ATA1 user. Use ATA1 User Settings as for an example.
a) Set the Extension and Password the same.
b) Set DTMF mode to rfc2833.
c) Disable all extension options except for SIP.

7. Map the incoming faxes to the ATA1 port. GUI->Incoming Calls->Add an Incoming Rule:
a)Route = incoming calls that match
b)Pattern = XXXX of called number.
c)From Provider = Service Provider (provisioned in GUI->Service Provider)
d)to extension = User Extension (provisioned in GUI->Users)

FXS Fax - Not Recommended.

NOTE - I am not sure what was causing the fax testing issues using the FXS port. It could still be a configuration issue, a timing issue with the PC, echo, jitter, etc., etc.. I spent almost a whole day trying different configurations and searching the internet for solutions. As much as I would like to support Digium (since they are the folks that offer the free Asterisk IP PBX software) I would not recommend using the Digium FXS for faxing. Therefore, these instructions are not very detailed.

1. Assemble the daughter cards onto the TDM400p. Make a note of which slot / port each daughter card is mapped to. I would suggest marking the FXS port and number with an ink pen on the outside of the card for easy reference when assembled.
2. Install into PC and type lspci (list PCI) to see if "Communication controller: Tiger Jet Network Inc. Tiger3XX Modem/ISDN interface" is listed.
3. The Zaptel software should already be loaded onto the muPBX.
4. Execute /usr/sbin/genzaptelconf to generate the /etc/zaptel.conf file.
# Autogenerated by /usr/sbin/genzaptelconf -- do not hand edit
# Zaptel Configuration File
# This file is parsed by the Zaptel Configurator, ztcfg

# It must be in the module loading order

# Span 1: WCTDM/0 "Wildcard TDM400P REV I Board 1" (MASTER)

# Global data

loadzone        = us
defaultzone     = us

5. Manually configure /etc/asterisk/zapata.conf. Below is the configuration I used. These setting produced the best fax completion rate; even though it was only 50%.


rxgain=-5.7    ; Need this for incoming FAXes
channel => 3

;channel => 1

6. NOTE - The /usr/sbin/genzaptelconf script also creates /etc/asterisk/zapata-channels.conf. I think this file is supposed to be a default zapata.conf file. I noticed it had a couple of errors/assumptions so I did not include it in my zapata.conf file. If you want to include it in zapata.conf, I think the command is "#include /etc/asterisk/zapata-channels.conf".
7. Restart Asterisk so it reloads the new config files.
root@muPBX1 asterisk# asterisk -r
muPBX1*CLI restart now

8. Using the muPBX GUI, verify the analog ports are visible. GUI->Setup Hardware: Verify the Analog Hardware lists the FXS port(s). There is also a Linux command ztcfg -vvvv that will display info, too.

9. Using the muPBX GUI, provision the FXS user. Make sure to specify "Analog Port #X" in the Analog Port field, to allow G.711 codec in the "Edit Codecs" field and the DTMF mode is set to "rfc2833".

10. Map the incoming faxes to the FXS port. GUI->Incoming Calls->Add an Incoming Rule:
a)Route = incoming calls that match
b)Pattern = XXXX of called number.
c)From Provider = Service Provider (provisioned in GUI->Service Provider)
d)to extension = User Extension (provisioned in GUI->Users)

Misc. Notes:

/sbin/ztmonitor 1 -vv..........Measures real-time db level
/sbin/ztcfg -vvvv

Menu [toggle]