「Asterisk pjsip」の版間の差分

提供: VoIP-Info.jp
移動先: 案内検索
(エンドポイント(電話機))
(基本設定)
64行目: 64行目:
 
  outbound_auth = phone1
 
  outbound_auth = phone1
 
  aors = phone1
 
  aors = phone1
 +
==Wizard==
 +
Asteriskにはpjsip_wizardが組み込まれており、PjSIPの設定を簡素化することができます。使う条件は以下の通りです。
 +
*基本の設定はpjsip.confに書く
 +
:transportなどの情報はpjsip.confに書く必要があります
 +
*Wizard用のファイル名はpjsip_wizard.conf
 +
*共通化したテンプレート内で各セクションを指定するにはスラッシュ(/)で区切る
 +
:例: endpoint/dtmf_mode
 +
記述例
 +
;電話機用テンプレート(共通設定)
 +
[phone-defaults](!)
 +
type=wizard
 +
transport = transport-udp
 +
accepts_registrations = yes
 +
sends_registrations = no
 +
accepts_auth = yes
 +
sends_auth = no
 +
endpoint/context = default
 +
endpoint/dtmf_mode = rfc4733
 +
endpoint/call_group = 1
 +
endpoint/pickup_group = 1
 +
endpoint/language = ja
 +
endpoint/disallow = all
 +
endpoint/allow = ulaw
 +
endpoint/rtp_symmetric = yes
 +
endpoint/force_rport = yes
 +
endpoint/direct_media = no
 +
endpoint/send_pai = yes
 +
endpoint/send_rpid = yes
 +
endpoint/rewrite_contact = yes
 +
endpoint/inband_progress = yes
 +
endpoint/allow_subscribe = yes
 +
aor/max_contacts = 1
 +
aor/qualify_frequency = 30
 +
aor/authenticate_qualify = no
 +
 +
;各電話機個別設定
 +
[phone1](phone-defaults)
 +
inbound_auth/username = phone1
 +
inbound_auth/password = mypasswordishere

2018年10月23日 (火) 11:58時点における版


AsiteriskでチャネルにPjSIPを使用する際の設定方法など

コンパイル

Asterisk 13以前ではpjprojectを別個インストールするか、configureに--with-pjproject-bundledを付けて実行する必要がありましたが、Asterisk 16からはデフォルトでbundledインストールされるようになりました。
各バージョン毎のインストール方法についてはAsteriskのそれぞれのページを参照してください。
Asterisk 13
Asterisk 16

基本設定

グローバル設定

pjsip.confに書きます。基本で必要なものは以下です。

[general]
maxexpirey = 3600

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5070

sip.confに書いていたものと同じですが、トランスポートはセクションで明示指定します。上の例では5070ポートにbindさせていますが、5060を使用する場合にはここを5060にします。
なお、他の設定ファイル同様に#includeは使えます。なので、電話機と回線は別ファイルにした方が見通しは良いかも。
Wizardおよびテンプレート(!)も使えます。

ACL

ACLの例は次の通りです。

[acl]
type=acl
deny=0.0.0.0/0.0.0.0
permit=192.168.0.0/255.255.0.0

※deny,permitはこの順でないとpermitしてdenyしてしまう模様で、逆に書くと誰も使えなくなります。

エンドポイント(電話機)

エンドポイントを設定する場合にはセクションが3つ必要です。エンドポイントそれ自体とaor,authの3つです。

[phone1]
type = aor
max_contacts = 1
qualify_frequency = 30
authenticate_qualify = no

[phone1]
type = auth
username = phone3
password = mysecretpassword

[phone1]
type = endpoint
context = default
transport=transport-udp
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = alaw
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
send_pai = yes
inband_progress = yes
call_group = 1
pickup_group = 1
language = ja
device_state_busy_at = 1
auth = phone1
outbound_auth = phone1
aors = phone1

Wizard

Asteriskにはpjsip_wizardが組み込まれており、PjSIPの設定を簡素化することができます。使う条件は以下の通りです。

  • 基本の設定はpjsip.confに書く
transportなどの情報はpjsip.confに書く必要があります
  • Wizard用のファイル名はpjsip_wizard.conf
  • 共通化したテンプレート内で各セクションを指定するにはスラッシュ(/)で区切る
例: endpoint/dtmf_mode

記述例

電話機用テンプレート(共通設定)
[phone-defaults](!)
type=wizard
transport = transport-udp
accepts_registrations = yes
sends_registrations = no
accepts_auth = yes
sends_auth = no
endpoint/context = default
endpoint/dtmf_mode = rfc4733
endpoint/call_group = 1
endpoint/pickup_group = 1
endpoint/language = ja
endpoint/disallow = all
endpoint/allow = ulaw
endpoint/rtp_symmetric = yes
endpoint/force_rport = yes
endpoint/direct_media = no
endpoint/send_pai = yes
endpoint/send_rpid = yes
endpoint/rewrite_contact = yes
endpoint/inband_progress = yes
endpoint/allow_subscribe = yes
aor/max_contacts = 1
aor/qualify_frequency = 30
aor/authenticate_qualify = no

;各電話機個別設定
[phone1](phone-defaults)
inbound_auth/username = phone1
inbound_auth/password = mypasswordishere