Executing [s@ivr-main:2] NoOp("SIP/Tele2_XXXXXXXXXXX", "s") in new stack
register => [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]
<--- SIP read from UDP:217.76.78.17:5060 --->
INVITE sip:*---SIPLOGIN---*@*---ATS_IP---*:*---ATS_PORT---* SIP/2.0
Via: SIP/2.0/UDP 217.76.78.17:5060;branch=z9hG4bK0t7FtJkchbT01219
Call-ID: asbcpbx-9btu6wdbkt9cwucyuw6d5c968jbb5cth@10.18.5.64
From: "+77770188219"<sip:+77770188219@pbx.tele2.kz>;tag=sbc0905PBX_LOGIC
To: "+77072501005"<sip:*---SIPLOGIN---*@pbx.tele2.kz>
CSeq: 1 INVITE
Contact: <sip:PBX_LOGIC@217.76.78.17:5060>
Max-Forwards: 70
Content-Length: 221
Content-Type: application/sdp
v=0
o=- 1563360810 1563360810 IN IP4 217.76.78.18
s=SBC call
t=0 0
m=audio 14678 RTP/AVP 0 8 101
c=IN IP4 217.76.78.18
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
--- (10 headers 10 lines) ---
Sending to 217.76.78.17:5060 (no NAT)
Sending to 217.76.78.17:5060 (no NAT)
Using INVITE request as basis request - asbcpbx-9btu6wdbkt9cwucyuw6d5c968jbb5cth@10.18.5.64
Found peer 'Tele2_77076420231' for '+77770188219' from 217.76.78.17:5060
== Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - (alaw|ulaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (alaw|ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 217.76.78.18:14678
Looking for *---SIPLOGIN---* in incoming (domain *---ATS_IP---*)
sip_route_dump: route/path hop: <sip:PBX_LOGIC@217.76.78.17:5060>
<--- Transmitting (NAT) to 217.76.78.17:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 217.76.78.17:5060;branch=z9hG4bK0t7FtJkchbT01219;received=217.76.78.17;rport=5060
From: "+77770188219"<sip:+77770188219@pbx.tele2.kz>;tag=sbc0905PBX_LOGIC
To: "+77072501005"<sip:*---SIPLOGIN---*@pbx.tele2.kz>
Call-ID: asbcpbx-9btu6wdbkt9cwucyuw6d5c968jbb5cth@10.18.5.64
CSeq: 1 INVITE
Server: Asterisk PBX 15.7.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:*---SIPLOGIN---*@*---ATS_IP---*:*---ATS_PORT---*>
Content-Length: 0
<------------>
-- Executing [*---SIPLOGIN---*@incoming:1] Goto("SIP/Tele2_77076420231-0000e742", "incoming-call,s,1") in new stack
-- Goto (incoming-call,s,1)
-- Executing [s@incoming-call:1] GotoIfTime("SIP/Tele2_77076420231-0000e742", "8:00-20:00,mon-fri,*,*?ivr-main,s,1") in new stack
-- Goto (ivr-main,s,1)
-- Executing [s@ivr-main:1] Answer("SIP/Tele2_77076420231-0000e742", "") in new stack
Audio is at 10490
Adding codec alaw to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
<--- Reliably Transmitting (NAT) to 217.76.78.17:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 217.76.78.17:5060;branch=z9hG4bK0t7FtJkchbT01219;received=217.76.78.17;rport=5060
From: "+77770188219"<sip:+77770188219@pbx.tele2.kz>;tag=sbc0905PBX_LOGIC
To: "+77072501005"<sip:*---SIPLOGIN---*@pbx.tele2.kz>;tag=as4e501857
Call-ID: asbcpbx-9btu6wdbkt9cwucyuw6d5c968jbb5cth@10.18.5.64
CSeq: 1 INVITE
Server: Asterisk PBX 15.7.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:*---SIPLOGIN---*@*---ATS_IP---*:*---ATS_PORT---*>
Content-Type: application/sdp
Content-Length: 267
v=0
o=root 1731612863 1731612863 IN IP4 *---ATS_IP---*
s=Asterisk PBX 15.7.1
c=IN IP4 *---ATS_IP---*
t=0 0
m=audio 10490 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv
<------------>
<--- SIP read from UDP:217.76.78.17:5060 --->
ACK sip:*---SIPLOGIN---*@*---ATS_IP---*:*---ATS_PORT---* SIP/2.0
Via: SIP/2.0/UDP 217.76.78.17:5060;branch=z9hG4bKJoWBZzlbYuT01220
Call-ID: asbcpbx-9btu6wdbkt9cwucyuw6d5c968jbb5cth@10.18.5.64
From: "+77770188219"<sip:+77770188219@pbx.tele2.kz>;tag=sbc0905PBX_LOGIC
To: "+77072501005"<sip:*---SIPLOGIN---*@pbx.tele2.kz>;tag=as4e501857
CSeq: 1 ACK
Max-Forwards: 70
Content-Length: 0
<------------->
Входящие звонки
[incoming-call]
;Работают правила по времени
exten => s,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
exten => s,n, Playback(nonworkinghours)
exten => s,n, Goto(autoanswer,s,1)
;===---Контексты входящих звонков---===;
;===---Контексты IVR---===;
;IVRки
[ivr-main]
exten => s,1,Answer()
exten => s,2,Background(/var/lib/asterisk/sounds/ru/Welcome_Aster)
exten => s,3,WaitExten(2)
;Включаем запись
exten => _XXX,1,Macro(recording,${CALLERID(num)},${EXTEN})
exten => _5XXX,1,Dial(SIP/${EXTEN}@bit)
exten => _XXX,n,Dial(SIP/${EXTEN},0,m(default))
exten => _XXX,n,Set(dstNUM=${EXTEN})
;Проверяем статус пира, существует или нет
exten => _XXX,n,GotoIf($["${SIPPEER(${EXTEN},status)}" = ""]?num-not-exist,1)
;Проверяем статус пира, подключен или нет
exten => _XXX,n,GotoIf($["${SIPPEER(${EXTEN},status):0:2}" = "UN"]?num-not-connected,1)
;Проверяем канал на занятость
exten => _XXX,n,ChanIsAvail(SIP/${EXTEN},s)
;Выводим в лог значение функции ChanIsAvail, нужно только для отладки, можно удалить строку
;exten => _XXX,n,NoOp(=========== ChanIsAvail STATUS: ${AVAILSTATUS} ===========)
;Если функция возвращает 2 или 3, значит абонент занят
exten => _XXX,n,GoToIf($[${AVAILSTATUS} = 2]?num-BUSY,1)
exten => _XXX,n,GoToIf($[${AVAILSTATUS} = 3]?num-BUSY,1)
;Обрабатываем остальные статусы
exten => _XXX,n,Goto(num-${DIALSTATUS},1)
;Если номера не существует говорим "Ошибочный номер, попробуйте еще раз"
exten => num-not-exist,1,Wait(2)
exten => num-not-exist,n,Playback(invalid)
;Если номер не подключен, говорим "Набранный вами номер отключен, проверьте номер и повторите попытку
exten => num-not-connected,1,Wait(2)
exten => num-not-connected,n,Playback(ss-noservice)
;Если номер занят, говорим "Занято"
exten => num-BUSY,1,Wait(2)
exten => num-BUSY,n,Playback(vm-isonphone)
;Если еще по какой-то причине будет статус CHANUNAVAIL, говорим, что номер не доступен в данный момент
exten => num-CHANUNAVAIL,1,Wait(2)
exten => num-CHANUNAVAIL,n,Playback(vm-isunavail)
;Если в голосовом меню не выбрали внутренний номер, адресуем звонок секретарю
;Включаем запись
exten => t,1,Macro(recording,${CALLERID(num)},${EXTEN})
exten => t,n,Dial(SIP/458@bit)
;Отправка уведомления о пропущенном звонке
exten => р,n,HangUp()
[incoming-call]
;Работают правила по времени
exten => s,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,s,1)
exten => s,n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,s,1)
exten => s,n, Playback(nonworkinghours)
exten => s,n, Goto(autoanswer,s,1)
exten => _X.,1, GotoIfTime(8:00-20:00,mon-fri,*,*?ivr-main,${EXTEN},1)
same => n, GotoIfTime(8:00-17:00,sat,*,*?ivr-main,${EXTEN},1)
same => n, GotoIfTime(10:00-15:00,sun,*,*?ivr-main,${EXTEN},1)
same => n, Playback(nonworkinghours)
same => n, Goto(autoanswer,s,1)
[incoming_from_tele2]
exten => SIPLOGIN,1,Goto(incoming-call,${CUT(CUT(SIP_HEADER(TO),"<",1),+,2)1},1)
To: "+77072501005"<sip:SIPLOGIN@pbx.tele2.kz>;tag=as4fda6416