Перевод звонка - нет записи разговора

Обсуждаем, спрашиваем, помогаем в настройке VoIP

Перевод звонка - нет записи разговора

Сообщение dimondack » 21 май 2021, 20:03

Всем привет.

Вот уже второй раз мне говорят , что не могут найти запись разговора после перевода звонка.
Ситуация следующая

[May 20 16:42:10]
номер 220 звонит на мобильный 79280000000
они разговаривают
затем номер 220 переводит данное соединение на 211.

В результате имеем запись 220-79280000000 и запись 220 - 211(перед трансфером),
а вот записи 79280000000 - 211 нет.

У менеджера 220 телефон Yealink t-48 и перевод, скорее всего, был Attended Transfer.

https://forum.asterisk.ru/viewtopic.php?f=5&t=10146

Сделал анализ данной проблемы:

220 звонит на 79280000000

SIP/220-00000500 --->> SIP/rtk2-00000501

после ответа 79280000000

оба канала соединяются в бридж <fcc718a1-527e-42c8-a0ce-9ce605eb6781>

затем менеджер 220 ставит на удержание данное соединение

Started music on hold, class 'default', on channel 'SIP/rtk2-00000501'

и набирает 211, чтобы передать звонок

SIP/220-00000503 -->> SIP/211-00000504

211 отвечает

и оба канала соединяются в бридж <46cdc0f0-454e-4c52-a66b-8d979196eb1b>

220 'говорит' 211 о том что переводит на него клиента "79280000000"

и делает перевод

Stopped music on hold on SIP/rtk2-00000501

в результате

канал SIP/rtk2-00000501 покидает бридж <fcc718a1-527e-42c8-a0ce-9ce605eb6781>

затем происходит swapped
{
канал SIP/220-00000503 покидает бридж <46cdc0f0-454e-4c52-a66b-8d979196eb1b>

вместо SIP/220-00000503 ,

SIP/rtk2-00000501 присоединяется в бридж <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
}
после чего

в бридже <46cdc0f0-454e-4c52-a66b-8d979196eb1b>

остаются SIP/211-00000504 и SIP/rtk2-00000501

затем

SIP/220-00000500 покидает бридж <fcc718a1-527e-42c8-a0ce-9ce605eb6781>


после 3 х минут разговора

[May 20 16:46:10]
SIP/211-00000504 покидает бридж <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
SIP/rtk2-00000501 покидает бридж <46cdc0f0-454e-4c52-a66b-8d979196eb1b>


========_______________full________________===========================
Код: Выделить всё

[May 20 16:42:05] VERBOSE[32063][C-000002af] pbx.c: Executing [+79280000000@users:1] Set("SIP/220-00000500", "fname=20210520164205-220-+79280000000") in new stack
[May 20 16:42:05] VERBOSE[32063][C-000002af] pbx.c: Executing [+79280000000@users:2] MixMonitor("SIP/220-00000500", "/var/spool/asterisk/monitor/20210520164205-220-+79280000000.wav") in new stack
[May 20 16:42:05] VERBOSE[32063][C-000002af] pbx.c: Executing [+79280000000@users:3] Set("SIP/220-00000500", "recfile=/var/spool/asterisk/monitor/20210520164205-220-+79280000000.wav") in new stack
[May 20 16:42:05] VERBOSE[32064][C-000002af] app_mixmonitor.c: Begin MixMonitor Recording SIP/220-00000500
[May 20 16:42:05] VERBOSE[32063][C-000002af] pbx.c: Executing [+79280000000@users:4] Set("SIP/220-00000500", "CDR(recfile)=/var/spool/asterisk/monitor/20210520164205-220-+79280000000.wav") in new stack
[May 20 16:42:05] VERBOSE[32063][C-000002af] pbx.c: Executing [+79280000000@users:5] Dial("SIP/220-00000500", "SIP/rtk2/+79280000000,90,Tt") in new stack
[May 20 16:42:05] VERBOSE[32063][C-000002af] netsock2.c: Using SIP RTP CoS mark 5
[May 20 16:42:05] VERBOSE[32063][C-000002af] app_dial.c: Called SIP/rtk2/+79280000000
[May 20 16:42:07] VERBOSE[32063][C-000002af] app_dial.c: SIP/rtk2-00000501 is making progress passing it to SIP/220-00000500


