Interfacing to a PSTN

9.1 DIGIUM WILDCARD X100P FXO PCI CARD
This card allows you to connect a POTS (plain Old Telephone
System) line to your Asterisk@Home box (See Notes for Patch
information).

If this card is added after Asterisk has been configured, it may be
necessary to configure it by using the zaptel card auto-config utility
so the correct zaptel driver will be set up. To do that, enter the
following from the command line.

rebuild_zaptel (restart after each command)

genzaptelconf (see notes re command switch)

Next go into the AMP web interface to create a trunk and you will
notice that there is already a trunk called ZAP/g0. You need to edit
this.

  1. Enter the phone number for you pots line in the Caller ID field
  2. Enter 1 for Maximum channels
  3. Set a dial rule you want for this trunk
  4. Select an outbound dial prefix to select this trunk when dialing
  5. Set the Zap Identifier to 1 (the default is g0)

Once the card is configured, you must add a route for Incoming Calls or asterisk will not answer this line

Click on Incoming Calls in AMP and set up an incoming route. To
make outbound calls you will need to set an outbound route as well.

If you have this card installed, you will need to edit the
following files; zapata.conf, zaptel.conf and modules.conf for AAH 1.x
or modprobe.conf for AAH 2.x. The last 2 files live in the /etc
directory – use a text editor to edit them.

9.1.1 zapata.conf
Under [channels] edit the following lines:

[channels]

busydetect=yes

busycount=6

For my installation to function correctly, I have also changed the
following setting to obtain a good compromise on volume/echoing:

rxgain=10.0 (you may have to experiment a little with this setting)

txgain=8.0 (you may have to experiment a little with this setting)

Ensure the following exist in zapata.conf. It is located at the end of the file.

;Include AMP Configs

channel => 1

#include zapata_additional.conf

Leave the rest of the file as it is.

9.1.2 zaptel.conf
Change the loadzone and defaultzone to 'au'

# Global data

loadzone = au

defaultzone = au

9.1.3 modules.conf (modprobe.conf for AAH 2.x)
For AAH 1.x, locate the post-install wcfxo entry and edit it to reflect this:

post-install wcfxo /sbin/ztcfg opermode=AUSTRALIA

For AAH 2.x, add the line highlighted in Bold below:

.

alias char-major-196 torisa

options wcfxo opermode=AUSTRALIA ; add this line

install tor2 /sbin/modprobe --ignore-install tor2 && /sbin/ztcfg

.

9.2 DIGIUM TDM400P FXO/FXS CARD
Like the Digium Wildcard X100P, this card allows you to connect a
POTS (plain Old Telephone System) line to your Asterisk@Home box.
Unlike the X100P, this card has 4 module ports that can be loaded with
FXS or FXO modules. Channel 1 is the top RJ-45 on the back of the
TDM400P card.

If this card is installed after Asterisk has been loaded, you will
need to configure it just like the X100P by using the following command
on the command line:

genzaptelconf

9.2.1 zapata-auto.conf
Next, using config edit, look in the zapata-auto.conf file and you
will see a list of all your channels in your TDM400P. Set up the trunks
as trunks and the extensions as extensions in AMP.

When you open the zapata_auto.conf file, it will look something like the illustration below (see the red highlight)

zapata-auto.conf

; Span 1: WCTDM/0 'Wildcard TDM400P REV E/F Board 1'

signaling=fxo_ks

; Note - this is an extension. Create a ZAP extension in AMP for Channel 1

channel => 1 < - -this would have been defined already by the config

signaling=fxs_ks

;Note - this is a trunk. Create a ZAP trunk in AMP for Channel 2

context=from-pstnchannel => 2 < - -this would have been defined already by the config

If in the illustration it shows channel 1 is your Zap extension
then add a zap extension for channel 1 in AMP and if it shows your Zap
trunk is channel 2 you should create a zap trunk for channel 2 in AMP.

Once this is done, reboot your PC and when Asterisk starts, use AMP
to add a route for incoming calls or asterisk will not answer your
trunk. Similarly, to make outbound calls you will need an outbound
route. Set them up as per setting up routes in the earlier chapters of
this document.

If you have this card installed, you will need to edit the
following files; zapata.conf and zaptel.conf as per the X100P card in
the previous section.

9.2.2 modules.conf (modprobe.conf for AAH 2.x)
You will need to edit the modules.conf, or modprobe.conf to add the necessary option for usage in Australia.

The example below is for AAH 1.x. where you need to add the following line;

