差分

移動先: 案内検索

Asterisk pjsip

1,678 バイト追加, 2021年5月27日 (木) 13:15
デバッグ
[[Asterisk pjsip parameters]]
==基本設定(電話機:エンドポイント)==
*間違いやすいところ
:sip.confでは1wordだったのがアンダーバーが入る
設定は基本としてはpjsip.confに書きます。<BR>
*[[Asterisk_pjsip_parameters#GLOBAL]]<BR>
グローバル設定を使用する場合にはtype=grobalのセクションを書きます。globalのセクションを書きます。<BR> <nowiki>[grobalglobal] type=grobalglobal max_forwards = 50</nowiki>
SIPの基本パラメータやPjSIPの動作に関わるパラメータはSystemで設定します。<BR>
*[[Asterisk_pjsip_parameters#SYSTEM]]<BR>
→[[Asterisk pjsip ACL]]
===電話機===
電話機を設定する場合にはセクションが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できるようになります。<BR>
エンドポイントにACLを使用する場合には<BR>
acl=myhouse
のように書きますが、この場合の名前付きACLは'''Asteriskの名前付きALC'''です。<BR>
つまりacl.confに設定されている名前付きACLということです。pjsipのACLではないので注意してください。<BR>
===認証情報(Auth)===
sip_confではピア(エンドポイント)の認証がわかりにくかったのですが、PjSIPでは別なセクションで(type=auth)認証情報を定義するようになりました。このため、認証情報がピア名(sip.confの[ ])に紐付かなくなりました。<BR>
username = phone123
password = phonepassword
このAuthは'[some-phone]'エンドポイントに接続、すまり外からのエンドポイントに接続、つまり外からの"入り"の際の認証情報です。<BR>
[phone-out-auth]
*Wizard用のファイル名はpjsip_wizard.conf
*共通化したテンプレート内で各セクションを指定するにはスラッシュ(/)で区切る
*Wizardは電話機でもトランクでも使用できる
:registration/を書くとregistrationセクションがつくられる
:例: endpoint/dtmf_mode
pjsip_wizard.confの記述例
*sip show peer phone1などピア情報を表示するのはpjsip show endpoint phone1
*AORを表示するのは一覧ならpjsip show aorsでピアの情報を表示するのはpjsip show aor phone1のようにする
*それぞれの設定項目で何が設定されているかを確認するには pjsip show endpoint phone1 のようにすると phone1 の endpoint パラメータ一覧が表示される。aorを見たければ pjsip show aor phone1。これはトランクの場合も同様で pjsip show regstration registration hikari-hgw のようにするとregister関係のパラメータがみえる。===デバッグ===chan_sipのsip debug代わりに使えるのは、pjsip debug history。SIPメッセージの確認はこちらの方が簡単かも。 ヒストリをクリア *CLI> pjsip set history clear PJSIP History cleared ヒストリをONに設定 *CLI> pjsip set history on PJSIP History enable なんかやる ヒストリをOFFに設定 *CLI> pjsip set history off PJSIP History disabled ヒストリをみる *CLI> pjsip show history No. Timestamp (Dir) Address SIP Message ===== ========== ============================== =================================== 00047 1620781794 * <== 192.168.254.10:5060 INVITE sip:201@192.168.254.234:5070 SIP/2.0 00048 1620781794 * ==> 192.168.254.10:5060 SIP/2.0 401 Unauthorized 00049 1620781794 * <== 192.168.254.10:5060 ACK sip:201@192.168.254.234:5070 SIP/2.0 00050 1620781794 * <== 192.168.254.10:5060 INVITE sip:201@192.168.254.234:5070 SIP/2.0 00051 1620781794 * ==> 192.168.254.10:5060 SIP/2.0 100 Trying 00052 1620781794 * ==> 192.168.254.3:5060 INVITE sip:phone1@192.168.254.3:5060 SIP/2.0 00053 1620781794 * <== 192.168.254.3:5060 SIP/2.0 100 Trying 00054 1620781795 * ==> 192.168.254.4:5060 OPTIONS sip:phone6@192.168.254.4:5060 SIP/2.0 00055 1620781795 * <== 192.168.254.4:5060 SIP/2.0 200 OK 00056 1620781796 * <== 192.168.254.3:5060 SIP/2.0 180 Ringing 00057 1620781796 * ==> 192.168.254.10:5060 SIP/2.0 183 Session Progress 00058 1620781797 * <== 192.168.254.3:5060 SIP/2.0 200 OK 00059 1620781797 * ==> 192.168.254.3:5060 ACK sip:phone1@192.168.254.3:5060 SIP/2.0 00060 1620781797 * ==> 192.168.254.10:5060 SIP/2.0 200 OK 00061 1620781797 * <== 192.168.254.10:5060 ACK sip:192.168.254.234:5070 SIP/2.0 00062 1620781799 * <== 192.168.254.3:5060 BYE sip:asterisk@192.168.254.234:5070 SIP/2.0 00063 1620781799 * ==> 192.168.254.3:5060 SIP/2.0 200 OK 00064 1620781799 * ==> 192.168.254.10:5060 BYE sip:phone3@192.168.254.10:5060 SIP/2.0 00065 1620781799 * <== 192.168.254.10:5060 SIP/2.0 200 OK 特定のメッセージを確認する *CLI> pjsip show history entry 56 <--- History Entry 56 Received from 192.168.254.3:5060 at 1620781796 ---> SIP/2.0 180 Ringing Via: SIP/2.0/UDP 192.168.254.234:5070;rport=5070;received=192.168.254.234;branch=z Call-ID: fd5b758b-06e4-48cf-97e9-c815623ba9af From: "203" <sip:203@192.168.254.234>;tag=bedf1400-19fc-4c8d-80c2-f7a280ca9978 To: <sip:phone1@192.168.254.3>;tag=1946423440 CSeq: 4197 INVITE Allow: INVITE, ACK, CANCEL, BYE, INFO, UPDATE, OPTIONS, MESSAGE, NOTIFY, REFER Contact: <sip:phone1@192.168.254.3:5060> Server: Panasonic-KX-HDV330N/02.504 (bcc3423c1e0c) Content-Length: 0 Content-Length: 0 chan_sipのようにダラダラ出したい場合は *CLI> pjsip set logger on 
==挙動上の注意点==
===挙動そのもの===

案内メニュー

VoIp-Info.jp

HP Directplus -HP公式オンラインストア-