配置Asterisk

1.  检查是否已经安装kernel-devel<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

# rpm -q kernel-devel

2. 检查是否已经安装以下的辅助软件包

rpm -q bison

rpm -q bison-devel

rpm -q ncurses

rpm -q ncurses-devel

rpm -q zlib

rpm -q zlib-devel

rpm -q openssl

rpm -q openssl-devel

rpm -q gnutls-devel

rpm -q gcc

rpm -q gcc-c++

3. 下载libpri,zaptel,asterisk软件包

http://ftp.digium.com/pub/libpri/releases/libpri-1.4.1.tar.gz

http://ftp.digium.com/pub/zaptel/releases/zaptel-1.4.4.tar.gz  

http://ftp.digium.com/pub/asterisk/releases/asterisk-1.4.8.tar.gz

http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.4.2.tar.gz

http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz

将下载的软件包放到自定义的目录下; 例如:/usr/src/

4. 解压缩软件包

#cd /usr/src

# tar -xvzf libpri-<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.4.1.tar.gz

# tar -xvzf zaptel-1.4.4.tar.gz

# tar -xvzf asterisk-1.4.8.tar.gz

# tar -xvzf asterisk-addons-1.4.2.tar.gz

# tar -xvzf asterisk-sounds-1.2.1.tar.gz

# rm -r *.gz (删除压缩包,可以不执行这一步)

5.安装libpri

# cd libpri-1.4.1

# make

# make install

6.安装zaptel

# cd ..

# cd zaptel-1.4.4

# ./configure

# make (make is OK, make26 seems to be useless for recent zaptel versions)

 # make install

# make config (to add zaptel startup script /etc/init.d/zaptel)

7.安装asterisk

# cd ..

# cd asterisk-1.4.8

# ./configure

# make

# make install

# make samples

8. 安装asterisk-addons

# cd ..

# cd asterisk-addons-1.4.2

# ./configure

# make

# make instal

l如果在make install的时候出现错误“cannot stat `.libs/libchan_h323.so.1.0.1'”解决办法:  

#cd /usr/src/asterisk-addons/asterisk-ooh323c/.libs/#ln -s libchan_h323.1.0.1 libchan_h323.so.1.0.1 (小写的L)

# make samples

9.安装asterisk-sounds

# cd ..

# cd asterisk-sounds-1.2.1

# make# make install

10.启动Asterisk

asterisk -vvvvvvvvvvvvvvvcg 执行后会出现很多提示,注意如果里面有红色的ERROR字样说明有问题。如果执行成功,最后会屏幕停在:Asterisk Ready*CLI>

11.注册SIP用户

步骤:

-Registering a user in sip.conf-Registering a number in extensions.conf

11.1 Go to the /etc/asterisk directory on your Asterisk server. Open sip.conf and register the following test user.

<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> 

Note that ALL characters after ‘;’ (semi-colomn) are interpreted by Asterisk as a comment.

[ivan]

This means we are registering user 'ivan'

type=friend

This means the user can place or receive calls. For INBOUND calls only, use ‘peer’ as type. For outbound calls only use ‘user’ as type.

username=ivan

This declares that our user will be named 'ivan'

secret=pwd_ivan

This creates the password for the user to login/authenticate on Asterisk

host=dynamic

This sets dynamic IP for the host. You may also define this as a static IP

context=tutorial

This defines the dial context for the user which in this case is tutorial. In Asterisk, outgoing numbers are divided in groups called contexts in order to separate/define different needs for different user types. For example, a context for local calls, another for within the city, and another for international calls and so on.

This completes the user registration process on Asterisk. Now let us register an extension for the user.

11.2 Go to /etc/asterisk and open extensions.conf

[tutorial]

This registers the context ‘tutorial’

exten => 1234,1,Dial(SIP/ivan)

when dialing number 1234, Asterisk will first Dial the user xlite through SIP protocol. The command is : exten => number, priority, Dial(protocol/user). The priority determines the sequence in which the extensions will be executed.

We now have a registered SIP user and extension on Asterisk. Follow this same process to register another SIP user and extension in order to place test calls.

Start by registering the second user in the same way in /etc/asterisk/sip.conf

Asterisk_voip_ipphone_image183.png

Register the extension(4321) in /etc/asterisk/extensions.conf in the same context = tutorial.

Asterisk_voip_ipphone_image184.png

Now when user 'ivan' or any other user from the tutorial context dials 4321, the user 'test' will be called.

3. The final step is to register the user to a compatible softphone. However, softphones will be reviewed later. For now, just make sure you have registered the users and extensions.

More detailed configuration information for a series of phones can be found here:

01. asterisk with softphones http://www.asteriskguru.com/tutorials/configuration_asterisk_softphone.html

12.安装、启动X-Lite

# cd /opt/xten-xlite./xtensoftphone

少了个libstdc++.so.5,下载装上就可以了;

13.错误处理

13.1 问题:软电话登录时出现“Login Timeout.Contact Firewall..”

解决:桌面|管理|安全级别和防火墙|其他端口|添加5060端口,重启Asterisk和软电话

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章