options wctdm opermode=AUSTRALIA fxshonormode=1 bootstringer=1

Your modules.conf (AAH 1.x) should look like the example below:

alias eth0 e100

alias sound-slot-0 es1370

post-install sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -L >/dev/null 2>&1 || :

pre-remove sound-slot-0 /bin/aumix-minimal -f /etc/.aumixrc -S >/dev/null 2>&1 || :

alias usb-controller usb-uhci

alias char-major-196 torisa

options wctdm opermode=AUSTRALIA fxshonormode=1 boostringer=1

options torisa base=0xd0000

post-install tor2 /sbin/ztcfg

post-install torisa /sbin/ztcfg

post-install wcusb /sbin/ztcfg

post-install wcfxo /sbin/ztcfg

post-install wctdm /sbin/ztcfg

post-install ztdynamic /sbin/ztcfg

You will only need to add the line in red. Do not change anything else.

Or, in AAH Ver.2.1, you may also do the following:

Locate the line 'install wctdm /sbin/ztcfg-- --ignore-install wctdm
&& /sbin/ztcfg' and edit it to reflect the following:

install wctdm opermode=AUSTRALIA fxshonormode=1 boostringer=1 /sbin/ztcfg-- --ignore-install wctdm && /sbin/ztcfg

Note: as of Zaptel
Drivers 1.2.4, by selecting opermode=AUSTRALIA the zaptel drivers
automatically add the 'boostringer=1 , fxshonormode=1'

Also see Appendix E.3 (Users Suggestions)

9.3 REBUILDING ZAPTEL DRIVER
Every time there is a kernel update with yum (which is the case
with Asterisk and CentOS), ZAP device support needs to be rebuilt using
the new kernel. Unfortunately, this will cause a slight problem as
RedHat bug caused the rebuilding process to fail.

The following is the fix - source Nerd Vittles http://nerdvittles.com/index.php?p=123

Log into your new server as root and issue the following commands:

cd /usr/src/kernels/2.6.9-34.EL-i686/ include/linux

mv spinlock.h spinlock.h.old

wget http://nerdvittles.com/aah27/spinlock.h

Once the file has been retrieved, reboot using the following command:

shutdown -r now

When the reboot completes, you can start rebuilding the support for
your ZAP devices or for that matter, ztdummy if you don’t have any ZAP
devices.

Log in as root and type the following command:

rebuild_zaptel

Then reboot your system:

shutdown -r now

Now log in as root again and enter the following command:

amportal stop

genzaptelconf

Reboot once again:

shutdown -r now

..and you're done.

(See also user Users’ Suggestions)

9.4 SIPURA SPA3000 AS A PSTN INTERFACE
To those new to the SPA3000, there is a simplified installation
and configuration instruction by JMG Technology. While it is directed
mainly at standalone ATA users, it gives a good insight of the Sipura
SPA3000’s capabilities.

I have come across a few people in the various forums wanting to
use their Sipura SPA-3000s as FXO front-end to their Asterisk@Home
boxes. To help them in their endeavours, I've put the following
together, as no one single source of information that I've found so far
has a config that would actually work for me.

9.4.1 Log in to SPA3000
Login to your SPA-3000 as admin/advanced.

Before you change anything, I'd suggest taking a snapshot (i.e.
just save the .html page) of your current SPA-3000 configuration, just
in case you ever need to refer back to your own customisations.