[May 20 16:42:09] VERBOSE[32063][C-000002af] app_dial.c: SIP/rtk2-00000501 is ringing
[May 20 16:42:09] WARNING[32063][C-000002af] translate.c: no samples for alawtolin
[May 20 16:42:09] VERBOSE[32063][C-000002af] app_dial.c: SIP/rtk2-00000501 is ringing
[May 20 16:42:10] VERBOSE[32063][C-000002af] app_dial.c: SIP/rtk2-00000501 answered SIP/220-00000500


[May 20 16:42:10] VERBOSE[32070][C-000002af] bridge_channel.c: Channel SIP/rtk2-00000501 joined 'simple_bridge' basic-bridge <fcc718a1-527e-42c8-a0ce-9ce605eb6781>
[May 20 16:42:10] VERBOSE[32063][C-000002af] bridge_channel.c: Channel SIP/220-00000500 joined 'simple_bridge' basic-bridge <fcc718a1-527e-42c8-a0ce-9ce605eb6781>

[May 20 16:42:46] VERBOSE[32070][C-000002af] res_musiconhold.c: Started music on hold, class 'default', on channel 'SIP/rtk2-00000501'


[May 20 16:42:48] VERBOSE[26479][C-000002b1] netsock2.c: Using SIP RTP CoS mark 5
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:1] GosubIf("SIP/220-00000503", "0?blind_trans,211,1(,220)") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:2] GosubIf("SIP/220-00000503", "0?attend_trans,211,1(,220)") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:3] Set("SIP/220-00000503", "fname=20210520164248-220-211") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:4] MixMonitor("SIP/220-00000503", "/var/spool/asterisk/monitor/20210520164248-220-211.wav") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:5] Set("SIP/220-00000503", "recfile=/var/spool/asterisk/monitor/20210520164248-220-211.wav") in new stack
[May 20 16:42:48] VERBOSE[32072][C-000002b1] app_mixmonitor.c: Begin MixMonitor Recording SIP/220-00000503
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:6] Set("SIP/220-00000503", "CDR(recfile)=/var/spool/asterisk/monitor/20210520164248-220-211.wav") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] pbx.c: Executing [211@users:7] Dial("SIP/220-00000503", "SIP/211,20,Tt") in new stack
[May 20 16:42:48] VERBOSE[32071][C-000002b1] netsock2.c: Using SIP RTP CoS mark 5
[May 20 16:42:48] VERBOSE[32071][C-000002b1] app_dial.c: Called SIP/211
[May 20 16:42:48] VERBOSE[32071][C-000002b1] app_dial.c: SIP/211-00000504 is ringing


[May 20 16:42:54] VERBOSE[32071][C-000002b1] app_dial.c: SIP/211-00000504 answered SIP/220-00000503
[May 20 16:42:54] VERBOSE[32080][C-000002b1] bridge_channel.c: Channel SIP/211-00000504 joined 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
[May 20 16:42:54] VERBOSE[32071][C-000002b1] bridge_channel.c: Channel SIP/220-00000503 joined 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>

