PR

[Asterisk] Asterisk をUbuntu にインストールする

まず、Ubuntu(Server版) のインストールを行い、サーバーを構築する。

aptitude でインストール試行

$ sudo aptitude install asterisk

突然ITU-T 電話コードを入力しろと言われて戸惑ったが、おそらく81 で良い気がする。

スポンサードリンク

エラーが出た

Error! Bad return status for module build on kernel: 2.6.35-25-generic-pae (i686)
Consult the make.log in the build directory
/var/lib/dkms/dahdi/2.2.1+dfsg-1ubuntu3/build/ for more information.
dpkg: dahdi-dkms の処理中にエラーが発生しました (–configure):
サブプロセス installed post-installation script はエラー終了ステータス 10 を返しました
dpkg: 依存関係の問題により dahdi の設定ができません:
dahdi は以下に依存 (depends) します: dahdi-dkms | dahdi-source …しかし:
パッケージ dahdi-dkms はまだ設定されていません。
パッケージ dahdi-source はまだインストールされていません。
dpkg: dahdi の処理中にエラーが発生しました (–configure):
依存関係の問題 – 設定を見送ります
dpkg: 依存関係の問題により asterisk の設定ができません:
asterisk は以下に依存 (depends) します: dahdi …しかし:
パッケージ dahdi はまだ設定されていません。
dpkg: asterisk の処理中にエラーが発生しました (–configure):
依存関係の問題 – 設定を見送ります
dpkg: 依存関係の問題により dahdi-linux の設定ができません:
dahdi-linux は以下に依存 (depends) します: dahdi-dkms | dahdi-source …しかし:
パッケージ dahdi-dkms はまだ設定されていません。
パッケージ dahdi-source はまだインストールされていません。
dpkg: dahdi-linux の処理中にエラーが発生しました (–configure):
依存関係の問題 – 設定を見送ります
dpkg: 依存関係の問題により libopenr2-3 の設定ができません:
libopenr2-3 は以下に依存 (depends) します: dahdi …しかし:
パッケージ dahdi はまだ設定されていません。
dpkg: libopenr2-3 の処理中にエラーが発生しました (–configure):
依存関係の問題 – 設定を見送ります
以下のパッケージの処理中にエラーが発生しました:
dahdi-dkms
dahdi
asterisk
dahdi-linux
libopenr2-3

試行錯誤するも解決できず他の方法を探すことにした。

ソースからインストール

参考文献のWiki を読みながら作業する。

コンパイルの準備

$ sudo aptitude install linux-headers-$(uname -r)
$ sudo aptitude install libncurses5-dev bison libssl-dev libnewt-dev zlib1g-dev procps gcc make binutils doxygen
$ cd /usr/src

ソースコードのダウンロード

$ sudo wget http://ftp.digium.com/pub/asterisk/releases/asterisk-ver.tar.gz
$ sudo wget http://ftp.digium.com/pub/zaptel/releases/zaptel-ver.tar.gz

上のwget は出来ないようなので、以下のいずれかを実行する。

$ sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8.2.3.tar.gz
$ sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.6.2.16.1.tar.gz
$ sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.4.39.1.tar.gz

展開と準備

$ sudo tar zvxf asterisk-1.8.2.3.tar.gz
$ cd /usr/src/asterisk-1.8.2.3/
$ sudo ./configure

libxml2 エラーが出た

configure: *** XML documentation will not be available because the ‘libxml2’ development package is missing.
configure: *** Please run the ‘configure’ script with the ‘–disable-xmldoc’ parameter option
configure: *** or install the ‘libxml2’ development package.

$ sudo aptitude install libxml2

などとしてみるが解決できず。おそらく初歩的な問題なんだろうな。

コンパイルとインストール

仕方ないからオプションを付けて ./configure する。

$ sudo ./configure –disable-xmldoc
$ sudo make
$ sudo make install

Your Asterisk modules directory, located at
/usr/lib/asterisk/modules
contains modules that were not installed by this
version of Asterisk. Please ensure that these
modules are compatible with this version before
attempting to run Asterisk.

言われたとおりにしておく

$ sudo make samples
$ sudo make progdocs

確認

$ sudo asterisk -rvvvvvvvvc

Verbosity is at least 8
pbx127*CLI> core show version
Asterisk 1.8.2.3 built by root @ pbx127 on a i686 running Linux on 2011-02-20 03:29:16 UTC

参考文献

コメント