I share experience:I'll start with the iron characteristics, perhaps.• Intel Celeron 350MHz;
• 256MB RAM;
• 10GB;
• 3Com FastEthernet.Since, in addition to SIP, I wanted to process incoming calls from my regular telephone line (PSTN), I needed to purchase an AIC (Analog Interface Card), which is supported by Asterisk. The choice fell on a cheap
X100P . This is a clone of the famous and expensive cards from
Digium . To study just right.
So, as for these cards, you should pay attention to two key acronyms: FXO (Foreign Exchange Office) and FXS (Foreign Exchange Station). In theory, my card has one FXO and one FXS, but only FXO works. This means that I can only allow incoming calls through the server.
Now about the techie stuff.')
Asterisk is recommended to be installed either on RedHat / CentOS or on Debian. In my case - the choice fell on the second.
For successful work you have to install three things. Asterisk itself, tel. Zapata drivers (zaptel) and PRI libraries (libpri). I was surprised by the obligation to install libpri, because I do not have ISDN, but these libraries are needed.
Imagine that you put everything you need. It remains to configure the FXO channel, configure the SIP and create a simple dial-plan.
Files we touch:• zaptel.conf;
• zapata.conf;
• extensions.conf;
• sip.conf;
• voicemail.confForeign Exchange Office sends a signal to the Foreign Exchange Station. Therefore, in order to configure the FXO channel (incoming calls), you need to configure the FXS channel and vice versa.
First, let's configure FXO in zaptel.conf as follows:
fxsks = 1
loadzone = no
defaultzone = noWithout going into much detail, I will comment on three lines in zaptel.conf:
fxsks = 1; I configure FXO on the first port of the card. "Ks" stands for "kewlstart" and is a signal protocol for analog circuits.
loadzone = no; Loading zone (in my case - Norway).
defaultzone = no; I set the default zone.
Time to check done:asterisk: ~ # ztcfg -vv
Zaptel Configuration
======================
Channel map:
Channel 01: FXS Kewlstart (Default) (Slaves: 01)
1 channels configured.
The next step is the zapata.conf file, which describes the installation and configuration of the installed X100P.
My file looks like this:
[trunkgroups]
[channels]
language = en
context = incoming
signalling = fxs_ks
usecallerid = yes
cidsignalling = dtmf
hidecallerid = no
callwaiting = yes
usecallingpres = yes
callwaitingcallerid = yes
threewaycalling = yes
transfer = yes
canpark = yes
cancallforward = yes
callreturn = yes
echocancel = yes
echocancelwhenbridged = yes
echotraining = yes
rxgain = 0.0
txgain = 0.0
group = 1
callgroup = 1
pickupgroup = 1
immediate = yes
musiconhold = default
channel => 1Now create a dial-plan that will handle incoming PSTN calls. This is done by editing extensions.conf
Here is my configuration with comments:[general]
static = yes
writeprotect = yes
[globals]
timeout_incoming = 60
options_incoming =
timeout_outgoing = 60
timeout_outgoing =
[incoming]
exten => s, 1, Answer (); Open incoming call
exten => s, 2, Background (me-ivr / away); The message “Hello. I am currently out of place. If this is urgent, then press “1” and your call will be redirected to my cell phone or press “2” to leave a message. ”
exten => i, 1, Goto (incoming, s, 1); When you press any other keys, except "1" and "2", play the message above.Here is a little tricky moment In fact, when you click on "1", the call is not forwarded right there to my cell phone, but first it is redirected to my Soft Phone (X-LITE) installed on the laptop. If I do not answer within five seconds, then my cell phone rings.
exten => 1.1, Dial (SIP / ruslan, 5)
exten => 1,2, Dial (SIP / 004741128324 @ voipbuster); Since I cannot control the FXS channel of my card, I implement external calls using the services of VoipBuster. For example, I can call home phone numbers almost all over Europe for free, and calls to cellular phones cost a penny.
exten => 1,3, Hangup ()
exten => 2.1, VoiceMail (4444 @ default); When you click on "2", record a voice message for the box "4444", which belongs to me.
exten => 2,2, Hangup ()
exten => t, 1, Hangup ()
[internal]
exten => 1000.1, Dial (SIP / ruslan); My internal SIP number.
exten => 2000.1, Dial (SIP / olessia); wife's SIP number.
[default]
Two files left: sip.conf and voicemail.conf
sip.conf
[general]
context = default
bindport = 5060; default SIP port.
bindaddr = 0.0.0.0; Link to which address / network card.
srvlookup = yes; Make DNS queries.
register => designerus: mypassword@sip.voipbuster.com: 5060; Registering my VoIP provider.
[authentication]
[voipbuster]
type = peer
host = sip.voipbuster.com
username = designerus
fromuser = designerus
secret = mypassword
canreivite = no
[ruslan]; ruslan SIP user.
type = friend; Can take and make calls.
callerid = ("Ruslan Valiyev" <1000>); Caller ID, which will be displayed on the phone.
username = ruslan
secret = mysecret
qualify = yes; Allow monitoring account.
nat = no
host = dynamic
canreinvite = yes
context = internal
mailbox = 4444 @ default; Personal voice box "4444".
[olessia]
type = friend
callerid = ("Olessia Skuratovich" <2000>)
username = olessia
secret = mysecret
qualify = yes
nat = no
host = dynamic
canreinvite = no
context = internalI barely touched voicemail.conf, but only added myself at the end:
[default]
4444 => 6774, Ruslan Valiyev, welcome @ myasterisk.ru; "6774" is the pin code that I enter when I want to listen to my messages
Well, almost everything. As for the voice menus or IVR, the English package with sounds in / usr / share / asterisk / sounds comes in the box. If you want to record your sounds, for example, I do it in Audacity, save it in wav, and then convert it to gsm by:
asterisk: ~ # sox inputfile.wav -r 8000 -c 1 outputfile.gsm resample -ql