[May 20 16:43:01] VERBOSE[32070][C-000002af] res_musiconhold.c: Stopped music on hold on SIP/rtk2-00000501
[May 20 16:43:01] VERBOSE[26479][C-000002af] bridge_channel.c: Channel SIP/rtk2-00000501 left 'simple_bridge' basic-bridge <fcc718a1-527e-42c8-a0ce-9ce605eb6781>
[May 20 16:43:01] VERBOSE[26479][C-000002af] bridge_channel.c: Channel SIP/220-00000503 left 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
[May 20 16:43:01] VERBOSE[26479][C-000002af] bridge_channel.c: Channel SIP/rtk2-00000501 swapped with SIP/220-00000503 into 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
[May 20 16:43:01] VERBOSE[32063][C-000002af] bridge_channel.c: Channel SIP/220-00000500 left 'simple_bridge' basic-bridge <fcc718a1-527e-42c8-a0ce-9ce605eb6781>
[May 20 16:43:01] VERBOSE[32071][C-000002b1] pbx.c: Spawn extension (users, 211, 7) exited non-zero on 'SIP/220-00000503'
[May 20 16:43:01] VERBOSE[32071][C-000002b1] pbx.c: Executing [h@users:1] NoOp("SIP/220-00000503", "************This is HangUp************") in new stack
[May 20 16:43:01] VERBOSE[32063][C-000002af] pbx.c: Spawn extension (users, +79280000000, 5) exited non-zero on 'SIP/220-00000500'
[May 20 16:43:01] VERBOSE[32071][C-000002b1] pbx.c: Executing [h@users:2] NoOp("SIP/220-00000503", "*********filename=20210520164248-220-211************") in new stack
[May 20 16:43:01] VERBOSE[32063][C-000002af] pbx.c: Executing [h@users:1] NoOp("SIP/220-00000500", "************This is HangUp************") in new stack
[May 20 16:43:01] VERBOSE[32063][C-000002af] pbx.c: Executing [h@users:2] NoOp("SIP/220-00000500", "*********filename=20210520164205-220-+79280000000************") in new stack
[May 20 16:43:01] VERBOSE[32063][C-000002af] pbx.c: Executing [h@users:3] Hangup("SIP/220-00000500", "") in new stack
[May 20 16:43:01] VERBOSE[32063][C-000002af] pbx.c: Spawn extension (users, h, 3) exited non-zero on 'SIP/220-00000500'
[May 20 16:43:01] VERBOSE[32071][C-000002b1] pbx.c: Executing [h@users:3] Hangup("SIP/220-00000503", "") in new stack
[May 20 16:43:01] VERBOSE[32071][C-000002b1] pbx.c: Spawn extension (users, h, 3) exited non-zero on 'SIP/220-00000503'
[May 20 16:43:01] VERBOSE[32064][C-000002af] app_mixmonitor.c: MixMonitor close filestream (mixed)
[May 20 16:43:01] VERBOSE[32064][C-000002af] app_mixmonitor.c: End MixMonitor Recording SIP/220-00000500
[May 20 16:43:01] VERBOSE[32072][C-000002b1] app_mixmonitor.c: MixMonitor close filestream (mixed)
[May 20 16:43:01] VERBOSE[32072][C-000002b1] app_mixmonitor.c: End MixMonitor Recording SIP/220-00000503


[May 20 16:46:10] VERBOSE[32080][C-000002b1] bridge_channel.c: Channel SIP/211-00000504 left 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>
[May 20 16:46:10] VERBOSE[32070][C-000002af] bridge_channel.c: Channel SIP/rtk2-00000501 left 'simple_bridge' basic-bridge <46cdc0f0-454e-4c52-a66b-8d979196eb1b>


[May 20 16:46:50] VERBOSE[26479][C-000002b4] netsock2.c: Using SIP RTP CoS mark 5



========_______________CEL________________===========================
Код: Выделить всё
"CHAN_START","2021-05-20 16:42:05","Диспетчер","220","","","","+79280000000","users","SIP/220-00000500","","","3","","1621518125.10990","1621518125.10990","","","",""
"CHAN_START","2021-05-20 16:42:05","","","","","","s","rtk","SIP/rtk2-00000501","","","3","","1621518125.10992","1621518125.10990","","","",""

"ANSWER","2021-05-20 16:42:10","","+79280000000","","","","+79280000000","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","",""
"ANSWER","2021-05-20 16:42:10","Диспетчер","220","220","","+79280000000","+79280000000","users","SIP/220-00000500","Dial","SIP/rtk2/+79280000000,90,Tt","3","","1621518125.10990","1621518125.10990","","","",""
"BRIDGE_ENTER","2021-05-20 16:42:10","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","","{""bridge_id"":""fcc718a1-527e-42c8-a0ce-9ce605eb6781"",""bridge_technology"":""simple_bridge""}"
"BRIDGE_ENTER","2021-05-20 16:42:10","Диспетчер","220","220","","+79280000000","+79280000000","users","SIP/220-00000500","Dial","SIP/rtk2/+79280000000,90,Tt","3","","1621518125.10990","1621518125.10990","SIP/rtk2-00000501","","","{""bridge_id"":""fcc718a1-527e-42c8-a0ce-9ce605eb6781"",""bridge_technology"":""simple_bridge""}"

