LoginSignup
3
3

More than 5 years have passed since last update.

Asteriskのdemoの動作を確認する

Posted at

zoiperの設定は済んでいるものとする。

zoiperにてダイヤルしてみましょう。

スクリーンショット 2014-06-16 16.19.26.png

  • 2 : demo-moreinfo
  • 3 : congraturation〜
  • 1000 : 3と同じか
  • 500 : IAX2/guest@pbx.digium.com/s@default に発信。
  • 600 :
  • 8500 :
  • # : demo中に # を押すとガイダンスの終了が流れる。

これらは extensions.lua で設定されている。
extensions.confは見づらいので使わない方がいい。

設定追加

今は 5 にダイヤルしてもかからない。
5 のダイヤルに対する動作を追加してみましょう。

extensions.lua
 ["3"] = function ()
    channel.LANGUAGE():set("fr") -- set the language to french
    demo_congrats()
 end;
+["5"] = function ()
+   channel.LANGUAGE():set("fr") -- set the language to french
+   demo_congrats()
+end;
再起動。多分別の方法がある。
sudo /etc/init.d/asterisk restart

5 にダイヤルして 3でダイヤルした時の内容と同じことを確認。

Systemコマンドで任意の処理をさせる

同様に以下設定を追加してみましょう。

extensions.lua
 ["4"] = function ()
    app.System("/usr/bin/curl http://myhome.co.jp/call4.php")
 end;

4にダイヤルすると、記述したコマンドが実行される。

  • asteriskを起動しているユーザ権限で実行される。
  • sshを実行させたい場合は/home/asterisk/.ssh/あたりの設定を済ませておく必要がある。
  • sudoが必要であれば/etc/sudoersを修正しておく。
3
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
3
3