LoginSignup
1
3

More than 5 years have passed since last update.

Raspberry PiをSIPページングBOX化する

Posted at

Raspberry PiをSIPページングBOX化する

某社のIPページングBOXが終売になってしまい、OEM元の製品を見つけたけど、
需要がそこまで有るとも思えず、RasPiで出来るかどうか試しただけだけど、普通に出来たから載せてみます。

環境

  • RasPi
    • Raspberry Pi 3B+
  • OS
    • Raspbian GNU/Linux 9.8 (stretch)

環境準備

Asteriskをインストールし、Asteriskユーザがオーディオデバイスを触れるようにグループに追加します。

# apt install asterisk
# usermod -a -G audio asterisk

各種設定

SIP周りの設定は普通なので省略

modules.confは chan_console.so もnoloadにしないと、手元の環境では動かなかった。

modules.conf
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
load => chan_alsa.so
noload => chan_oss.so
noload => chan_console.so

output_deviceはaplay -Lで確認出来るけど、RasPiならたぶん一緒

alsa.conf
[general]
autoanswer=yes
context=local
extension=s
output_device=sysdefault:0
noaudiocapture=true

extensionはこんな感じ
一部、PAISTページングのページを参考にさせていただきました。
GPIO使えば起動回路も作れると思うけど、そこまでは試してないです。

extension.conf
[incoming]
exten => _X.,1,Goto(paging,s,1)

[paging]
exten => s,1,NoOp(Paging Start)
;exten => s,n,System(/home/pi/relayon.sh)
exten => s,n,Dial(Console/Alsa,,A(beep))

; Hangup
exten => h,1,NoOp(Paging Hangup)
exten => h,n,System(asterisk -rx 'channel originate Console/Alsa application Playback hello-world')
;exten => h,n,System(/home/pi/relayoff.sh)

ToDo

  • 呼び出し側にも冒頭音が聞こえるとベター
  • GPIO使って起動回路
  • 本機で使うなら、シリアルコンソール使えるようにした方がいいかも。
1
3
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
3