"CHAN_START","2021-05-20 16:42:48","Диспетчер","220","","","","211","users","SIP/220-00000503","","","3","","1621518168.11005","1621518168.11005","","","",""
"CHAN_START","2021-05-20 16:42:48","Ролики","211","","","","s","vip_333","SIP/211-00000504","","","3","","1621518168.11007","1621518168.11005","","","",""

"ANSWER","2021-05-20 16:42:54","Ролики","211","211","","","211","vip_333","SIP/211-00000504","AppDial","(Outgoing Line)","3","","1621518168.11007","1621518168.11005","","","",""
"ANSWER","2021-05-20 16:42:54","Диспетчер","220","220","","211","211","users","SIP/220-00000503","Dial","SIP/211,20,Tt","3","","1621518168.11005","1621518168.11005","","","",""
"BRIDGE_ENTER","2021-05-20 16:42:54","Ролики","211","211","","","","vip_333","SIP/211-00000504","AppDial","(Outgoing Line)","3","","1621518168.11007","1621518168.11005","","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"
"BRIDGE_ENTER","2021-05-20 16:42:54","Диспетчер","220","220","","211","211","users","SIP/220-00000503","Dial","SIP/211,20,Tt","3","","1621518168.11005","1621518168.11005","SIP/211-00000504","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"

"BRIDGE_EXIT","2021-05-20 16:43:01","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","SIP/220-00000500","","","{""bridge_id"":""fcc718a1-527e-42c8-a0ce-9ce605eb6781"",""bridge_technology"":""simple_bridge""}"
"BRIDGE_EXIT","2021-05-20 16:43:01","Диспетчер","220","220","","211","211","users","SIP/220-00000503","Dial","SIP/211,20,Tt","3","","1621518168.11005","1621518168.11005","SIP/211-00000504","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"
"BRIDGE_ENTER","2021-05-20 16:43:01","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","SIP/211-00000504","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"
"ATTENDEDTRANSFER","2021-05-20 16:43:01","Диспетчер","220","220","","+79280000000","+79280000000","users","SIP/220-00000500","Dial","SIP/rtk2/+79280000000,90,Tt","3","","1621518125.10990","1621518125.10990","","","","{""bridge1_id"":""fcc718a1-527e-42c8-a0ce-9ce605eb6781"",""channel2_name"":""SIP/220-00000503"",""channel2_uniqueid"":""1621518168.11005"",""bridge2_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""transferee_channel_name"":""SIP/rtk2-00000501"",""transferee_channel_uniqueid"":""1621518125.10992"",""transfer_target_channel_name"":""SIP/211-00000504"",""transfer_target_channel_uniqueid"":""1621518168.11007""}"
"BRIDGE_EXIT","2021-05-20 16:43:01","Диспетчер","220","220","","+79280000000","+79280000000","users","SIP/220-00000500","Dial","SIP/rtk2/+79280000000,90,Tt","3","","1621518125.10990","1621518125.10990","","","","{""bridge_id"":""fcc718a1-527e-42c8-a0ce-9ce605eb6781"",""bridge_technology"":""simple_bridge""}"
"HANGUP","2021-05-20 16:43:01","Диспетчер","220","220","","+79280000000","h","users","SIP/220-00000500","","","3","","1621518125.10990","1621518125.10990","","","","{""hangupcause"":16,""hangupsource"":""dialplan/builtin"",""dialstatus"":""ANSWER""}"
"CHAN_END","2021-05-20 16:43:01","Диспетчер","220","220","","+79280000000","h","users","SIP/220-00000500","","","3","","1621518125.10990","1621518125.10990","","","",""
"HANGUP","2021-05-20 16:43:01","Диспетчер","220","220","","211","h","users","SIP/220-00000503","","","3","","1621518168.11005","1621518168.11005","","","","{""hangupcause"":16,""hangupsource"":""dialplan/builtin"",""dialstatus"":""ANSWER""}"
"CHAN_END","2021-05-20 16:43:01","Диспетчер","220","220","","211","h","users","SIP/220-00000503","","","3","","1621518168.11005","1621518168.11005","","","",""
"LINKEDID_END","2021-05-20 16:43:01","Диспетчер","220","220","","211","h","users","SIP/220-00000503","","","3","","1621518168.11005","1621518168.11005","","","",""



