094651370ca92d1bc0b8d33f82d67af121c0a802
[motion2.git] / server / services / xdr / queues.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x4be0=['transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','queuecallerexitreason','getVoiceQueueByName','then','type','request','transfereduniqueid','queuecallerjoin','format','position','error','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','variable','toUpperCase','CONTINUE','queuecallerabandon','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','extension','transferuniqueid','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER'];(function(_0x11c6d6,_0x4bb0b2){var _0x17c6ed=function(_0x4735c1){while(--_0x4735c1){_0x11c6d6['push'](_0x11c6d6['shift']());}};_0x17c6ed(++_0x4bb0b2);}(_0x4be0,0x137));var _0x04be=function(_0xfe9f69,_0x4c4e1a){_0xfe9f69=_0xfe9f69-0x0;var _0x3366ad=_0x4be0[_0xfe9f69];return _0x3366ad;};'use strict';var _=require(_0x04be('0x0'));var util=require(_0x04be('0x1'));var utils=require(_0x04be('0x2'));var queues={};function writeDB(_0x14bb71){utils[_0x04be('0x3')](util['format'](_0x04be('0x4'),_0x14bb71[_0x04be('0x5')],_0x14bb71[_0x04be('0x6')],_0x14bb71[_0x04be('0x7')],_0x14bb71[_0x04be('0x8')],_0x14bb71['calleridnum'],_0x14bb71['accountcode'],_0x14bb71[_0x04be('0x9')]));if(_0x14bb71[_0x04be('0x7')]){utils[_0x04be('0xa')](_0x14bb71[_0x04be('0x7')])[_0x04be('0xb')](function(_0x460aca){if(_0x460aca){_0x14bb71[_0x04be('0xc')]=_0x460aca[_0x04be('0xc')];}utils[_0x04be('0xd')]('CreateVoiceQueueReport',_0x14bb71);});}else{utils[_0x04be('0xd')]('CreateVoiceQueueReport',_0x14bb71);}if(_0x14bb71[_0x04be('0xe')]){delete queues[_0x14bb71[_0x04be('0xe')]];}else{delete queues[_0x14bb71[_0x04be('0x5')]];}}exports[_0x04be('0xf')]=function(_0x1952fa){try{utils['debug'](util[_0x04be('0x10')]('[%s][queues][queuecallerjoin]',_0x1952fa[_0x04be('0x5')]),_0x1952fa);utils[_0x04be('0x3')](util[_0x04be('0x10')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x1952fa[_0x04be('0x5')],_0x1952fa[_0x04be('0x7')],_0x1952fa[_0x04be('0x11')]));queues[_0x1952fa[_0x04be('0x5')]]=_['assign'](_0x1952fa,{'originalposition':_0x1952fa[_0x04be('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x55c0ff){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x13'),_0x1952fa[_0x04be('0x5')]),_0x55c0ff);}};exports[_0x04be('0x14')]=function(_0x268eca){try{if(!_[_0x04be('0x15')](queues[_0x268eca[_0x04be('0x5')]])){utils['debug'](util[_0x04be('0x10')]('[%s][queues][hangup]',_0x268eca[_0x04be('0x5')]),_0x268eca);if(queues[_0x268eca[_0x04be('0x5')]][_0x04be('0x16')]){if(!queues[_0x268eca[_0x04be('0x5')]]['queuecallerabandon']&&!queues[_0x268eca[_0x04be('0x5')]][_0x04be('0x17')]){queues[_0x268eca[_0x04be('0x5')]][_0x04be('0x18')]=!![];queues[_0x268eca[_0x04be('0x5')]]['queuecallercompleteAt']=utils[_0x04be('0x19')]();queues[_0x268eca[_0x04be('0x5')]]['queuecallerexitreason']=_0x04be('0x1a');}utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x1b'),_0x268eca['uniqueid'],queues[_0x268eca['uniqueid']][_0x04be('0x1c')],queues[_0x268eca[_0x04be('0x5')]][_0x04be('0x9')]));writeDB(queues[_0x268eca[_0x04be('0x5')]]);}else if(queues[_0x268eca[_0x04be('0x5')]][_0x04be('0xe')]){utils[_0x04be('0x3')](util['format'](_0x04be('0x1d'),_0x268eca['uniqueid'],queues[_0x268eca[_0x04be('0x5')]][_0x04be('0x1c')],queues[_0x268eca[_0x04be('0x5')]][_0x04be('0xe')]));queues[queues[_0x268eca[_0x04be('0x5')]][_0x04be('0xe')]]=queues[_0x268eca[_0x04be('0x5')]];queues[queues[_0x268eca['uniqueid']][_0x04be('0xe')]][_0x04be('0x1e')]=0x2;delete queues[_0x268eca['uniqueid']];}}}catch(_0xf157fd){utils['error'](util[_0x04be('0x10')]('[%s][queues][hangup]',_0x268eca[_0x04be('0x5')]),_0xf157fd);}};exports[_0x04be('0x1f')]=function(_0x3e40ab){try{utils[_0x04be('0x20')](util['format'](_0x04be('0x21'),_0x3e40ab[_0x04be('0x5')]),_0x3e40ab);if(!_[_0x04be('0x15')](_0x3e40ab[_0x04be('0x22')]['queuestatus'])&&_0x3e40ab['value'][_0x04be('0x23')]()!==_0x04be('0x24')){if(!_[_0x04be('0x15')](queues[_0x3e40ab['uniqueid']])){queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x25')]=![];queues[_0x3e40ab[_0x04be('0x5')]]['queuecallerabandonAt']=null;queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x17')]=!![];queues[_0x3e40ab['uniqueid']][_0x04be('0x26')]=utils[_0x04be('0x19')]();queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x9')]=_0x3e40ab[_0x04be('0x27')][_0x04be('0x23')]();utils[_0x04be('0x3')](util['format'](_0x04be('0x28'),_0x3e40ab[_0x04be('0x5')],queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x1c')],_0x3e40ab['value'],queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x9')]));writeDB(queues[_0x3e40ab[_0x04be('0x5')]]);}}else if(!_[_0x04be('0x15')](_0x3e40ab[_0x04be('0x22')]['queueposition'])){if(!_[_0x04be('0x15')](queues[_0x3e40ab[_0x04be('0x5')]])&&!queues[_0x3e40ab['uniqueid']][_0x04be('0x25')]){queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x25')]=![];queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x29')]=null;queues[_0x3e40ab['uniqueid']][_0x04be('0x17')]=!![];queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x26')]=utils['now']();queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x9')]='EXITWITHKEY';utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x2a'),_0x3e40ab[_0x04be('0x5')],queues[_0x3e40ab[_0x04be('0x5')]][_0x04be('0x1c')],_0x3e40ab[_0x04be('0x27')],queues[_0x3e40ab['uniqueid']][_0x04be('0x9')]));}}}catch(_0x52d0ba){utils[_0x04be('0x12')](util['format'](_0x04be('0x21'),_0x3e40ab[_0x04be('0x5')]),_0x52d0ba);}};exports[_0x04be('0x25')]=function(_0x22867e){try{if(!_[_0x04be('0x15')](queues[_0x22867e['uniqueid']])){utils[_0x04be('0x20')](util['format'](_0x04be('0x2b'),_0x22867e[_0x04be('0x5')]),_0x22867e);queues[_0x22867e[_0x04be('0x5')]][_0x04be('0x17')]=![];queues[_0x22867e[_0x04be('0x5')]]['queuecallerexitAt']=null;queues[_0x22867e['uniqueid']][_0x04be('0x25')]=!![];queues[_0x22867e[_0x04be('0x5')]][_0x04be('0x29')]=utils['now']();queues[_0x22867e[_0x04be('0x5')]][_0x04be('0x9')]=_0x04be('0x2c');utils[_0x04be('0x3')](util['format'](_0x04be('0x2d'),_0x22867e[_0x04be('0x5')],queues[_0x22867e['uniqueid']][_0x04be('0x1c')],queues[_0x22867e[_0x04be('0x5')]][_0x04be('0x9')]));}}catch(_0x430943){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x2b'),_0x22867e[_0x04be('0x5')]),_0x430943);}};exports[_0x04be('0x2e')]=function(_0xed762a){try{if(!_[_0x04be('0x15')](queues[_0xed762a[_0x04be('0x5')]])){utils[_0x04be('0x20')](util[_0x04be('0x10')](_0x04be('0x2f'),_0xed762a['uniqueid']),_0xed762a);utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x30'),_0xed762a[_0x04be('0x5')],queues[_0xed762a['uniqueid']]['name'],_0xed762a[_0x04be('0x31')],_0xed762a[_0x04be('0x32')]));queues[_0xed762a[_0x04be('0x5')]][_0x04be('0x2e')]=!![];queues[_0xed762a['uniqueid']][_0x04be('0x16')]=utils[_0x04be('0x19')]();queues[_0xed762a[_0x04be('0x5')]][_0x04be('0x33')]=utils['diffTime'](queues[_0xed762a[_0x04be('0x5')]][_0x04be('0x16')],queues[_0xed762a['uniqueid']][_0x04be('0x34')]);queues[_0xed762a['uniqueid']][_0x04be('0x11')]=_0xed762a['position'];queues[_0xed762a['uniqueid']]['count']=_0xed762a[_0x04be('0x35')];queues[_0xed762a[_0x04be('0x5')]][_0x04be('0x31')]=_0xed762a[_0x04be('0x31')];queues[_0xed762a['uniqueid']][_0x04be('0x32')]=_0xed762a['connectedlinename'];}}catch(_0x41f3c0){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x2f'),_0xed762a[_0x04be('0x5')]),_0x41f3c0);}};exports[_0x04be('0x36')]=function(_0x18c8ec){try{if(!_[_0x04be('0x15')](queues[_0x18c8ec[_0x04be('0x5')]])){utils['debug'](util[_0x04be('0x10')](_0x04be('0x37'),_0x18c8ec[_0x04be('0x5')]),_0x18c8ec);utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x38'),_0x18c8ec[_0x04be('0x5')],queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x1c')],_0x18c8ec['membername'],_0x18c8ec[_0x04be('0x39')]));queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x25')]=![];queues[_0x18c8ec[_0x04be('0x5')]]['queuecallerabandon']=![];queues[_0x18c8ec['uniqueid']][_0x04be('0x29')]=null;queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x17')]=![];queues[_0x18c8ec['uniqueid']]['queuecallerexitreason']=null;queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x26')]=null;queues[_0x18c8ec['uniqueid']][_0x04be('0x3a')]=!![];queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x3b')]=_0x18c8ec[_0x04be('0x39')];queues[_0x18c8ec[_0x04be('0x5')]][_0x04be('0x8')]=_0x18c8ec[_0x04be('0x3c')];}}catch(_0x4d8430){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x37'),_0x18c8ec[_0x04be('0x5')]),_0x4d8430);}};exports[_0x04be('0x3d')]=function(_0x426103){try{if(!_[_0x04be('0x15')](queues[_0x426103[_0x04be('0x5')]])){if(queues[_0x426103[_0x04be('0x5')]][_0x04be('0x16')]){utils[_0x04be('0x20')](util[_0x04be('0x10')](_0x04be('0x3e'),_0x426103[_0x04be('0x5')]),_0x426103);queues[_0x426103[_0x04be('0x5')]]['queuecallerabandon']=![];queues[_0x426103[_0x04be('0x5')]][_0x04be('0x25')]=![];queues[_0x426103[_0x04be('0x5')]][_0x04be('0x29')]=null;queues[_0x426103['uniqueid']]['queuecallerexit']=![];queues[_0x426103['uniqueid']][_0x04be('0x26')]=null;queues[_0x426103[_0x04be('0x5')]][_0x04be('0x3a')]=!![];queues[_0x426103['uniqueid']]['lastAssignedTo']=_0x426103[_0x04be('0x3c')];queues[_0x426103[_0x04be('0x5')]]['queuecallercomplete']=!![];queues[_0x426103[_0x04be('0x5')]][_0x04be('0x3f')]=utils['now']();if(_0x426103['reason']==_0x04be('0x40')){if(!queues[_0x426103[_0x04be('0x5')]]['transfer']){queues[_0x426103['uniqueid']][_0x04be('0x9')]=_0x04be('0x41');}}else{queues[_0x426103['uniqueid']][_0x04be('0x9')]=_0x04be('0x42')+_0x426103[_0x04be('0x43')][_0x04be('0x23')]();}utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x44'),_0x426103[_0x04be('0x5')],queues[_0x426103[_0x04be('0x5')]]['name'],_0x426103[_0x04be('0x3c')],queues[_0x426103[_0x04be('0x5')]][_0x04be('0x9')]));writeDB(queues[_0x426103[_0x04be('0x5')]]);}}}catch(_0x3625a8){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x3e'),_0x426103['uniqueid']),_0x3625a8);}};exports['blindtransfer']=function(_0x3c005c){try{if(!_['isNil'](queues[_0x3c005c['transfereeuniqueid']])){utils[_0x04be('0x20')](util[_0x04be('0x10')](_0x04be('0x45'),_0x3c005c['uniqueid']),_0x3c005c);queues[_0x3c005c[_0x04be('0x46')]]['transfer']=!![];queues[_0x3c005c[_0x04be('0x46')]][_0x04be('0x47')]=_0x04be('0x48');queues[_0x3c005c[_0x04be('0x46')]]['transferexten']=_0x3c005c[_0x04be('0x49')];queues[_0x3c005c[_0x04be('0x46')]][_0x04be('0x4a')]=_0x3c005c[_0x04be('0x46')];queues[_0x3c005c['transfereeuniqueid']]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0x04be('0x10')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3c005c['uniqueid'],queues[_0x3c005c[_0x04be('0x46')]][_0x04be('0x1c')],_0x3c005c[_0x04be('0x46')],_0x3c005c[_0x04be('0x49')]));}}catch(_0x3d264b){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x45'),_0x3c005c[_0x04be('0x5')]),_0x3d264b);}};exports[_0x04be('0x4b')]=function(_0x2219e7){try{utils[_0x04be('0x20')](util[_0x04be('0x10')](_0x04be('0x4c'),_0x2219e7[_0x04be('0x4d')]),_0x2219e7);if(_0x2219e7[_0x04be('0x4d')]==_0x2219e7[_0x04be('0x4e')]){if(!_['isNil'](queues[_0x2219e7[_0x04be('0x4f')]])){utils[_0x04be('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2219e7[_0x04be('0x4d')],queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x1c')],_0x2219e7['origtransfererexten']));queues[_0x2219e7[_0x04be('0x4f')]]['transfer']=!![];queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x47')]='ATTENDED';queues[_0x2219e7[_0x04be('0x4f')]]['transferexten']=_0x2219e7['origtransfererexten'];queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x4a')]=_0x2219e7[_0x04be('0x4d')];queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x04be('0x15')](queues[_0x2219e7[_0x04be('0x4e')]])){if(_0x2219e7['transfereelinkedid']&&queues[_0x2219e7[_0x04be('0x50')]]){queues[_0x2219e7['transfereelinkedid']][_0x04be('0x1e')]=0x1;queues[_0x2219e7[_0x04be('0x46')]]=_[_0x04be('0x51')](queues[_0x2219e7[_0x04be('0x50')]]);queues[_0x2219e7[_0x04be('0x46')]][_0x04be('0xe')]=_0x2219e7[_0x04be('0x52')];queues[_0x2219e7['transfereeuniqueid']][_0x04be('0x1e')]=0x2;queues[_0x2219e7['transfereeuniqueid']]['calleridnum']=queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x53')];queues[_0x2219e7[_0x04be('0x46')]]['calleridname']=queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x54')];queues[_0x2219e7['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x04be('0x19')]();queues[_0x2219e7['transfereeuniqueid']][_0x04be('0x16')]=utils[_0x04be('0x19')]();queues[_0x2219e7[_0x04be('0x46')]]['holdtime']=0x0;queues[_0x2219e7[_0x04be('0x46')]]['mohtime']=0x0;utils['info'](util[_0x04be('0x10')](_0x04be('0x55'),_0x2219e7[_0x04be('0x4d')],queues[_0x2219e7['transfereeuniqueid']]['name'],queues[_0x2219e7[_0x04be('0x46')]]['calleridnum'],queues[_0x2219e7[_0x04be('0x46')]]['calleridname']));}else{utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x56'),_0x2219e7[_0x04be('0x4d')],queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x1c')],_0x2219e7[_0x04be('0x4f')]));queues[_0x2219e7['origtransfererlinkedid']][_0x04be('0xe')]=_0x2219e7[_0x04be('0x4f')];}}}else if(_0x2219e7[_0x04be('0x57')]==_0x2219e7[_0x04be('0x4f')]){if(!_[_0x04be('0x15')](queues[_0x2219e7['origtransfererlinkedid']])){utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x58'),_0x2219e7[_0x04be('0x4d')],queues[_0x2219e7[_0x04be('0x4e')]]['name'],_0x2219e7[_0x04be('0x57')],_0x2219e7[_0x04be('0x59')]));queues[_0x2219e7[_0x04be('0x4e')]]['transfer']=!![];queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x47')]=_0x04be('0x5a');queues[_0x2219e7['origtransfererlinkedid']][_0x04be('0x5b')]=_0x2219e7[_0x04be('0x59')];queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x4a')]=_0x2219e7['secondtransfereruniqueid'];queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x9')]=_0x04be('0x5c');}if(!_['isNil'](queues[_0x2219e7[_0x04be('0x4f')]])){if(_0x2219e7[_0x04be('0x5d')]&&queues[_0x2219e7[_0x04be('0x5d')]]){queues[_0x2219e7[_0x04be('0x5d')]][_0x04be('0x1e')]=0x1;queues[_0x2219e7[_0x04be('0x52')]]=_[_0x04be('0x51')](queues[_0x2219e7[_0x04be('0x5d')]]);queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0xe')]=_0x2219e7[_0x04be('0x52')];queues[_0x2219e7['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0x53')]=queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x53')];queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0x54')]=queues[_0x2219e7[_0x04be('0x4e')]][_0x04be('0x54')];queues[_0x2219e7['transfertargetuniqueid']][_0x04be('0x34')]=utils[_0x04be('0x19')]();queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0x16')]=utils[_0x04be('0x19')]();queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0x33')]=0x0;queues[_0x2219e7['transfertargetuniqueid']][_0x04be('0x5e')]=0x0;utils[_0x04be('0x3')](util[_0x04be('0x10')](_0x04be('0x5f'),_0x2219e7[_0x04be('0x4d')],queues[_0x2219e7['transfertargetuniqueid']]['name'],queues[_0x2219e7[_0x04be('0x52')]][_0x04be('0xe')],queues[_0x2219e7[_0x04be('0x52')]]['calleridnum'],queues[_0x2219e7[_0x04be('0x52')]]['calleridname']));}else{utils[_0x04be('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2219e7['origtransfereruniqueid'],queues[_0x2219e7[_0x04be('0x4f')]][_0x04be('0x1c')],_0x2219e7['origtransfererlinkedid']));queues[_0x2219e7['secondtransfererlinkedid']][_0x04be('0xe')]=_0x2219e7[_0x04be('0x4e')];}}}}catch(_0x753dbe){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x4c'),_0x2219e7[_0x04be('0x4d')]),_0x753dbe);}};exports['musiconholdstart']=function(_0x994a10){try{if(!_[_0x04be('0x15')](queues[_0x994a10['uniqueid']])){utils[_0x04be('0x20')](util[_0x04be('0x10')](_0x04be('0x60'),_0x994a10[_0x04be('0x5')]),_0x994a10);queues[_0x994a10[_0x04be('0x5')]][_0x04be('0x61')]=utils[_0x04be('0x19')]();utils['info'](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x994a10['uniqueid'],queues[_0x994a10['uniqueid']][_0x04be('0x1c')],queues[_0x994a10[_0x04be('0x5')]][_0x04be('0x61')]));}}catch(_0x4f83ea){utils[_0x04be('0x12')](util[_0x04be('0x10')](_0x04be('0x60'),_0x994a10[_0x04be('0x5')]),_0x4f83ea);}};exports['musiconholdstop']=function(_0x20777a){try{if(!_[_0x04be('0x15')](queues[_0x20777a[_0x04be('0x5')]])){if(!_['isNil'](queues[_0x20777a[_0x04be('0x5')]][_0x04be('0x61')])){utils['debug'](util[_0x04be('0x10')](_0x04be('0x62'),_0x20777a[_0x04be('0x5')]),_0x20777a);queues[_0x20777a[_0x04be('0x5')]][_0x04be('0x5e')]+=utils[_0x04be('0x63')](utils[_0x04be('0x19')](),queues[_0x20777a[_0x04be('0x5')]][_0x04be('0x61')]);utils['info'](util['format'](_0x04be('0x64'),_0x20777a['uniqueid'],queues[_0x20777a[_0x04be('0x5')]][_0x04be('0x1c')],queues[_0x20777a[_0x04be('0x5')]]['mohtime']));delete queues[_0x20777a[_0x04be('0x5')]]['musiconholdstartAt'];}}}catch(_0x4564b6){utils['error'](util[_0x04be('0x10')](_0x04be('0x62'),_0x20777a[_0x04be('0x5')]),_0x4564b6);}};