Australia Asterisk Details

Using Asterisk in Australia

This guide offers some suggestions for getting Asterisk to work properly in Australia.

Compiling Asterisk

If you want Caller ID to work with POTS (analog) exchange lines under Asterisk < 1.2 you will need to make a small modification to the source.

Open up chan_zap.c, and find the line:

Change this line to read

and save the file. Now build asterisk as usual.

Note that for Asterisk >= 1.2 you will instead merely need to add the line:

to zapata.conf

Australian A-Tick Approval

Equipment connected to the Australian Telecommunications Network must have been tested and approved for this purpose. Such equipment will have an A-Tick approval label or sticker.

The following Digium hardware has A-Tick approval (as of 2006-03-28):
  • TDM400P - 4-port analog (FXS/FXO) interface
  • TE410P - 4 span T1/E1/J1 Card for 3.3v PCI
  • TE405P - 4 span T1/E1/J1 Card for 5v PCI
  • TE210P - 2 span T1/E1/J1 Card for 3.3v PCI
  • TE205P - 2 span T1/E1/J1 Card for 5v PCI
  • TE110P - 1 span T1/E1/J1 Card for 3.3v or 5v PCI

  1. Only Digium hardware purchased through the authorised Australian distributor, Australian Technology Partnerships (ATP), or its accredited resellers, will have the required approval and label.
  2. ATP also sells the TDM2400P, TE406P and TE411P, but these are not currently available with A-Tick approval.
  3. Approval for the TDM400P is subject to the following options line being added to modules.conf (linux 2.4.x) or modprobe.conf (linux 2.6.x):

options wctdm opermode=AUSTRALIA fxshonormode=1 boostringer=1

fxshonormode=1 will cause certain parameters (including the hybrid impedance) of FXS ports (ie, phone extensions) to follow the country setting set by opermode. If you don't use fxshonormode=1, then FXO ports will get country-specific settings, but FXS ports will get the default (ie, FCC) settings.

boostringer=1 boosts the ring voltage on FXS ports to about ?? volts. Most modern telephone instruments don't need this extra voltage.

Since zaptel version 1.2.4?, the options fxshonormode=1, boostringer=1 will automatically be set, if you specify opermode=AUSTRALIA. This can be a problem, if you use FXO ports to connect to exchange lines (and hence, opermode=AUSTRALIA is required), but your local extension phones are built to a US standard and have a standard 600-ohm impedance.

Telstra POTS (analog) Exchange Lines

Transmit and Receive Gain

Signal levels on Australian lines are lower than the Asterisk defaults. You will need to adjust the gains in zapata.conf for best results, and to keep echo under control. The following should be a good starting point:

Call Progress Control (CPC) and Disconnect Monitoring

On all of the Telstra exchange lines lines I have checked, a CPC pulse (loop interruption of 2 seconds followed by a reverse-polarity wink) occurs about 60 seconds after the remote party has hung up. If you configure these lines as kewlstart type (fxsks) in zaptel.conf and zapata.conf, then Asterisk will detect the CPC and will hang-up the line.

Telstra will also put a busy/congestion signal on the line, a few seconds after the remote party hangs up. If you use busydetect=yes in zapata.conf, then Asterisk will generally detect the remote hangup long before the CPC comes along. However, this detection is less reliable than CPC.

An alternative approach, if you are running Asterisk >= 1.2, is a Telstra feature known as "Reverse On Idle Condition" (ROIC) which causes the line polarity to be reversed for the duration of any incoming call. With ROIC provisioned if you then make the following changes to zapata.conf:

Asterisk should instantly detect a remote hangup.

Note, though, that ROIC is not compatible with call-waiting service. Only one of the two can be enabled on a line.

ROIC is currently (March 2006) a no cost feature from Telstra. If yours is an Optus line provisioned over their HFC network you are unfortunately out of luck - Optus either cannot or will not provide this feature. If your line is a TransACT line over their FTTC or POTS service you are also out of luck; their NOC do not know what ROIC is.

It has been said that Telstra will not entertain adding ROIC to a "home" line without charging a 'business-rate' line rental but this seems to be highly variable, depending on who you speak to at Telstra.