"BRIDGE_EXIT","2021-05-20 16:46:10","Ролики","211","211","","","","vip_333","SIP/211-00000504","AppDial","(Outgoing Line)","3","","1621518168.11007","1621518125.10990","SIP/rtk2-00000501","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"
"BRIDGE_EXIT","2021-05-20 16:46:10","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","","{""bridge_id"":""46cdc0f0-454e-4c52-a66b-8d979196eb1b"",""bridge_technology"":""simple_bridge""}"
"HANGUP","2021-05-20 16:46:10","Ролики","211","211","","","","vip_333","SIP/211-00000504","AppDial","(Outgoing Line)","3","","1621518168.11007","1621518125.10990","","","","{""hangupcause"":16,""hangupsource"":""SIP/211-00000504"",""dialstatus"":""""}"
"CHAN_END","2021-05-20 16:46:10","Ролики","211","211","","","","vip_333","SIP/211-00000504","AppDial","(Outgoing Line)","3","","1621518168.11007","1621518125.10990","","","",""
"HANGUP","2021-05-20 16:46:10","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","","{""hangupcause"":16,""hangupsource"":""SIP/211-00000504"",""dialstatus"":""""}"
"CHAN_END","2021-05-20 16:46:10","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","",""
"LINKEDID_END","2021-05-20 16:46:10","","+79280000000","","","","","rtk","SIP/rtk2-00000501","AppDial","(Outgoing Line)","3","","1621518125.10992","1621518125.10990","","","",""





Пытаюсь уговорить использовать для перевода звонков

*2
#1

и тогда все записи на месте

Код: Выделить всё
Connected to Asterisk 15.4.1 currently running on host-197 (pid = 2709)
host-197*CLI> features show
Builtin Feature           Default Current
---------------           ------- -------
Pickup                    *8      *8
Blind Transfer            #       #1
Attended Transfer                 *2
One Touch Monitor                 *1
Disconnect Call           *       *0
Park Call                         #72
One Touch MixMonitor              *3

Dynamic Feature           Default Current
---------------           ------- -------
(none)

Feature Groups:



Скорее всего менеджер делает трансфер из меню телефона , сам аппарат Т-48 делает подмену канала, т.е. инициатор нового соединения является телефон Т-48 ,
а для астериск все соединения завершены и новых соединений нет...


Сделал попытку ловить трансферы , которые совершаются средствами телефона


Код: Выделить всё
;на переменную ${CDPN}  , пока не обращаем  внимание...... она пуста
[local_call]
exten => _2[0-3]X,1,GosubIf($["${BLINDTRANSFER}" !=""]?blind_trans,${EXTEN},1(${CDPN},${CALLERID(number)}))
exten => _2[0-3]X,n,GosubIf($["${ATTENDEDTRANSFER}" !=""]?attend_trans,${EXTEN},1(${CDPN},${CALLERID(number)}))
......
......


[blind_trans]
exten => _2[0-3]X,1,Set(fname=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${CALLERID(number)}-bt-${EXTEN})
exten => _2[0-3]X,n,MixMonitor(/var/spool/asterisk/monitor/${fname}.wav)
exten => _2[0-3]X,n,Set(recfile=/var/spool/asterisk/monitor/${fname}.wav)
exten => _2[0-3]X,n,Set(CDR(recfile)=${recfile})
exten => _2[0-3]X,n,Dial(SIP/${EXTEN},45,Tt)
exten => _2[0-3]X,n,GotoIf($["${DIALSTATUS}" !="ANSWER"]?vl:false)
exten => _2[0-3]X,n(vl),Macro(vm_x,${EXTEN},v_mail)
exten => _2[0-3]X,n(false),Hangup()
exten => _2[0-3]X,n,Hangup()