If you're not already running the latest SPA-3000 firmware, then
upgrade it to the latest version (at the time of writing, it's 3.1.5a).
Take another snapshot for good measure. Nothing should have changed in
your settings, except that you have a few extra options that you didn't
have before.

Now reset SPA-3000 back to factory defaults, because I'm only going
to list the minimum changes required to keep things simple. Take
another snapshot now too, in case you ever want to know what the
defaults were.

9.4.2 Change the settings
System tab

DHCP: No

Static IP: something on your local subnet e.g.; 192.168.1.200

NetMask: 255.255.255.0

Gateway: your router's IP address e.g.; 192.168.1.254

Primary DNS: your ISP's primary DNS address e.g.; 203.12.160.35

Secondary DNS: your ISP's secondary DNS address e.g.; 203.12.160.36

Regional tab

Dial Tone: 400@-19,425@-19;10(*/0/1+2)

Busy Tone: 425@-10;10(.4/.4/1)

Reorder Tone: 425@-10;10(.2/.2/1)

Ring Back Tone: 400@-19,425@-19,450@-19;*(.4/.2/1+2+3,.4/.2/1+2+3,0/2/0)

Ring 1 Cadence: 60(1.5/3.4)

Ring 3 Cadence:
60(1.5/3.4,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2)

CWT8 Cadence: 30(.2/.2,.2/4.4)

Hook Flash Timer Min: .07

Hook Flash Timer Max: .13

Delete all the Vertical Service Activation Codes.

FXS Port Impedance: 220+820||120nF

Line 1 tab

Proxy: IP address of your Asterisk box e.g.; 192.168.1.234

Register Expires: 60

Display Name: Whatever

User ID: Asterisk extension number e.g.; 200

Password: password for that extension

Silence Threshold: medium

DTMF Tx Method: INFO

Hook Flash Tx Method: INFO

Dial Plan: (*xx|000|0011xxxxxxxxxxx.|0[23478]xxxxxxxx|09xxxxxx|1100
|122[135]|1222xxxxxxx|12510[12]|12554|1[38]00xxxxxx|13[1-9]xxx
|1747xxxxxxx|2xx|393xxxxxx|3xxxx. |[4689]xxxxxxx|7777|899060xxxxx.) for
example

(*xx.|x.) will work, but I like to do a bit of sanity checking, etc.

PSTN Line tab (method 1)

Proxy: IP address of your Asterisk box e.g.; 192.168.1.234

Register: no

Make Call Without Reg: yes

Ans Call Without Reg: yes

Display Name: No name

User ID: PSTN

Password: password

Silence Supp Enable: no

Echo Canc Enable: no

Echo Canc Adapt Enable: no

Echo Supp Enable: no

FAX CED Detect Enable: yes

FAX CNG Detect Enable: yes

FAX Passthru Codec: G711u

FAX Codec Symmetric: no

FAX Passthru Method: None

DTMF Tx Method: INFO

FAX Process NSE: no

Dial Plan 1: (S0<:T0298765432>) for example

VoIP Caller Default DP: none

PSTN Ring Thru Line 1: no

PSTN CID For VoIP CID: yes

PSTN Answer Delay: 2

PSTN Ring Thru Delay: 3

PSTN Ring Timeout: 4

PSTN Hook Flash Len: .1

Disconnect Tone: 425@-30,425@-30;1(.375/.375/1+2)

FXO Port Impedance: 220+820||120nF

On-Hook Speed: 26ms (Australia)

(Source reference: Colin Swan)

Or alternatively you may want to adopt the second method for the PSTN Line Tab, which I am currently using.

PSTN Line tab (method 2)

Proxy: IP address of your Asterisk box e.g.; 192.168.1.234

Register: no

Make Call Without Reg: yes

Ans Call Without Reg: yes

Display Name: No name

User ID: PSTN

Password: password

Silence Supp Enable: no

Echo Canc Enable: no

Echo Canc Adapt Enable: no

Echo Supp Enable: no

FAX CED Detect Enable: yes

FAX CNG Detect Enable: yes

FAX Passthru Codec: G711u

FAX Codec Symmetric: no

FAX Passthru Method: None

DTMF Tx Method: INFO

FAX Process NSE: no

Dial Plan 1: (S0<:s@YourAsteriskIP>) e.g. (S0<:s@192.168.0.101:5060>)or try w/o the port designation

VoIP Caller Default DP: none

PSTN Ring Thru Line 1: no

PSTN CID For VoIP CID: yes

PSTN Answer Delay: 2

PSTN Ring Thru Delay: 3

PSTN Ring Timeout: 4

PSTN Hook Flash Len: .1

Disconnect Tone: 425@-30,425@-30;1(.375/.375/1+2)

FXO Port Impedance: 220+820||120nF

On-Hook Speed: 26ms (Australia)

Using this alternative method, you will not need to create an
Inbound Route for this channel as the call is sent directly to your “s‿
extension as defined in your incoming call setting. You may also get
CLID if your Telco has activated incoming Caller ID on your phone.

User 1 tab

Default Ring: 3

Default CWT: 8

9.4.3 Add SIP Trunk
Then in AMP, add a SIP trunk.

Outbound Caller ID: <0298765432> (for example)

Maximum Channels: 1

Dial Rules: 0+NXXXXXXXX (for example)

0011+ZXXXXXXXXXX.

Trunk Name: telstra (for example)

Peer Details:

canreinvite=no

context=from-pstn

host=the IP address of your SPA-3000 (for example; 192.168.1.200)

insecure=very

nat=no

port=5061 (for example)

qualify=yes

secret=password

type=peer

username=PSTN

User Context: telstra-incoming (for example)

User Details:

canreinvite=no

context=from-pstn

host=the IP address of your SPA-3000 (for example; 192.168.1.200)

insecure=very

nat=no

port=5061 for example

secret=password

type=user

username=PSTN

Leave "Register String" empty

Then add a DID Route of T0298765432 (for example), which goes to your chosen Destination. (Source reference: Colin Swan)

See the alternative configuration that I am currently using for the PSTN Tab in Notes

Also see Eliminating echo problems in Appendix E.4 in Sipura SPA-3000

Taxonomy upgrade extras: 

Comments

tech_johncel's picture

Hi guys,

Great day,

Can any one knows how to integrate Quintum VoIP devices to a pbx like this.

jackyzrk's picture

I need to send calls to another sip server without registering.just routing.And the server require the username and password for the call.I have called out successfully by one softphone,but with the freepbx,I add a new trunk and it failed.Here I capture the packages of softphone.
Showed as below: Can any one help me! Thanks forever.

Session Initiation Protocol
Request-Line: INVITE sip:8613318858199@203.208.198.208:5040 SIP/2.0
Method: INVITE
Resent Packet: False
Message Header
User-Agent: MRUA936_1.0.9_GP1
Contact: NUERA-ID
Contact Binding: NUERA-ID
URI: NUERA-ID
SIP Display info: NUERA-ID
SIP contact address: sip:123456789@192.168.0.200:5040
Supported: timer
Session-Expires: 20
ClientToken: 6.1.1.1.1;0ff70f48e569308031d88e07fc27c130adb27c559a89159087a3a5101b16aeedb2
Via: SIP/2.0/UDP 192.168.0.200:5040;branch=z9hG4bK5052
From: ;tag=11980
SIP from address: sip:123456789@192.168.0.200:5040
SIP tag: 11980
To: 8613318858199
SIP Display info: 8613318858199
SIP to address: sip:8613318858199@203.208.198.208:5040
Call-ID:

Max-Forwards: 10
CSeq: 871 INVITE
Content-Type:application/sdp
Content-Length: 130
Message body
Session Description Protocol
Session Description Protocol Version (v): 0
Owner/Creator, Session Id (o): MRUA936_1.0.9_GP1 7525484 7525484 IN IP4 192.168.0.200
Owner Username: MRUA936_1.0.9_GP1
Session ID: 7525484
Session Version: 7525484
Owner Network Type: IN
Owner Address Type: IP4
Owner Address: 192.168.0.200
Session Name (s): SIP Call
Connection Information (c): IN IP4 192.168.0.200
Connection Network Type: IN
Connection Address Type: IP4
Connection Address: 192.168.0.200
Time Description, active time (t): 0 0
Session Start Time: 0
Session Stop Time: 0
Media Description, name and address (m): audio 1024 RTP/AVP 4
Media Type: audio
Media Port: 1024
Media Proto: RTP/AVP
Media Format: ITU-T G.723

familymanfranck's picture

Hello there;
I have successfully downloaded Trixbox Pro, then I have had so many problem to install it. At once it stopped showing a kickstart problem. Then to solve that problem I installed it invocking linux noprobe. Afterward I could install, however I never could get the gui. I managed to configure the network card but from a web browser I couldn't get anything but the apache splash screen. Could someone help me please. Thanks in advance for your help

fskrotzki's picture

familymanfranck,

You might be better looking for help at the www.trixbox.org site as Freepbx is just a component of the trixbox install. Without knowing a lot more details it's almost impossible to help you.

Also what you have done here is hijacked a thread for another purpose and it is frowned upon. In the future please post a question like this as a new topic. When you do you'll receive notices to updates, currently the origional poster will get notices about your issue which has nothing to do with what he posted.

thanks.

atulablack's picture

Dear all.

Does we try with VoIP of Patton. I had been trying and still working fine. If you any question about VoIP of Patton, please let me know.

Best regards.

Trungdo

Trungdo@patton.com

fskrotzki's picture

Please do NOT post self promotions, specially in the documentation and administration sections. Your comment here as it is worded is not relevant to the topic.

For people looking for help with this topic you are much better off posting a NEW question in the forums section as that's where people look to help others and not in the documentation section.

badermerhi's picture

hi , i installed AsteriskNow 1.5 Beta
using DIGIUM TDM410P "4 analoge ports"
am not sure how this thing is configured with the AMP as it is my first time using the FreePBX
i used the asterisk GUI before , it was very simple , add an analoge interface , configure , etc...
i had to update Dahdi, for the dahdi_genconf to work as it was showing an error before.
after i ran the dahdi_genconf i have the following generated.
my /etc/asterisk/dahdi-channels.conf shows the following
---------------------------------------------------------------------------------------------------------------------------

;; Autogenerated by /usr/sbin/dahdi_genconf on Fri Oct 24 19:16:23 2008 -- do not hand edit
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/asterisk/chan_dahdi.conf that will include the global settings
;

; Span 1: WCTDM/0 "Wildcard TDM410P Board 1" (MASTER)
;;; line="1 WCTDM/0/0 FXSKS (In use) (EC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 1
callerid=
group=
context=default

;;; line="2 WCTDM/0/1 FXSKS (In use) (EC: MG2)"
signalling=fxs_ks
callgroup=0
context=from-pstn
channel => 2
callerid=
group=
context=default

;;; line="3 WCTDM/0/2 FXSKS (In use) (EC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 3
callerid=
group=
context=default

;;; line="4 WCTDM/0/3 FXSKS (In use) (EC: MG2)"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 4
erid=asreceived
callerid=
group=
context=default
-----------------------------------------------------------------------------------------------------------------------------
am not sure if i have to add zap channels or trunks
and how to use these trunks to dial out .
i dont see any trunks in the FOP panel .

2nd question , is how to give a dial plan for every extension.

Thank you.

vmikhelson's picture

Hi,

I am in the same boat as badermerhi (tadpole) is.

Came from AsteriskNOW 1.0.2.1 to AsteriskNOW 1.5 Beta since I was intrigued by the switch to FreePBX. For the last three days I am trying to get AsteriskNOW to answer a line or produce a dial tone on a test extension to no avail.

So far I forced the WCTDM and WCTDM24XXP drivers for my TDM400P and TDM410P to load, I was able to run dahdi_genconf after I manually created /etc/dahdi/genconf_parameters which was mysteriously missing making dahdi_genconf unhappy.

This is where my luck ends. AsteriskNOW is deaf and silent.

Any help will be appreciated.

Thank you,
Vladimir

morons's picture

1st /etc/dahdi/genconf_parameters was missing after make instsall and I had to copy it from the source location.

running dahdi_genconf I get :
unknown default dahdi signalling for chan 1 type BRI at /usr/sbin/dahdi_genconf line 186.

I get this no matter what options i select inside /etc/dahdi/genconf_parameters. Line 186 is where the genconf_parameters file is parsed and specifically where it compensates for diff shells maybe this can be debuged or please let me know witch shell its working with.

I installed dahdi-linux-complete-2.1.0-rc3+2.1.0-rc3.tar.gz to get the Wildcard B410P dahdi driver.

Thank you for you time if you could help
OS = CentOS release 5.2 (Final) Linux {my server} 2.6.18-53.1.19.el5 #1 SMP Wed May 7 08:20:19 EDT 2008 i686
Asterisk 1.4.22-rc5

badermerhi's picture

hi again ,
i am trying to put the TDM410P digium card working with the complicated unworking ASTEIRSKNOW 1.5 beta1
i updated the whole system using yum update , and updated FreePBX from admin modules,
i managed to create trunks, extensions, outbound routes!
outbound routes is using trunk ZAP/g0 group zero as mentioned in the dahdi-channels.conf
i created A ZAP Trunk (DAHDI compatibility Mode) g0
everytime i try to make a call its giving me
TRUNK Dial failed due to CHANUNAVAIL (hangupcause: 0) - failing through to other trunks
i am out of ideas
anyone out there ?

mvabown's picture

By following these instructions i was able to get my drivers to load like they are supposed to, and to make out going calls. I was not able to do the dahdi_genconf so i made the file myself. I think that is why i can go out but nothing coming in.
Just goes to a voice saying "bye" and then hangs up.

I hope this will help at least to get the drivers installed.

"First make sure that DAHDI is started automatically when the server boots up, you can do so with “chkconfig --add dahdi”. Then all you will need to do in most cases is run “dahdi_genconf”, edit “/etc/asterisk/chan_dahdi.conf” to include “#include dahdi-channels.conf” and restart the server. This will cause DAHDI, Asterisk and FreePBX to restart and then you should have your DAHDI trunks and stations available as options in your FreePBX GUI for configuration."