If the line you wish to have ROIC on is connected to an AXE (older Ericsson switch) at the exchange, it must be on a line hunt to qualify for ROIC (so it follows that a single line won't cut it). If not, and if the exchange has S12 (newer Alcatel System12 - not all exchanges do) switch, they can move the line over to the S12 (with a mandatory number change...), and you then don't need the line hunt to get ROIC.

Reverse on Idle ringing troubles

As is mentioned in the comments section by Jared Davison many people appear to have problems with Polarity Detection during the ringing phase, This is because an AC signal is sent down the line for the RING RING, the repeated voltage reversal from the AC during the ringing phase of the call is mistaken by the zaptel driver as a polarity reversal this is then passed on to asterisk which ends the call...

Jared Davison's Patch
This can be fixed by patching asterisk using Jared's patch which causes asterisk to ignore polarity reversals during the ringing phase, but this means that a call will continue to ring even if the caller hangs up, under this condition answering the phone will result in you hearing a dial tone.

Change channels/chan_zap.c from
/* Added AST_STATE_RING in if statement below to deal with calling party hangups that take place when ringing */
if(p->hanguponpolarityswitch &&
(p->polarityonanswerdelay > 0) &&
(p->polarity == POLARITY_REV) &&
((ast->_state == AST_STATE_UP) || (ast->_state == AST_STATE_RING)) ) {
/* Added log_debug information below to provide a better indication of what is going on */

Change channels/chan_zap.c to
/* Added AST_STATE_RING in if statement below to deal with calling party hangups that take place when ringing */
if(p->hanguponpolarityswitch &&
(p->polarityonanswerdelay > 0) &&
(p->polarity == POLARITY_REV) &&
((ast->_state == AST_STATE_UP) /*|| (ast->_state == AST_STATE_RING)*/) ) {
/* Added log_debug information below to provide a better indication of what is going on */

SoloFlyer's Patch
This can also be fixed by changing the polarity debounce period in the zaptel driver, this causes the zaptel driver to disregard a polarity reversal if it does not remain constant for a defined period of time. The default polarity debounce period is 4 (64ms) increasing the debounce period to 6 (96ms) solved all of my issues and did not appear to have any negative side effects.

The debounce periods are defined in wctdm.c
/* the constants below control the 'debounce' periods enforced by the
check_hook routines; these routines are called once every 4 interrupts
(the interrupt cycles around the four modules), so the periods are
specified in _4 millisecond_ increments
#define RING_DEBOUNCE 4 /* Ringer Debounce (64 ms) */
#define DEFAULT_BATT_DEBOUNCE 4 /* Battery debounce (64 ms) */
#define POLARITY_DEBOUNCE 4 /* Polarity debounce (64 ms) */
#define DEFAULT_BATT_THRESH 3 /* Anything under this is "no battery" */

Primary-Rate ISDN (PRI)

Australian Technology Partnerships (ATP) is a distributor for Digium products in Australia. Their Asterisk Hardware forum has a recommended configuration for PRI connections. The configuration shown below is based in part on the ATP information.

PRI lines in Australia will in general be ISDN30e (euroisdn).

In my configuration, the PRI is plugged in to the single span on a TE110P interface. My zaptel.conf is below:
  1. Span 1: WCT1/0 "Digium Wildcard TE110P T1/E1 Card 0"

If you have a fractional-E1 PRI, then less than the full 30 channels will be active. However, all channels should be configured in zaptel.conf as shown above.

The relevant part of zapata.conf for the above system is shown below:

; ISDN Exchange Lines (Fractional E1 PRA10)
; Our telephony supplier's switch needs priindication=outofband to work properly for busy/congestion
; overlapdial=yes is required for DID (direct inward dial) to work properly
; Despite that it's a digital system, it still needs echo cancellation.
; We are now dealing with reflections from the _far_ end of the digital infrastructure,
; which are not being removed at source. So, the echo canceller needs a longer tail.
; We'd like to use echocancel=256, but with this setting, the echocanceller seems to
; go off the rails. Put it back to the default (128 taps), and put up with residual echo.
; The highest gains you would normally use with ISDN are 0.0dB--ie
; txgain=0.0
; rxgain=0.0
; Note that if you don't explicitly set txgain and rxgain as above, then the default gain
; will be some positive number of dB, which is way too much.
; But to keep echo under control, we need lower signal levels. The following seems to work
;Limited channel allocation for fractional E1 (PRA10)
; Use the following for a full E1 (PRA30)
; channel=>1-15
; channel=>17-31

; Any analog interface modules (eg, TDM400P) will start at channel 32.
; For example


Created by: ipaterson, Last modification: Wed 18 of Sep, 2013 (01:09 UTC) by matttew
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+