Tải bản đầy đủ
36.1 Installing G729 and G723 CODECs

36.1 Installing G729 and G723 CODECs

Tải bản đầy đủ

Download the required file(s)

For the G729 codec
For Pentium III
# wget http://kvin.lv/pub/Linux/Asterisk/codec_g729-ast14-gcc4-

glibc-pentium3.so
For Pentium IV
# wget http://kvin.lv/pub/Linux/Asterisk/codec_g729-ast14-gcc4-

glibc-pentium4.so
For the G723 codec
For Pentium III
# wget http://kvin.lv/pub/Linux/Asterisk/codec_g723-ast14-gcc4-

glibc-pentium3.so
For Pentium IV
# http://kvin.lv/pub/Linux/Asterisk/ codec_g723-ast14-gcc4-glibc-

pentium4.so
Rename those files to codec_g729.so or codec_g723.so accordingly.
Restart asterisk and you are done.
If Asterisk does not start then you may need to try icc files instead of gcc.

36.2 TO INSTALL CODECS ON PIAF
All processors EXPERIMENTAL and please ensure that this script is only used on
PiaF or the codecs may not work. (unfortunately celeron processors are not supported).









Log onto PBX in a Flash via the CLI (Command Line Interface) as user root
cd /root
wget http://www.pbxinaflash.org/scripts/install-codecs.x.gz
gunzip install-codecs.x.gz
chmod +x install-codecs.x
./install-codecs.x
In the program you will have to agree to the license before the install can
continue
you will then be prompted to choose the type of processor you have. You
must choose the correct processor or else Asterisk will stop working!
rm -f install-codecs.x

To check if the codecs has been properly installed, at the Asterisk CLI type the
following:
core show translation

TRIXBOX-2 Without Tears

Page 158 of 248

TRIXBOX-2 Without Tears

Page 159 of 248

37 PSTN TRUNK – SPECIAL HANDLING
37.1 DIAL 0 FOR OUTSIDE LINE
There will be times when a user would like to get an outside line something similar to a
PABX by simply dialling a number e.g. 0 or 9.
I got around it by creating an entry in extensions_custom.conf.
In my case I use 0 as the prefix to get an outside line.
I have also pre-recorded a voice prompt to instruct the caller what to do after the second
dial tone.

37.1.1 Using Zaptel Card Method
;##############################################
; To get outside line through ZAP - Ben 22-12-2005
; after dialling 0 will get a second dial tone.
; Then dial the number required.
; No need to press the send button after the second number dialled
;##############################################

exten => 0,1,Playback(start-dial-after-dialtone)
exten => 0,2,Dial(ZAP/1/{EXTEN})
exten => 0,3,Hangup
The example above is based on systems that have Zaptel card (e.g. TDM400 or
X100P etc.) installed. Note:* If you're using a PRI line, you need to enable 'overlapdial'
in /etc/asterisk/zapata.conf for this to work.

37.1.2 Using SPA3K Method
Using SPA3K will be a little tricky. I am describing how I got around it (assuming that
you have set up the SPA3K as described in this document), however there maybe
other method.
1. In the SPA Line 1 Tab, I have included the following entry in the dialplan:
<0:#><:@gw0>)
2. The following is what my dialplan looks like in SPA3K
(**|*xx|**x.|xx.|<0:#><:@gw0>)
3. In the PSTN Line Tab, I have the following:




VOIP-PSTN Gateway Enabled: Yes
VOIP Caller Auth Method: None
VOIP Caller Default DP: None

In made the following entry in my Asterisk entensions_custom.conf
;##############################################
; To get outside line through SPA3K - Ben 25-12-2005
; after dialling 0 will get a second dial tone. Then dial the
; number required. No need to press the send button again
;##############################################

TRIXBOX-2 Without Tears

Page 160 of 248

exten => 0,1,Playback(start-dial-after-dialtone)
exten => 0,2,Dial(SIP/Telstra/{EXTEN}) ; Telstra being the name of the SPA3K trunk.
exten => 0,3,Hangup

Every time when I dial ‘0’, the SPA3K will send it to Gateway 0, which is the PSTN
line and present me with a second dial tone.

37.2 GIVING PRIORITY TO EMERGENCY NUMBERS (E.G. 000)
Emergencies, by definition should be given right of way. This applies to the right of using
the telephone for emergency purposes above other uses.
Imagine what will happen if you want to use the PSTN line to call emergency 000 (in
Australia) and someone else was hogging the line. The sensible way is for Asterisk to
disconnect the line and allow you to make the emergency call instead.
The following method will provide you with the facility, however you need to do some
editing to the extensions_custom.conf file in /etc/asterisk.
In my case I have pre-recorded a voice prompt called ‘calling-emergency’ which says,
“You are trying to call emergency assistance. If you have dial this in error, please hangup”
;###################################################
; Give priority to emergency number by disconnecting existing user
; if using the PSTN line first, otherwise simply call the emergency number.
;###################################################
exten => 000,1,Background(calling-emergency) ; voice warning
exten => 000,2,Wait(1) ; give caller a chance to hang up
exten => 000,3,Dial(Zap/1/000,,j) ; If ZAP 1 is busy, jump to n+101
exten => 000,4,Hangup() ; hang up after the call
exten => 000,104,Softhangup(Zap/1-1) ; hang up the line if being used
exten => 000,105,Goto(3) ; make call after disconnecting the other user

TRIXBOX-2 Without Tears

Page 161 of 248