Asterisk pjsip 電話機

2020年8月17日 (月) 13:19時点におけるTakatyan (トーク | 投稿記録)による版 (Asterisk pjsip NATへのリンクを追加。)

AsteriskでPjSIPを使用した場合の電話機関連設定

目次

電話機設定例

電話機を設定する場合にはセクションが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

AORの max_contacts = 1 が設定されていないと電話機はAsteriskに対してRegisterできません。このmax_contactsが2以上に設定されている場合には、複数の電話機が同じアカウントでRegisterできるようになります。
エンドポイントにACLを使用する場合には

acl=myhouse

のように書きますが、この場合の名前付きACLはAsteriskの名前付きALCです。
つまりacl.confに設定されている名前付きACLということです。pjsipのACLではないので注意してください。

Wizardを使用した場合の設定例

Wizardを使用した場合、共通設定部分をテンプレート化し、各電話機の認証情報だけ別に書くことができます。

;電話機用テンプレート(共通設定)
[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
endpoint/transport = transport-udp
aor/max_contacts = 1
aor/qualify_frequency = 30
aor/authenticate_qualify = no

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

NAT

NAT環境での設定についてはAsterisk pjsip NATを参照のこと。

複数同時レジスト

同一のユーザ名とパスワードで、電話機を複数同時にレジストすることができます。AORのmax_contactsで指定した数字が同時レジストできる台数になります。 詳しい使い方は Pjsip 機能拡張 を参照してください。