0
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でセットアップした手順ー3

Posted at

原因分析(RCA)

  • Asteriskのレジスト失敗なので原因を構成要素ごとに想定
構成要素 想定原因
Ubuntu FW、もしくは他アプリ(含むコンフィグ)の影響
Win11 Win11/WSL2のホストorネットワーク影響、デフォルトFW影響
Asetrisk ポート5060で待受けてない、コンフィグ不正
Zoiper インストール不完全、ポート5060でAsetriskへ通信してない

RCA : Ubuntu

  • UbuntuのFWが原因か切り分け

    • firewalldのステータス確認
# systemctl status firewalld
Unit firewalld.service could not be found
  • サービス見つからないと返るのでFWなし=原因でない(そもそもインストールなし)

  • 他アプリが原因でAsteriskやZoiperへ影響の可能性ほぼなく後回し

RCA : Win11、WSL2

  • Win11/WSL2のホストorネットワークが原因か切り分け

ネットを調べると・・
Win10のWSLは同じホスト上にUbuntuがサブシステムで提供・・だったのがWSL2ではHyper-Vの仮想ホストでWin11とUbuntuが提供される仕様とのこと (別々のホストとして)

  • ホスト/ネットワーク構成を再整理、当初認識は・・

image.png

  • 判明した仕様からWSL2はHyper-Vの仮想ホストと仮想ネットワークで構成

image.png

  • 従いAsterisk/Ubuntuは別仮想ホストで仮想ネットワークのIPアドレス

  • つまりWin11のClass C Private address: 192.168.1.84でははない

  • Asterisk/UbuntuのIPアドレスを確認

root@DESKTOP:/etc/asterisk#ip a show dev eth0

image.png

  • Class B Private address: 172.25.27.195/20

    • よくよく見るとWSL起動時にも表示あり IPv4 addrfess for eth0: 172.25.27.195

screen shot - WSL to Ubuntu2.jpg

仮想ホスト/ネットワーク対応

Hyper-Vの仮想ネットワーク172.25.16.0とDesktopやUserPCの物理ネットワーク192.168.1.0は別セグメントなのでUserPCとAsterisk/Ubuntuは直接通信できない
従いWin11/WSL2がアドレス変換(パケットフォワーディング)するようnetsh設定が必要

  • netshのportproxyでパケットフォワーディングを設定
root@DESKTOP# netsh.exe interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=5060 coneectaddress=172.25.27.195 connectport=5060
  • listenaddressは他にグローバル設定やlocalhostもあるようで念のため追加設定
root@DESKTOP# netsh.exe interface portproxy add v4tov4 listenaddress=* listenport=5060 coneectaddress=172.25.27.195 connectport=5060
root@DESKTOP# netsh.exe interface portproxy add v4tov4 listenaddress=localhost listenport=5060 coneectaddress=172.25.27.195 connectport=5060
root@DESKTOP# netsh.exe interface portproxy show v4tov4
  • portproxy設定されたか確認
root@DESKTOP# netsh.exe interface portproxy show v4tov4

Screen 08portproxy Qiita.jpg

Screen 09portproxy Qiita.jpg

しかし、
UserPC/Zoiperから192.168.1.84へレジストリを再トライするが失敗

RCA : Asetrisk

  • Asteriskのポート5060待受けが原因か切り分け
    • lsofでAsteriskが利用のポートを確認
root@DESKTOP# lsof -i | grep asterisk

image.png

  • asterisk(PID=1145)がIPv4、UDP、SIPでListenなので原因でない
  • コンフィグ不正の原因切り分けは次のZoiperで

RCA : Zoiper

  • インストール不完全、ポート5060でAsetriskへ通信してないが原因か切り分け
    • 仮想ホスト/ネットワーク構成からUserPCでなくDESKTOP/Win11もSIPクライアントが可
    • 従い、DESKTOP/Win11にZoiperインストールしAsteriskレジストリをトライ

Screen zoiper of hostos SIP UDP found.jpg

image.png

Screen zoiper configured success.jpg

  • Asteriskレジスト成功、マイク/スピーカー設定、Zoiper利用可に
  • これでZoiperが原因でない、とAsteriskのコンフィグ不正も原因でないと判明

RCA : 結果

  • 纏めると・・

  • UserPC/ZoiperからAsteriskへレジストリを再トライするが依然失敗

  • Ubutntu、Asterisk、Zoiperが原因ではない

  • WSL2が原因の可能性が高い
       

  • 従いWin11/WSL2を除外しUbuntuマシンにAsteriskセットアップをやってみる

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

0
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
0
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?