[attend_trans]
;здесь  тож не идеально
exten => _2[0-3]X,1,GotoIf($["${ARG1}" =""]?m1:m451)
exten => _2[0-3]X,n(m1),Set(ARG1=${ARG2})
exten => _2[0-3]X,n(m451),Set(fname=${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}-${ARG1}-at-${EXTEN})
exten => _2[0-3]X,n,MixMonitor(/var/spool/asterisk/monitor/${fname}.wav)
exten => _2[0-3]X,n,Set(recfile=/var/spool/asterisk/monitor/${fname}.wav)
exten => _2[0-3]X,n,Set(CDR(recfile)=${recfile})
exten => _2[0-3]X,n,Dial(SIP/${EXTEN},45,Tt)
exten => _2[0-3]X,n,GotoIf($["${DIALSTATUS}" !="ANSWER"]?vl:false)
exten => _2[0-3]X,n(vl),Macro(vm_x,${EXTEN},v_mail)
exten => _2[0-3]X,n(false),Hangup()
exten => _2[0-3]X,n,Hangup()



Даже учитывая все мои огрехи...

Ситуация такая:
переводы звонков средствами телефона

[attend_trans] - не ловится,
а
[blind_trans] - ловится

Вопрос:
есть ли шансы поймать Attended Transfer , сделанный средствами телефона
Нас определяет то, что мы делаем.
Аватара пользователя
dimondack
посетитель
 
Сообщения: 104
Зарегистрирован: 21 янв 2015, 13:00

Re: Перевод звонка - нет записи разговора

Сообщение dimondack » 22 май 2021, 11:37

Хорошая мысль приходит с утра
https://forum.asterisk.ru/viewtopic.php?f=5&t=6928
Нас определяет то, что мы делаем.
Аватара пользователя
dimondack
посетитель
 
Сообщения: 104
Зарегистрирован: 21 янв 2015, 13:00

Re: Перевод звонка - нет записи разговора

Сообщение dimondack » 17 июн 2021, 21:40

https://www.npmjs.com/package/asterisk-ami-client

Код: Выделить всё
{
  Event: 'AttendedTransfer',
  Privilege: 'call,all',
  Result: 'Success',
  OrigTransfererChannel: 'SIP/1746-0000001a',
  OrigTransfererChannelState: '6',
  OrigTransfererChannelStateDesc: 'Up',
  OrigTransfererCallerIDNum: '1746',
  OrigTransfererCallerIDName: '1746',
  OrigTransfererConnectedLineNum: '1748',
  OrigTransfererConnectedLineName: 'Yealink',
  OrigTransfererLanguage: 'ru',
  OrigTransfererAccountCode: '',
  OrigTransfererContext: 'users',
  OrigTransfererExten: '1748',
  OrigTransfererPriority: '10',
  OrigTransfererUniqueid: '1623939965.204',
  OrigTransfererLinkedid: '1623939965.204',
  OrigBridgeUniqueid: 'ae0813c0-25b2-4b8d-8adf-f55c00ac30c2',
  OrigBridgeType: 'basic',
  OrigBridgeTechnology: 'simple_bridge',
  OrigBridgeCreator: '<unknown>',
  OrigBridgeName: '<unknown>',
  OrigBridgeNumChannels: '2',
  OrigBridgeVideoSourceMode: 'none',
  SecondTransfererChannel: 'SIP/1746-00000018',
  SecondTransfererChannelState: '6',
  SecondTransfererChannelStateDesc: 'Up',
  SecondTransfererCallerIDNum: '1746',
  SecondTransfererCallerIDName: '1746',
  SecondTransfererConnectedLineNum: '1747',
  SecondTransfererConnectedLineName: 'Yealink',
  SecondTransfererLanguage: 'ru',
  SecondTransfererAccountCode: '',
  SecondTransfererContext: 'users',
  SecondTransfererExten: '1747',
  SecondTransfererPriority: '10',
  SecondTransfererUniqueid: '1623939957.196',
  SecondTransfererLinkedid: '1623939957.196',
  SecondBridgeUniqueid: '4c561be7-80e1-4acb-9489-94c5ea3f7565',
  SecondBridgeType: 'basic',
  SecondBridgeTechnology: 'simple_bridge',
  SecondBridgeCreator: '<unknown>',
  SecondBridgeName: '<unknown>',
  SecondBridgeNumChannels: '2',
  SecondBridgeVideoSourceMode: 'none',
  TransfereeChannel: 'SIP/1748-0000001b',
  TransfereeChannelState: '6',
  TransfereeChannelStateDesc: 'Up',
  TransfereeCallerIDNum: '1748',
  TransfereeCallerIDName: 'Yealink',
  TransfereeConnectedLineNum: '1746',
  TransfereeConnectedLineName: '1746',
  TransfereeLanguage: 'ru',
  TransfereeAccountCode: '',
  TransfereeContext: 'users',
  TransfereeExten: '',
  TransfereePriority: '1',
  TransfereeUniqueid: '1623939965.206',
  TransfereeLinkedid: '1623939965.204',
  TransferTargetChannel: 'SIP/1747-00000019',
  TransferTargetChannelState: '6',
  TransferTargetChannelStateDesc: 'Up',
  TransferTargetCallerIDNum: '1747',
  TransferTargetCallerIDName: 'Yealink',
  TransferTargetConnectedLineNum: '1746',
  TransferTargetConnectedLineName: '1746',
  TransferTargetLanguage: 'ru',
  TransferTargetAccountCode: '',
  TransferTargetContext: 'users',
  TransferTargetExten: '',
  TransferTargetPriority: '1',
  TransferTargetUniqueid: '1623939957.198',
  TransferTargetLinkedid: '1623939957.196',
  IsExternal: 'No',
  DestType: 'Bridge',
  DestBridgeUniqueid: '4c561be7-80e1-4acb-9489-94c5ea3f7565'
}

