当前位置:文档之家› Asterisk安装和测试

Asterisk安装和测试

Asterisk安装(红色字体部分为需要键入或修改的部分)下载准备系统环境:Linux CentOS 5.0,安装开发工具以及开发库。

Asterisk 源代码包asterisk-1.6.1.20.tar.gz,版本:1.6.1.20。

SIP软电话使用eyebeam 版本:1.5.8。

1.切换用户(需要输入管理员密码),执行su root2.进入源码包存放文件夹[root@asterisk-test1 ~]#cd /usr/local/src3.下载[root@asterisk-test1 ~]#wget/pub/telephony/asterisk/releases/asterisk1.6.1.20.tar.gz编译安装Asterisk1.解压源代码包[root@asterisk-test1 ~]# tar -zxvf asterisk-1.6.1.20.tar.gz2.进入包目录[root@asterisk-test1 ~]# cd asterisk-1.6.1.203.环境检测和预配置[root@asterisk-test1 asterisk-1.4.5]# ./configure(其实这样直接进行configure并非十分规范。

应当先使用“./configure –help”命令来查看一些可用的选项和参数,然后根据实际情况才进行定制操作。

)当环境预检测和预配置工作做完时,最后会显示以上反馈信息。

并且建立好Makefile。

注意:系统如果缺少安装必须的包,此步骤可能会出现configure: error错误,解决方案见后文可能遇到的问题configure: creating ./config.statusconfig.status: creating build_tools/menuselect-depsconfig.status: creating makeoptsconfig.status: creating channels/h323/Makefileconfig.status: creating include/asterisk/autoconfig.h.$$$$$$$$$$$$$$$=...$7$7.. .7$$7:..$$:. ,$7.7.$7. 7$$$$ .$$77..$$. $$$$$ .$$$7..7$ .?. $$$$$ .?. 7$$$.$.$. .$$$7. $$$$7 .7$$$. .$$$..777. .$$$$$$77$$$77$$$$$7. $$$,$$$~ .7$$$$$$$$$$$$$7. .$$$..$$7 .7$$$$$$$7: ?$$$.$$$ ?7$$$$$$$$$$I .$$$7$$$ .7$$$$$$$$$$$$$$$$ $$$.$$$ $$$$$$7$$$$$$$$$$$$ .$$$.$$$ $$$ 7$$$7 .$$$ .$$$.$$$$ $$$$7 .$$$.7$$$7 7$$$$ 7$$$$$$$$ $$$$$$$7. $$ (TM)$$$$$$$. .7$$$$$$ $$$$$$$$$$$$$$7$$$$$$$$$.$$$$$$$$$$$$$$$$$$$$$$.configure: Package configured for:configure: OS type : linux-gnuconfigure: Host CPU : i6864.清除陈旧的已编译文件[root@asterisk-test1 asterisk-1.4.5]# make clean5.重新编译Asterisk程序[root@asterisk-test1 asterisk-1.4.5]# make编译完成后会显示以下反馈提示信息,提示用户进行下一步可选的操作。

+--------- Asterisk Build Complete ---------++ Asterisk has successfully been built, and ++ can be installed by running: ++ ++ make install ++-------------------------------------------+这里提示用户下一步可以使用“make install”命令,来进行安装了。

6.安装Asterisk程序[root@asterisk-test1 asterisk-1.4.5]# make install当安装完成后就会显示以下反馈提示信息,提示用户进行进一步可选的操作。

+---- Asterisk Installation Complete -------++ ++ YOU MUST READ THE SECURITY DOCUMENT ++ ++ Asterisk has successfully been installed. ++ If you would like to install the sample ++ configuration files (overwriting any ++ existing config files), run: ++++ make samples ++++-----------------or ---------------------++ ++ You can go ahead and install the asterisk ++ program documentation now or later run: ++ ++ make progdocs ++ ++ **Note** This requires that you have ++ doxygen installed on your local system ++-------------------------------------------+这里提示用户还能够有2种可选的操作分别是通过“make samples”来安装配置模版,以及通过“make progdocs”来安装一些程序文档。

7.安装配置模版:[root@asterisk-test1 asterisk-1.4.5]# make samples通过这个命令会安装Asterisk的配置文件模版,当然不会有强大的现成的配置,但确实是相当有帮助的,是配置过程中的重要参考。

8.还可以安装网页语音信箱:(这里暂时没有用到,可以不安装)[root@asterisk-test1 asterisk-1.4.5]# make webvmail安装页面语音信箱,会试图和Apache这种网站服务进行配合,当然还需要许多定制配置。

这里暂时不会用到,但还是觉得应该提一下。

+--------- Asterisk Web V oicemail ----------++ ++ Asterisk Web V oicemail is installed in ++ your cgi-bin directory: ++ /var/www/cgi-bin+ IT USES A SETUID ROOT PERL SCRIPT, SO ++ IF YOU DON'T LIKE THA T, UNINSTALL IT!++ ++ Other static items have been stored in: ++ /var/www/html+ ++ If these paths do not match your httpd ++ installation, correct the definitions ++ in your Makefile of HTTP_CGIDIR and ++ HTTP_DOCSDIR ++ ++-------------------------------------------+编辑Asterisk的配置文件Asterisk 的体系比较巨大,目前只是稍微的了解一下,所以只是做了最最最简单的测试配置,为了通过SIP协议使两个终端注册上来并互相呼叫通话而已,因此配置相当有限,仅仅是为了初步的测试而已。

还有一个地方要注意的是在Asterisk配置文件中的注释符是采用“;”分号的,而不是其他符号。

1.编辑Asterisk的主配置文件:[root@asterisk-test1 ~]# vi /etc/asterisk/asterisk.conf主配置文件是Asterisk的关键部分,这个主配置文件大多数都是为Asterisk指定了环境、调用的路径。

一般情况下不需要去改动它,这里贴出来先看看。

[directories]小节directories主要记录Asterisk的几个重要调用路径astetcdir => /etc/asterisk指定了配置文件路径。

astmoddir => /usr/lib/asterisk/modules指定了模块调用路径。

astvarlibdir => /var/lib/asteriskastdatadir => /var/lib/asterisk指定了本地数据库以及一些重要相关部件的路径。

astagidir => /var/lib/asterisk/agi-bin指定了AGI程序的调用路径。

astspooldir => /var/spool/asterisk指定了呼叫信息记录存放的路径。

astrundir => /var/run指定了PID文件路径。

astlogdir => /var/log/asterisk指定了日志路径。

;[options];internal_timing = yes;systemname = my_system_name ; prefix uniqueid with a system name forglobal uniqueness issues; Changing the following lines may compromise your security.;[files];astctlpermissions = 0660;astctlowner = root;astctlgroup = apache;astctl = asterisk.ctl小节options中记录的都是Asterisk一些可选的设置信息,务必要根据实际情况修改,这里我就先不做变动了。

2.配置SIP对象配置文件:[root@asterisk-test1 ~]# vi /etc/asterisk/sip.conf;; SIP Configuration example for Asterisk;; Syntax for specifying a SIP device in extensions.conf is; SIP/devicename where devicename is defined in a section below.;; You may also use; SIP/username@domain to call any SIP user on the Internet; (Don't forget to enable DNS SRV records if you want to use this);; If you define a SIP proxy as a peer below, you may call; SIP/proxyhostname/user or SIP/user@proxyhostname; where the proxyhostname is defined in a section below;; Useful CLI commands to check peers/users:;这里注释的部分中还提供一些关于SIP部分的调试命令。

相关主题