「Asterisk pjsip trunk intra」の版間の差分
ナビゲーションに移動
検索に移動
編集の要約なし |
|||
(同じ利用者による、間の17版が非表示) | |||
1行目: | 1行目: | ||
拠点間をAsteriskのSIPで接続します | |||
=両端IPアドレス固定= | |||
拠点はIPアドレス固定でレジスタ無しで通信します。想定は以下の通り。 | |||
[池袋]---------------------------[板橋] | [池袋]---------------------------[板橋] | ||
192.168.100.1 192.168.100.2 | 192.168.100.1 192.168.100.2 | ||
SIP Port=5070 SIP Port=5070 | SIP Port=5070 SIP Port=5070 | ||
拠点番号 02 拠点番号 01 | |||
ダイヤル時のプレフィクスとして拠点番号(01,02)を使用し、相手内線に着信させる想定とします。 | |||
==池袋側== | ==池袋側== | ||
基本:AOR,Endpointとして板橋を定義します。板橋側からの接続の認証を受け入れるためにAuthを、板橋への接続のためのOutbound_authを書きます。 | 基本:AOR,Endpointとして板橋を定義します。板橋側からの接続の認証を受け入れるためにAuthを、板橋への接続のためのOutbound_authを書きます。 | ||
10行目: | 15行目: | ||
contact = sip:192.168.100.2:5070 | contact = sip:192.168.100.2:5070 | ||
qualify_frequency = 30 | qualify_frequency = 30 | ||
authenticate_qualify = | authenticate_qualify = yes | ||
[itabashi] | [itabashi] | ||
47行目: | 52行目: | ||
outbound_auth = itabashi | outbound_auth = itabashi | ||
aors = itabashi | aors = itabashi | ||
[[カテゴリ:Asterisk]] | |||
[[カテゴリ:pjsip]] | |||
==板橋側== | |||
基本的に設定は同じです。相手をendpointとして定義しAORや認証情報を書きます。 | |||
[ikebukuro] | |||
type = aor | |||
contact = sip:192.168.100.1:5070 | |||
qualify_frequency = 30 | |||
authenticate_qualify = yes | |||
[ikebukuro] | |||
type = identify | |||
endpoint = ikebukuro | |||
match = 192.168.100.1 | |||
[itabashi] | |||
type = auth | |||
auth_type = userpass | |||
username = itabashi | |||
password = itapass | |||
[ikebukuro] | |||
type = auth | |||
auth_type = userpass | |||
username = ikebukuro | |||
password = ikepass | |||
[ikebukuro] | |||
type = endpoint | |||
context = intra-incoming | |||
disallow = all | |||
allow = ulaw | |||
rtp_symmetric = yes | |||
force_rport = yes | |||
rewrite_contact = yes | |||
direct_media = no | |||
send_pai = yes | |||
inband_progress = yes | |||
language = ja | |||
auth = itabashi | |||
outbound_auth = ikebukuro | |||
aors = ikebukuro | |||
==ダイヤルプラン== | |||
endpointではcontext=intra-incomingに定義していますので着信側は[intra-incoming]で処理します。 | |||
===着信設定=== | |||
[intra-incoming] | |||
exten => 201,1,Dial(PJSIP/201) | |||
exten => 202,1,Dial(PJSIP/202) | |||
のように書けば内線に落とせます。 | |||
===発信側=== | |||
発信側で例えば池袋からなら | |||
exten => _01XXX,1,Dial(PJSIP/{EXTEN:2}@itabashi) | |||
のように書くと相手拠の内線にダイヤルできます。<br> | |||
板橋からなら | |||
exten => _02XXX,1,Dial(PJSIP/{EXTEN:2}@ikebukuro) | |||
のように書きます。 | |||
=片端IPアドレス固定、片端ダイナミック= | |||
拠点はIPアドレス固定でレジスタ無しで通信します。想定は以下の通り。 | |||
[池袋]-----------------REGISTER->[板橋] | |||
IP不明 192.168.100.2 | |||
SIP Port=5070 | |||
拠点番号 02 拠点番号 01 | |||
ダイヤル時のプレフィクスとして拠点番号(01,02)を使用し、相手内線に着信させる想定とします。 | |||
==池袋側== | |||
板橋に対してREGISTERするクライアントになります。この際、ユーザ名は"ikebukuro"として認証を取ります。<BR> | |||
『自分の』名前がikebukuroなのでikebukuroでauthを使っています。混乱しないように。 | |||
[itabashi] | |||
type = aor | |||
contact = sip:192.168.0.2:5070 | |||
qualify_frequency = 30 | |||
authenticate_qualify = no | |||
[itabashi] | |||
type = registration | |||
transport = transport-udp | |||
outbound_auth = ikebukuro | |||
server_uri = sip:192.168.0.2:5070 | |||
client_uri = sip:ikebukuro@192.168.0.2 | |||
retry_interval = 60 | |||
[itabashi] | |||
type = identify | |||
endpoint = itabashi | |||
match = 192.168.0.2 | |||
[ikebukuro] | |||
type = auth | |||
auth_type = userpass | |||
username = ikebukuro | |||
password = ikepass | |||
realm = asterisk | |||
[itabashi] | |||
type = endpoint | |||
context = intra-incoming | |||
disallow = all | |||
allow = ulaw | |||
rtp_symmetric = yes | |||
force_rport = yes | |||
rewrite_contact = yes | |||
direct_media = no | |||
send_pai = yes | |||
inband_progress = yes | |||
language = ja | |||
from_user = ikebukuro | |||
from_domain = 192.168.0.2 | |||
auth = ikebukuro | |||
outbound_auth = ikebukuro | |||
aors = itabashi | |||
from_user,from_domainを指定しないと、いろんなものが'内線@自分のIPアドレス'の形で出て行こうとするので相手先でエラーになります。 | |||
==板橋側== | |||
池袋からのREGISTERを受け入れるので、基本的な考え方は電話機の接続と同じです。<br> | |||
AORのmax_contacts = 1を指定することでREGISTER受け入れを許可します(1つだけ) | |||
[ikebukuro] | |||
type = aor | |||
max_contacts = 1 | |||
qualify_frequency = 30 | |||
authenticate_qualify = no | |||
[ikebukuro] | |||
type = auth | |||
auth_type = userpass | |||
username = ikebukuro | |||
password = ikepass | |||
realm = asterisk | |||
[ikebukuro] | |||
type = endpoint | |||
context = intra-incoming | |||
disallow = all | |||
allow = ulaw | |||
rtp_symmetric = yes | |||
force_rport = yes | |||
rewrite_contact = yes | |||
direct_media = no | |||
send_pai = yes | |||
inband_progress = yes | |||
language = ja | |||
auth = ikebukuro | |||
outbound_auth = ikebukuro | |||
aors = ikebukuro |
2018年10月30日 (火) 17:03時点における最新版
拠点間をAsteriskのSIPで接続します
両端IPアドレス固定
拠点はIPアドレス固定でレジスタ無しで通信します。想定は以下の通り。
[池袋]---------------------------[板橋] 192.168.100.1 192.168.100.2 SIP Port=5070 SIP Port=5070 拠点番号 02 拠点番号 01
ダイヤル時のプレフィクスとして拠点番号(01,02)を使用し、相手内線に着信させる想定とします。
池袋側
基本:AOR,Endpointとして板橋を定義します。板橋側からの接続の認証を受け入れるためにAuthを、板橋への接続のためのOutbound_authを書きます。
[itabashi] type = aor contact = sip:192.168.100.2:5070 qualify_frequency = 30 authenticate_qualify = yes [itabashi] type = identify endpoint = itabashi match = 192.168.100.2 ;外からの接続を受け入れるためのauth [ikebukuro] type = auth auth_type = userpass username = ikebukuro password = ikepass ;板橋側に認証してもらうためのauth(endpointのoutbound_auth) [itabashi] type = auth auth_type = userpass username = itabashi password = itapass ;板橋のendpointを定義 [itabashi] type = endpoint context = intra-incoming disallow = all allow = ulaw rtp_symmetric = yes force_rport = yes rewrite_contact = yes direct_media = no send_pai = yes inband_progress = yes language = ja auth = ikebukuro outbound_auth = itabashi aors = itabashi
板橋側
基本的に設定は同じです。相手をendpointとして定義しAORや認証情報を書きます。
[ikebukuro] type = aor contact = sip:192.168.100.1:5070 qualify_frequency = 30 authenticate_qualify = yes [ikebukuro] type = identify endpoint = ikebukuro match = 192.168.100.1 [itabashi] type = auth auth_type = userpass username = itabashi password = itapass [ikebukuro] type = auth auth_type = userpass username = ikebukuro password = ikepass [ikebukuro] type = endpoint context = intra-incoming disallow = all allow = ulaw rtp_symmetric = yes force_rport = yes rewrite_contact = yes direct_media = no send_pai = yes inband_progress = yes language = ja auth = itabashi outbound_auth = ikebukuro aors = ikebukuro
ダイヤルプラン
endpointではcontext=intra-incomingに定義していますので着信側は[intra-incoming]で処理します。
着信設定
[intra-incoming] exten => 201,1,Dial(PJSIP/201) exten => 202,1,Dial(PJSIP/202)
のように書けば内線に落とせます。
発信側
発信側で例えば池袋からなら
exten => _01XXX,1,Dial(PJSIP/{EXTEN:2}@itabashi)
のように書くと相手拠の内線にダイヤルできます。
板橋からなら
exten => _02XXX,1,Dial(PJSIP/{EXTEN:2}@ikebukuro)
のように書きます。
片端IPアドレス固定、片端ダイナミック
拠点はIPアドレス固定でレジスタ無しで通信します。想定は以下の通り。
[池袋]-----------------REGISTER->[板橋] IP不明 192.168.100.2 SIP Port=5070 拠点番号 02 拠点番号 01
ダイヤル時のプレフィクスとして拠点番号(01,02)を使用し、相手内線に着信させる想定とします。
池袋側
板橋に対してREGISTERするクライアントになります。この際、ユーザ名は"ikebukuro"として認証を取ります。
『自分の』名前がikebukuroなのでikebukuroでauthを使っています。混乱しないように。
[itabashi] type = aor contact = sip:192.168.0.2:5070 qualify_frequency = 30 authenticate_qualify = no [itabashi] type = registration transport = transport-udp outbound_auth = ikebukuro server_uri = sip:192.168.0.2:5070 client_uri = sip:ikebukuro@192.168.0.2 retry_interval = 60 [itabashi] type = identify endpoint = itabashi match = 192.168.0.2 [ikebukuro] type = auth auth_type = userpass username = ikebukuro password = ikepass realm = asterisk [itabashi] type = endpoint context = intra-incoming disallow = all allow = ulaw rtp_symmetric = yes force_rport = yes rewrite_contact = yes direct_media = no send_pai = yes inband_progress = yes language = ja from_user = ikebukuro from_domain = 192.168.0.2 auth = ikebukuro outbound_auth = ikebukuro aors = itabashi
from_user,from_domainを指定しないと、いろんなものが'内線@自分のIPアドレス'の形で出て行こうとするので相手先でエラーになります。
板橋側
池袋からのREGISTERを受け入れるので、基本的な考え方は電話機の接続と同じです。
AORのmax_contacts = 1を指定することでREGISTER受け入れを許可します(1つだけ)
[ikebukuro] type = aor max_contacts = 1 qualify_frequency = 30 authenticate_qualify = no [ikebukuro] type = auth auth_type = userpass username = ikebukuro password = ikepass realm = asterisk [ikebukuro] type = endpoint context = intra-incoming disallow = all allow = ulaw rtp_symmetric = yes force_rport = yes rewrite_contact = yes direct_media = no send_pai = yes inband_progress = yes language = ja auth = ikebukuro outbound_auth = ikebukuro aors = ikebukuro