- Channel SIP/1747-00000019 left 'simple_bridge' basic-bridge <4c561be7-80e1-4acb-9489-94c5ea3f7565>
- Channel SIP/1748-0000001b left 'simple_bridge' basic-bridge <4c561be7-80e1-4acb-9489-94c5ea3f7565>



Код: Выделить всё
const AmiClient = require('asterisk-ami-client');
const dateFormat = require('dateformat')
const fs = require('fs')

 
let client = new AmiClient({
    reconnect: true,
    keepAlive: true,
    emitEventsByTypes: true,
    emitResponsesById: true
});
 
client.connect('admin', '123', {host: 'localhost', port: 5038})
    .then(() => {
        client
/*
            .on('Dial', event => console.log(event))
            .on('Hangup', event => console.log(event))
            .on('Hold', event => console.log(event))
            .on('Bridge', event => console.log(event))
       .on('VarSet', event => console.log(event))
*/
           
            .on('AttendedTransfer', event => ev(event)  )
/*
            .on('resp_123', response => {
                console.log(response);
                client.disconnect();
            })
*/
//            .on('internalError', error => console.log(error));
              .on('internalError', error => logger('internalError',error));
             
        client.action({
            Action: 'Ping',
            ActionID: 123
        });
    })
//    .catch(error => console.log(error));
      .catch(error => logger('catch',error));

function ev(ev){

console.log(ev)

let transfer_to_num = ev.TransfereeCallerIDNum
let client_num = ev.TransferTargetCallerIDNum
let dt = dateFormat(new Date(), "yyyymmddHHMMss")

let fn_from = dt + '-' + client_num + '-' + 'at_in'
let fn_to = dt + '-' + transfer_to_num  + '-' + 'at_out'

    client.action({
            Action: 'Monitor',
            ActionID: 777555,
            Channel: ev.TransfereeChannel,
            File: fn_to,
            Mix: 1
        });

    client.action({
            Action: 'Monitor',
            ActionID: 777556,
            Channel: ev.TransferTargetChannel,
            File: fn_from,
            Mix: 1
        });

}



function logger(type,log){
let dt = dateFormat( new Date(), "yyyy-mm-dd HH:MM:ss" )
//console.log(lctx)
let str  = dt + "  " + type 
let str2 = dt + "  " + log
//lctx.from.username + " " + 'cmd:' +
//lctx.message.text + ' | ' + authorizate +  '\n'

fs.appendFileSync("logger.log",str)
fs.appendFileSync("logger.log",str2)
}
Нас определяет то, что мы делаем.
Аватара пользователя
dimondack
посетитель
 
Сообщения: 104
Зарегистрирован: 21 янв 2015, 13:00


Вернуться в Настройка VoIP железа

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3

cron