:> /etc/asterisk/extensions.conf
:> /etc/asterisk/sip.conf
- для ast13:> /etc/asterisk/pjsip.conf
- для ast22;;extensions.conf
[general]
autofallthrough=yes
[incoming]
exten => s,1,Wait(2)
same => n,Playback(beep)
same => n,Dial(SIP/101&SIP/102,20,r)
same => n,Hangup()
[phones]
exten => _1XX,1,Wait(2)
exten => _1XX,n,Playback(beep)
exten => _1XX,n,Dial(SIP/${EXTEN})
exten => _1XX,n,Hangup()
exten => 300,1,Wait(2)
same => n,Playback(tt-weasels)
same => n,Hangup()
exten => _[78]XXXXXXXXXX,1,Dial(SIP/myprovider/7${EXTEN:1})
;;sip.conf
[general]
register=>70001234599:specialist000@10.5.5.99 ;; заменить логин, пароль и ip сервера
language=ru
allowguest=no
autocreatepeer=no
alwaysauthreject=yes
[authentication]
auth=70001234599:specialist000@REGISTRAR ;; заменить логин и пароль
[myprovider]
type=peer
fromuser=70001234599 ;; заменить логин
defaultuser=70001234599 ;; заменить логин
secret=specialist000 ;; заменить пароль
host=10.5.5.99 ;; заменить адрес сервера
context=incoming
dtmfmode=rfc2833
insecure=invite,port
[local-phones](!)
type=friend
context=phones
host=dynamic
dtmfmode=auto
disallow=all
allow=alaw
allow=ulaw
[101](local-phones)
secret=specialist123
[102](local-phones)
secret=specialist123
;;extensions.conf
[general]
autofallthrough=yes
[incoming]
exten => s,1,Wait(2)
same => n,Playback(beep)
same => n,Dial(PJSIP/201&PJSIP/202,20,r)
same => n,Hangup()
[phones]
exten => _2XX,1,Wait(2)
exten => _2XX,n,Playback(beep)
exten => _2XX,n,Dial(PJSIP/${EXTEN})
exten => _2XX,n,Hangup()
exten => 300,1,Wait(2)
same => n,Playback(tt-monkeysintro)
same => n,Hangup()
exten => _[78]XXXXXXXXXX,1,Dial(PJSIP/7${EXTEN:1}@isp)
;;pjsip.conf
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:5060
[isp]
type=identify
endpoint=isp
match=<ip_isp>
[isp]
type=endpoint
transport=transport-udp
outbound_auth=isp
aors=isp
context=incoming
allow=!all,alaw,ulaw
from_user=70005432199
from_domain=<ip_asterisk>
[isp]
type=registration
transport=transport-udp
outbound_auth=isp
server_uri=sip:<ip_isp>
client_uri=sip:70005432199@<ip_asterisk>
retry_interval=60
[isp]
type=auth
auth_type=userpass
password=specialist000
username=70005432199
[isp]
type=aor
contact=sip:<ip_isp>:5060
[local-phones-endpoint](!)
transport=transport-udp
language=ru
type=endpoint
context=phones
allow=!all,alaw,ulaw
[local-phones-aor](!)
type = aor
max_contacts = 1
[local-phones-auth](!)
type = auth
auth_type = userpass
[201](local-phones-endpoint)
auth=201
aors=201
[201](local-phones-aor)
[201](local-phones-auth)
username = 201
password = specialist123
[202](local-phones-endpoint)
auth=202
aors=202
[202](local-phones-aor)
[202](local-phones-auth)
username = 202
password = specialist123
CLI> dialplan reload
CLI> sip reload
- для ast13CLI> pjsip reload
- для ast22