1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AsteriskをWSL2でセットアップした手順ー1

Last updated at Posted at 2025-01-21

WSL2のUbuntu起動

  • Windows 11でcmdコンソールからWLSと打つだけ
C:\users\XXXXXX>wsl

screen shot - WSL to Ubuntu.jpg

  • Ubuntuが起動したらステータスとVerを確認 (cmdコンソールでなくPowerShellで)
  PS C:\Users\XXXXXX> wsl -l -v
  NAME      STATE           VERSION
* Ubuntu    Running         2
  • Ubuntuを停止 (同様にPowerShell)
PS C:\Users\XXXXXX> wsl -t ubuntu
この操作を正しく終了しました。
  • Ubuntuを再起動
PS C:\Users\XXXXXX> wsl

Asteriskのアーカイブをダウンロード

  • この時点最新版は22.0.0、Win11のブラウザでAsteriskサイトからダウンロード

  • Fドライブ保存なのでマウントしダウンロードしたファイルを確認

root@DESKTOP:/mnt/c/Users/XXXXXX#cd /mnt/f
root@DESKTOP:/mnt/f#ls -l
asterisk-22-current.tar.gz
  • アーカイブをdir asterisk-22.0.0に展開
root@DESKTOP:/mnt/f#tar -zxvf asterisk-22-current.tar.gz
root@DESKTOP:/mnt/f#cd asterisk-22.0.0
asterisk-22.0.0/
asterisk-22.0.0/.cleancount
asterisk-22.0.0/.gitignore
asterisk-22.0.0/.version
asterisk-22.0.0/BSDmakefile
asterisk-22.0.0/BUGS
asterisk-22.0.0/CHANGES.md
........... (途中省略)
Setting up asterisk-modules (1:20.6.0~dfsg+~cs6.13.40431414-2build5) ...
Setting up asterisk (1:20.6.0~dfsg+~cs6.13.40431414-2build5) ...
Adding system user for Asterisk
info: Adding user `asterisk' to group `dialout' ...
info: Adding user `asterisk' to group `audio' ...
Created symlink /etc/systemd/system/multi-user.target.wants/asterisk.service → /usr/lib/systemd/system/asterisk.service.
Setting up sox (14.4.2+git20190427-4build4) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...

Asteriskをインストール

  • aptでインストール (Debian系なので)

    • contributeでインストール(./contribute/scripts/install_prereq install)もあるが
root@DESKTOP:/mnt/f/asterisk-22.0.0# apt install asterisk -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
alsa-topology-conf alsa-ucm-conf asterisk-config asterisk-core-sounds-en asterisk-core-sounds-en-gsm asterisk-modules
asterisk-moh-opsound-gsm freetds-common gcc-14-base libasound2-data libasound2t64 libc-client2007e libcodec2-1.2
libevent-2.1-7t64 libflac12t64 libgcc-s1 libgmime-3.0-0t64 libgomp1 libgpgme11t64 libgsm1 libical3t64 libiksemel3
libjack-jackd2-0 libltdl7 liblua5.1-0 libmp3lame0 libmpg123-0t64 libneon27t64 libnspr4 
........... (途中省略)
Setting up asterisk-modules (1:20.6.0~dfsg+~cs6.13.40431414-2build5) ...
Setting up asterisk (1:20.6.0~dfsg+~cs6.13.40431414-2build5) ...
Adding system user for Asterisk
info: Adding user `asterisk' to group `dialout' ...
info: Adding user `asterisk' to group `audio' ...
Created symlink /etc/systemd/system/multi-user.target.wants/asterisk.service → /usr/lib/systemd/system/asterisk.service.
Setting up sox (14.4.2+git20190427-4build4) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
  • インストール終わり

Asteriskを起動

  • フォアグランドで起動 (オプションの”v”は4つ)
root@DESKTOP:/mnt/f/asterisk-22.0.0# asterisk -vvvvc
  • Asterisk 起動のステータス確認
root@DESKTOP:/mnt/f/asterisk-22.0.0# systemctl status asterisk
asterisk.service - Asterisk PBX
Loaded: loaded
  Active: active (running) since........... (省略)

Asteriskを停止

  • Asteriskへコネクト  コネクトするとCLIでAsterisk操作できる状態となる
root@DESKTOP:/mnt/f/asterisk-22.0.0# asterisk -r
Asterisk 20.6.0~dfsg+~cs6.13.40431414-2build5, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
DESKTOP*CLI>
  • Asteriskをディスコネクト(停止)
DESKTOP*CLI> core stop gracefully
Disconnected from Asterisk server

Asteriskをもう一度起動

  • systemctl でも起動できる
root@DESKTOP:/mnt/f/asterisk-22.0.0# systemctl start asterisk
asterisk.service - Asterisk PBX
Loaded: loaded
  Active: active (running) since ....

AsteriskをWSL2でセットアップした手順ー2・・・・に続く

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?