День Добрый, бьюсь над записью входящих звонков в очереди вызова. По логике входящий звонок приходит с транка на атс, далее он попадает в очередь где уже и кидается на снявшего трубку. По логам номер входящего есть но в макрос записи он не попадает.
ЛОГ:
Connected to Asterisk 15.4.1 currently running on ats (pid = 5205)
== Using SIP RTP CoS mark 5
> 0x7ffa54012540 -- Strict RTP learning after remote address set to: [ip внешней АТС]:16322
-- Executing [транк]@call-in:1] Queue("SIP/[транк]-00000000", "test,r,,tTM(crm^[Здесь виден номер входящего звонка]^[транк])") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/101
== Using SIP RTP CoS mark 5
-- Called SIP/102
-- SIP/102-00000002 is ringing
> 0x7ffa6004bad0 -- Strict RTP learning after remote address set to: 192.168.1.8:7078
-- SIP/102-00000002 answered SIP/[транк]-00000000
-- Executing [s@macro-crm:1] NoOp("SIP/102-00000002", " ") in new stack
-- Executing [s@macro-crm:2] GotoIf("SIP/102-00000002", "0?gtme") in new stack
-- Executing [s@macro-crm:3] GotoIf("SIP/102-00000002", "0?gtme") in new stack
-- Executing [s@macro-crm:4] Set("SIP/102-00000002", "F=/var/spool/asterisk/calls/201807/20180724/20180724134938--") in new stack
-- Executing [s@macro-crm:5] MixMonitor("SIP/102-00000002", "/var/spool/asterisk/calls/201807/20180724/20180724134938--.wav,W(1),lame -b 16 /var/spool/asterisk/calls/201807/20180724/20180724134938--.wav /var/spool/asterisk/calls/201807/20180724/20180724134938--.mp3 && rm /var/spool/asterisk/calls/201807/20180724/20180724134938--.wav") in new stack
-- Executing [s@macro-crm:6] MacroExit("SIP/102-00000002", "") in new stack
== Begin MixMonitor Recording SIP/102-00000002
-- Channel SIP/102-00000002 joined 'simple_bridge' basic-bridge <e2e0ac05-bd7a-4da4-a218-c03deda39db1>
-- Channel SIP/[транк]-00000000 joined 'simple_bridge' basic-bridge <e2e0ac05-bd7a-4da4-a218-c03deda39db1>
> 0x7ffa6004bad0 -- Strict RTP switching to RTP target address 192.168.1.8:7078 as source
> 0x7ffa54012540 -- Strict RTP switching to RTP target address [ip внешней АТС]:16322 as source
> 0x7ffa54012540 -- Strict RTP learning complete - Locking on source address [ip внешней АТС]:16322
> 0x7ffa6004bad0 -- Strict RTP learning complete - Locking on source address 192.168.1.8:7078
-- Channel SIP/102-00000002 left 'simple_bridge' basic-bridge <e2e0ac05-bd7a-4da4-a218-c03deda39db1>
-- Channel SIP/[транк]-00000000 left 'simple_bridge' basic-bridge <e2e0ac05-bd7a-4da4-a218-c03deda39db1>
== MixMonitor close filestream (mixed)
== Executing [lame -b 16 /var/spool/asterisk/calls/201807/20180724/20180724134938--.wav /var/spool/asterisk/calls/201807/20180724/20180724134938--.mp3 && rm /var/spool/asterisk/calls/201807/20180724/20180724134938--.wav]
== Spawn extension (call-in, [транк], 1) exited non-zero on 'SIP/[транк]-00000000'
== End MixMonitor Recording SIP/102-00000002
[Jul 24 13:50:04] WARNING[5275]: chan_sip.c:4072 retrans_pkt: Retransmission timeout reached on transmission 1c02be1814c08cee6611b1b26e28a2ce@192.168.30.2:5060 for seqno 102 (Critical Request) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32000ms with no response
Конфиг extensions.conf
[general]
static=yes
writeprotect=no
[globals]
RECORDING=1
DIR_RECORDS=/var/spool/asterisk/calls/
[default]
;Вешаем трубку
[handup-sip]
exten => _X!,1,HangUp()
;Исходящие звонки
[call-out]
;Звонок на внутренний номер
include => handup-sip
include => outcalling
[outcalling]
;exten => _XXX,1,Set(fname=${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(number)}-${EXTEN})
;exten => _XXX,2,MixMonitor(/var/spool/asterisk/calls/${fname}.wav)
exten => _XXX,1,Dial(SIP/${EXTEN},,tTM(crm^${CALLERID(num)}^${EXTEN}))
exten => _XXX.,1,Dial(SIP/${EXTEN}@[транк]
switch => Realtime/outcalling@extensions
[call-in]
exten => [транк],1,Queue(test,r,,tTM(crm^${CALLERID(num)}^${EXTEN}))
[macro-crm]
exten => s,1,NoOp(${ARG1} ${ARG2})
exten => s,n,GotoIf(${DB_EXISTS(NORECNUM/${ARG1})}?gtme)
exten => s,n,GotoIf(${DB_EXISTS(NORECNUM/${ARG2})}?gtme)
exten => s,n,Set(F=/var/spool/asterisk/calls/${STRFTIME(${EPOCH},,%Y%m)}/${STRFTIME(${EPOCH},,%Y%m%d)}/${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${ARG1}-${ARG2})
exten => s,n,MixMonitor(${F}.wav,W(1),lame -b 16 ${F}.wav ${F}.mp3 && rm ${F}.wav)
exten => s,n(gtme),MacroExit