Asterisk 設定
/etc/asterisk/extensions.conf
[from-internal]
exten => 100,1,Answer()
same => n,Wait(1)
same => n,Playback(hello-world)
same => n,Hangup()
exten => 201,1,Dial(PJSIP/201)
exten => 201,2,Hangup()
exten => _*.,1,NoOp
exten => _*.,n,Dial(PJSIP/{EXTEN:1}@hikari-trunk,120,T)
exten => _*.,n,Hangup()
exten => _0.,1,NoOp
exten => _0.,n,Set(CALLERID(num)=${MYNUMBER})
exten => _0.,n,SET(CALLERID(num)=${MYNUMBER})
exten => _0.,n,Dial(PJSIP/${EXTEN:1}@hikari-trunk)
exten => 9911,1,Answer()
exten => 9911,n,Background(thankyou)
exten => 9911,n,WaitExten(20)
exten => 32,1,AGI(agi-test.honban.agi, ${EXTEN})
[from-hikari]
exten => s,1,Answer()
exten => s,n,Background(hello-world)
exten => s,n,WaitExten(20)
exten => 7,1,AGI(agi-test.honban.agi, ${EXTEN})
/etc/asterisk/pjsip.conf
[transport-udp]
type = transport
protocol = udp
bind = 192.168.1.1:5060
[acl]
type=acl
permit=0.0.0.0/0.0.0.0
[201]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=201
aors=201
rewrite_contact = yes
[201]
type=auth
auth_type=userpass
password=xxxxxxxxx
username=201
[201]
type=aor
max_contacts=10
[hikari-denwa]
type=registration
transport=transport-udp
outbound_auth=hikari-trunk
server_uri=sip:192.168.1.1
client_uri=sip:100@192.168.1.1
retry_interval=60
[hikari-trunk]
type=auth
auth_type=userpass
password=xxxxxxxxx
username=5
[hikari-trunk]
type=aor
contact=sip:192.168.1.1
[hikari-trunk]
type=endpoint
transport=transport-udp
context=from-hikari ;着信コンテキスト
disallow=all
allow=ulaw
outbound_auth=hikari-trunk
aors=hikari-trunk
direct_media=no
from_user=5
from_domain=192.168.1.1
dtmf_mode=inband
[hikari-trunk]
type=identify
endpoint=hikari-trunk
match=192.168.1.1
/etc/asterisk/extensions.conf
/etc/asterisk/pjsip.conf
systemctl restart asterisk
asterisk -vvvvvvvcr