Asterisk: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
No edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Overview ==
== Overview ==
Asterisk 는 오픈 소스 PBX 이다.
Asterisk 는 오픈 소스 PBX 이다.
== Hardware spec ==
Asterisk 를 설치할 때, 얼만큼의 하드웨어 스펙이 필요한지에 대한 조사가 필요할 때가 있다.
Asterisk 는 기본적으로 한번에 운영가능한 콜의 개수에는 제한이 없으며(하드웨어만 충분하다면 무한정 커질 수 있다), 콜을 처리하는데 매우 작은 크기의 메모리를 필요로 한다. 때문에 대부분의 서버에서 무리없이 작동한다.
하지만, 대규모 서비를 준비하고 있다면, 예상되는 서비스의 크기를 고려한 다음, 다음의 링크를 이요하면 대략적으로 알 수 있다.
* https://wiki.merionet.ru/asterisk-calculator


== Installation ==
== Installation ==
이곳(http://www.asterisk.org/downloads) 혹은 이곳(http://downloads.asterisk.org/pub/telephony/asterisk/)에서 최신의 Asterisk 를 다운받아서 설치를 진행해보자. asterisk-13.11.2 버전 기준으로 진행한다.
이곳(http://www.asterisk.org/downloads) 혹은 이곳(http://downloads.asterisk.org/pub/telephony/asterisk/) 에서 최신의 Asterisk 를 다운받아서 설치를 진행해보자. asterisk-13.11.2 버전 기준으로 진행한다.


=== Required library ===
=== Required library ===

Revision as of 08:33, 20 November 2018

Overview

Asterisk 는 오픈 소스 PBX 이다.

Hardware spec

Asterisk 를 설치할 때, 얼만큼의 하드웨어 스펙이 필요한지에 대한 조사가 필요할 때가 있다.

Asterisk 는 기본적으로 한번에 운영가능한 콜의 개수에는 제한이 없으며(하드웨어만 충분하다면 무한정 커질 수 있다), 콜을 처리하는데 매우 작은 크기의 메모리를 필요로 한다. 때문에 대부분의 서버에서 무리없이 작동한다.

하지만, 대규모 서비를 준비하고 있다면, 예상되는 서비스의 크기를 고려한 다음, 다음의 링크를 이요하면 대략적으로 알 수 있다.

Installation

이곳(http://www.asterisk.org/downloads) 혹은 이곳(http://downloads.asterisk.org/pub/telephony/asterisk/) 에서 최신의 Asterisk 를 다운받아서 설치를 진행해보자. asterisk-13.11.2 버전 기준으로 진행한다.

Required library

다음의 라이브러리들이 필요하다. 미리 설치하도록 하자. <source lang=bash> $ sudo apt-get install libncurses5-dev libncurses5 uuid-dev libjansson-dev libjansson4 libxml2-dev sqlite3 libsqlite3-dev </source>

pjproject

Asterisk 버전 12 이후부터는 2가지 sip 모듈을 지원하는데, 하나는 기존부터 지원했던 chan_sip 모듈이고, 다른 하나는 pjsip 모듈이다. Asterisk 기본 설치시, 두가지 모듈 전부 설치를 하게 되는데, Asterisk 설치 전 pjproject 가 설치되어 있어야 한다.

이곳( http://www.pjsip.org/download.htm )에서 최신의 pjproject 다운로드를 하거나 git( git clone https://github.com/asterisk/pjproject pjproject ) 명령어로 다운로드 후, 아래와 같이 설치를 진행하면 된다.<ref>https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+pjproject</ref> <source lang=bash> $ ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG' $ make dep $ make $ sudo make install </source> pjproject 설치시, configure 옵션을 반드시 위와 같이 설정하여야 한다.

  • Error

Asterisk-13.2.0 버전 소스 설치시 pjsip 관련하여 문제가 있었다. 다음과 같은 문제였다. <source lang=bash>

  [CC] pjsip/dialplan_functions.c -> pjsip/dialplan_functions.o
  [LD] chan_pjsip.o pjsip/dialplan_functions.o -> chan_pjsip.so

/usr/bin/ld: /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a(sip_inv.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libpjsip-ua-x86_64-unknown-linux-gnu.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[1]: *** [chan_pjsip.so] Error 1 make: *** [channels] Error 2 </source> 원인인즉, pjproject 설치 시, 위의 옵션을 사용하여 설치하지 않아서였다. pjproject 설치시, 반드시 위의 옵션을 추가하여 설치하여야 한다.

complie

이제 설치를 진행해보자.

<source lang=bash> $ ./configure $ make $ sudo make install </source>

config files

설치 완료 후, 다음의 명령어로 기본 설정 파일들을 세팅할 수 있다. <source lang=bash>

+---- 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    +
+-------------------------------------------+

pchero@mytravel:/usr/local/src/asterisk-13.2.0$ sudo make samples Installing adsi config files... /usr/bin/install -c -d "/etc/asterisk" Installing configs/samples/asterisk.adsi Installing configs/samples/telcordia-1.adsi Installing other config files... Installing file configs/samples/acl.conf.sample Installing file configs/samples/adsi.conf.sample ... </source>

시작/종료 스크립트도 설치해주자. <source lang=bash> $ sudo make config

Adding system startup for /etc/init.d/asterisk ...
  /etc/rc0.d/K91asterisk -> ../init.d/asterisk
  /etc/rc1.d/K91asterisk -> ../init.d/asterisk
  /etc/rc6.d/K91asterisk -> ../init.d/asterisk
  /etc/rc2.d/S50asterisk -> ../init.d/asterisk
  /etc/rc3.d/S50asterisk -> ../init.d/asterisk
  /etc/rc4.d/S50asterisk -> ../init.d/asterisk
  /etc/rc5.d/S50asterisk -> ../init.d/asterisk

pchero@mytravel:/usr/local/src/asterisk-13.2.0$ sudo /etc/init.d/asterisk start

* Starting Asterisk PBX: asterisk                                                                                                                                 [ OK ] 

pchero@mytravel:/usr/local/src/asterisk-13.2.0$ sudo /etc/init.d/asterisk stop

* Stopping Asterisk PBX: asterisk

</source>

로그 로테이트 관련 설정도 함께 해주고 싶다면 다음을 입력하자. <source lang=bash> $ sudo make install-logrotate </source>

start/stop

이제 Asterisk 를 동작/정지/확인 해보자. <source lang=bash> $ sudo /etc/init.d/asterisk start

* Starting Asterisk PBX: asterisk                                                                                                                                 [ OK ] 

$ sudo /etc/init.d/asterisk stop

* Stopping Asterisk PBX: asterisk                                                                                                                                 [ OK ] 

$ sudo /etc/init.d/asterisk status

* asterisk is not running

</source>

External links

References

<references />