Built motion from commit c116dc8b.|2.6.30
[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 _0x88cf=['clone','transfertargetuniqueid','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','transfertargetlinkedid','mohtime','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','destaccountcode','assigned','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x88cf,0x142));var _0xf88c=function(_0x30a56b,_0x958f0){_0x30a56b=_0x30a56b-0x0;var _0x572f3c=_0x88cf[_0x30a56b];return _0x572f3c;};'use strict';var _=require('lodash');var util=require(_0xf88c('0x0'));var utils=require(_0xf88c('0x1'));var queues={};function writeDB(_0x4f48c7){utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x4'),_0x4f48c7[_0xf88c('0x5')],_0x4f48c7[_0xf88c('0x6')],_0x4f48c7[_0xf88c('0x7')],_0x4f48c7[_0xf88c('0x8')],_0x4f48c7[_0xf88c('0x9')],_0x4f48c7[_0xf88c('0xa')],_0x4f48c7[_0xf88c('0xb')]));if(_0x4f48c7[_0xf88c('0x7')]){utils[_0xf88c('0xc')](_0x4f48c7[_0xf88c('0x7')])['then'](function(_0x2a5558){if(_0x2a5558){_0x4f48c7[_0xf88c('0xd')]=_0x2a5558[_0xf88c('0xd')];}utils['request'](_0xf88c('0xe'),_0x4f48c7);});}else{utils[_0xf88c('0xf')]('CreateVoiceQueueReport',_0x4f48c7);}if(_0x4f48c7[_0xf88c('0x10')]){delete queues[_0x4f48c7['transfereduniqueid']];}else{delete queues[_0x4f48c7['uniqueid']];}}exports[_0xf88c('0x11')]=function(_0x2508ca){try{utils[_0xf88c('0x12')](util['format'](_0xf88c('0x13'),_0x2508ca[_0xf88c('0x5')]),_0x2508ca);utils[_0xf88c('0x2')](util[_0xf88c('0x3')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2508ca['uniqueid'],_0x2508ca['queue'],_0x2508ca[_0xf88c('0x14')]));queues[_0x2508ca[_0xf88c('0x5')]]=_[_0xf88c('0x15')](_0x2508ca,{'originalposition':_0x2508ca[_0xf88c('0x14')],'queuecallerjoinAt':utils[_0xf88c('0x16')](),'mohtime':0x0});}catch(_0x52e718){utils[_0xf88c('0x17')](util['format'](_0xf88c('0x13'),_0x2508ca[_0xf88c('0x5')]),_0x52e718);}};exports[_0xf88c('0x18')]=function(_0x165146){try{if(!_[_0xf88c('0x19')](queues[_0x165146[_0xf88c('0x5')]])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')]('[%s][queues][hangup]',_0x165146[_0xf88c('0x5')]),_0x165146);if(queues[_0x165146[_0xf88c('0x5')]]['queuecallerleaveAt']){if(!queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x1a')]&&!queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x1b')]){queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x1c')]=!![];queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x1d')]=utils[_0xf88c('0x16')]();queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0xb')]=_0xf88c('0x1e');}utils['info'](util[_0xf88c('0x3')](_0xf88c('0x1f'),_0x165146[_0xf88c('0x5')],queues[_0x165146['uniqueid']][_0xf88c('0x20')],queues[_0x165146[_0xf88c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x165146[_0xf88c('0x5')]]);}else if(queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x10')]){utils[_0xf88c('0x2')](util['format'](_0xf88c('0x21'),_0x165146['uniqueid'],queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x20')],queues[_0x165146['uniqueid']]['transfereduniqueid']));queues[queues[_0x165146[_0xf88c('0x5')]][_0xf88c('0x10')]]=queues[_0x165146['uniqueid']];queues[queues[_0x165146[_0xf88c('0x5')]]['transfereduniqueid']][_0xf88c('0x22')]=0x2;delete queues[_0x165146['uniqueid']];}}}catch(_0xe78b8d){utils[_0xf88c('0x17')](util[_0xf88c('0x3')](_0xf88c('0x23'),_0x165146['uniqueid']),_0xe78b8d);}};exports[_0xf88c('0x24')]=function(_0x1404f2){try{utils['debug'](util[_0xf88c('0x3')]('[%s][queues][varset]',_0x1404f2[_0xf88c('0x5')]),_0x1404f2);if(!_[_0xf88c('0x19')](_0x1404f2[_0xf88c('0x25')][_0xf88c('0x26')])&&_0x1404f2[_0xf88c('0x27')]['toUpperCase']()!==_0xf88c('0x28')){if(!_[_0xf88c('0x19')](queues[_0x1404f2[_0xf88c('0x5')]])){queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x1a')]=![];queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x29')]=null;queues[_0x1404f2['uniqueid']]['queuecallerexit']=!![];queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x2a')]=utils['now']();queues[_0x1404f2['uniqueid']][_0xf88c('0xb')]=_0x1404f2[_0xf88c('0x27')]['toUpperCase']();utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x2b'),_0x1404f2[_0xf88c('0x5')],queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x20')],_0x1404f2[_0xf88c('0x27')],queues[_0x1404f2['uniqueid']][_0xf88c('0xb')]));writeDB(queues[_0x1404f2[_0xf88c('0x5')]]);}}else if(!_[_0xf88c('0x19')](_0x1404f2[_0xf88c('0x25')][_0xf88c('0x2c')])){if(!_[_0xf88c('0x19')](queues[_0x1404f2['uniqueid']])&&!queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x1a')]){queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x1a')]=![];queues[_0x1404f2[_0xf88c('0x5')]]['queuecallerabandonAt']=null;queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x1b')]=!![];queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0x2a')]=utils['now']();queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0xb')]=_0xf88c('0x2d');utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x2e'),_0x1404f2[_0xf88c('0x5')],queues[_0x1404f2[_0xf88c('0x5')]]['name'],_0x1404f2[_0xf88c('0x27')],queues[_0x1404f2[_0xf88c('0x5')]][_0xf88c('0xb')]));}}}catch(_0x5e8da4){utils['error'](util['format'](_0xf88c('0x2f'),_0x1404f2[_0xf88c('0x5')]),_0x5e8da4);}};exports[_0xf88c('0x1a')]=function(_0x48b809){try{if(!_[_0xf88c('0x19')](queues[_0x48b809[_0xf88c('0x5')]])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')]('[%s][queues][queuecallerabandon]',_0x48b809[_0xf88c('0x5')]),_0x48b809);queues[_0x48b809[_0xf88c('0x5')]][_0xf88c('0x1b')]=![];queues[_0x48b809[_0xf88c('0x5')]][_0xf88c('0x2a')]=null;queues[_0x48b809[_0xf88c('0x5')]][_0xf88c('0x1a')]=!![];queues[_0x48b809['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x48b809[_0xf88c('0x5')]][_0xf88c('0xb')]='ABANDONED';utils['info'](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x48b809[_0xf88c('0x5')],queues[_0x48b809['uniqueid']]['name'],queues[_0x48b809[_0xf88c('0x5')]][_0xf88c('0xb')]));}}catch(_0x299f34){utils[_0xf88c('0x17')](util['format'](_0xf88c('0x30'),_0x48b809[_0xf88c('0x5')]),_0x299f34);}};exports[_0xf88c('0x31')]=function(_0x536b83){try{if(!_[_0xf88c('0x19')](queues[_0x536b83[_0xf88c('0x5')]])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')](_0xf88c('0x32'),_0x536b83[_0xf88c('0x5')]),_0x536b83);utils['info'](util[_0xf88c('0x3')](_0xf88c('0x33'),_0x536b83['uniqueid'],queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x20')],_0x536b83[_0xf88c('0x34')],_0x536b83['connectedlinename']));queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x31')]=!![];queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x35')]=utils[_0xf88c('0x16')]();queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x36')]=utils[_0xf88c('0x37')](queues[_0x536b83[_0xf88c('0x5')]]['queuecallerleaveAt'],queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x38')]);queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x14')]=_0x536b83[_0xf88c('0x14')];queues[_0x536b83[_0xf88c('0x5')]][_0xf88c('0x39')]=_0x536b83[_0xf88c('0x39')];queues[_0x536b83[_0xf88c('0x5')]]['connectedlinenum']=_0x536b83[_0xf88c('0x34')];queues[_0x536b83[_0xf88c('0x5')]]['connectedlinename']=_0x536b83[_0xf88c('0x3a')];}}catch(_0x55e623){utils['error'](util[_0xf88c('0x3')](_0xf88c('0x32'),_0x536b83['uniqueid']),_0x55e623);}};exports[_0xf88c('0x3b')]=function(_0x131908){try{if(!_[_0xf88c('0x19')](queues[_0x131908[_0xf88c('0x5')]])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')]('[%s][queues][agentconnect]',_0x131908[_0xf88c('0x5')]),_0x131908);utils[_0xf88c('0x2')](util[_0xf88c('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x131908['uniqueid'],queues[_0x131908['uniqueid']][_0xf88c('0x20')],_0x131908['membername'],_0x131908[_0xf88c('0x3c')]));queues[_0x131908['uniqueid']]['queuecallerabandon']=![];queues[_0x131908[_0xf88c('0x5')]][_0xf88c('0x1a')]=![];queues[_0x131908[_0xf88c('0x5')]]['queuecallerabandonAt']=null;queues[_0x131908['uniqueid']][_0xf88c('0x1b')]=![];queues[_0x131908[_0xf88c('0x5')]][_0xf88c('0xb')]=null;queues[_0x131908[_0xf88c('0x5')]][_0xf88c('0x2a')]=null;queues[_0x131908[_0xf88c('0x5')]][_0xf88c('0x3d')]=!![];queues[_0x131908[_0xf88c('0x5')]][_0xf88c('0xa')]=_0x131908['destaccountcode'];queues[_0x131908['uniqueid']][_0xf88c('0x8')]=_0x131908[_0xf88c('0x3e')];}}catch(_0x680fd4){utils[_0xf88c('0x17')](util[_0xf88c('0x3')]('[%s][queues][agentconnect]',_0x131908[_0xf88c('0x5')]),_0x680fd4);}};exports[_0xf88c('0x3f')]=function(_0x3bc6d5){try{if(!_[_0xf88c('0x19')](queues[_0x3bc6d5['uniqueid']])){if(queues[_0x3bc6d5['uniqueid']][_0xf88c('0x35')]){utils[_0xf88c('0x12')](util[_0xf88c('0x3')]('[%s][queues][agentcomplete]',_0x3bc6d5[_0xf88c('0x5')]),_0x3bc6d5);queues[_0x3bc6d5['uniqueid']]['queuecallerabandon']=![];queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0x1a')]=![];queues[_0x3bc6d5['uniqueid']][_0xf88c('0x29')]=null;queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0x1b')]=![];queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0x2a')]=null;queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0x3d')]=!![];queues[_0x3bc6d5['uniqueid']][_0xf88c('0x8')]=_0x3bc6d5['membername'];queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0x1c')]=!![];queues[_0x3bc6d5['uniqueid']][_0xf88c('0x1d')]=utils[_0xf88c('0x16')]();if(_0x3bc6d5[_0xf88c('0x40')]==_0xf88c('0x41')){if(!queues[_0x3bc6d5[_0xf88c('0x5')]]['transfer']){queues[_0x3bc6d5[_0xf88c('0x5')]]['queuecallerexitreason']=_0xf88c('0x42');}}else{queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0xb')]=_0xf88c('0x43')+_0x3bc6d5[_0xf88c('0x40')][_0xf88c('0x44')]();}utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x45'),_0x3bc6d5['uniqueid'],queues[_0x3bc6d5['uniqueid']][_0xf88c('0x20')],_0x3bc6d5['membername'],queues[_0x3bc6d5[_0xf88c('0x5')]][_0xf88c('0xb')]));writeDB(queues[_0x3bc6d5[_0xf88c('0x5')]]);}}}catch(_0x4daf1b){utils[_0xf88c('0x17')](util[_0xf88c('0x3')](_0xf88c('0x46'),_0x3bc6d5[_0xf88c('0x5')]),_0x4daf1b);}};exports['blindtransfer']=function(_0x2189f3){try{if(!_[_0xf88c('0x19')](queues[_0x2189f3['transfereeuniqueid']])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')](_0xf88c('0x47'),_0x2189f3[_0xf88c('0x5')]),_0x2189f3);queues[_0x2189f3['transfereeuniqueid']][_0xf88c('0x41')]=!![];queues[_0x2189f3[_0xf88c('0x48')]][_0xf88c('0x49')]='BLIND';queues[_0x2189f3['transfereeuniqueid']][_0xf88c('0x4a')]=_0x2189f3[_0xf88c('0x4b')];queues[_0x2189f3[_0xf88c('0x48')]][_0xf88c('0x4c')]=_0x2189f3['transfereeuniqueid'];queues[_0x2189f3[_0xf88c('0x48')]][_0xf88c('0xb')]='BLINDTRANSFER';utils[_0xf88c('0x2')](util[_0xf88c('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x2189f3[_0xf88c('0x5')],queues[_0x2189f3['transfereeuniqueid']][_0xf88c('0x20')],_0x2189f3[_0xf88c('0x48')],_0x2189f3['extension']));}}catch(_0x30e0c4){utils[_0xf88c('0x17')](util[_0xf88c('0x3')](_0xf88c('0x47'),_0x2189f3['uniqueid']),_0x30e0c4);}};exports['attendedtransfer']=function(_0x2dc643){try{utils[_0xf88c('0x12')](util[_0xf88c('0x3')](_0xf88c('0x4d'),_0x2dc643[_0xf88c('0x4e')]),_0x2dc643);if(_0x2dc643[_0xf88c('0x4e')]==_0x2dc643[_0xf88c('0x4f')]){if(!_[_0xf88c('0x19')](queues[_0x2dc643[_0xf88c('0x50')]])){utils[_0xf88c('0x2')](util['format'](_0xf88c('0x51'),_0x2dc643[_0xf88c('0x4e')],queues[_0x2dc643['secondtransfererlinkedid']]['name'],_0x2dc643[_0xf88c('0x52')]));queues[_0x2dc643['secondtransfererlinkedid']][_0xf88c('0x41')]=!![];queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x49')]=_0xf88c('0x53');queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x4a')]=_0x2dc643[_0xf88c('0x52')];queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x4c')]=_0x2dc643[_0xf88c('0x4e')];queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0xb')]=_0xf88c('0x54');}if(!_[_0xf88c('0x19')](queues[_0x2dc643[_0xf88c('0x4f')]])){if(_0x2dc643[_0xf88c('0x55')]&&queues[_0x2dc643[_0xf88c('0x55')]]){queues[_0x2dc643[_0xf88c('0x55')]][_0xf88c('0x22')]=0x1;queues[_0x2dc643[_0xf88c('0x48')]]=_[_0xf88c('0x56')](queues[_0x2dc643[_0xf88c('0x55')]]);queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x10')]=_0x2dc643[_0xf88c('0x57')];queues[_0x2dc643[_0xf88c('0x48')]]['queuecallerenterreason']=0x2;queues[_0x2dc643['transfereeuniqueid']][_0xf88c('0x9')]=queues[_0x2dc643['secondtransfererlinkedid']][_0xf88c('0x9')];queues[_0x2dc643[_0xf88c('0x48')]]['calleridname']=queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x58')];queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x38')]=utils['now']();queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x35')]=utils['now']();queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x36')]=0x0;queues[_0x2dc643[_0xf88c('0x48')]]['mohtime']=0x0;utils['info'](util[_0xf88c('0x3')](_0xf88c('0x59'),_0x2dc643[_0xf88c('0x4e')],queues[_0x2dc643[_0xf88c('0x48')]]['name'],queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x9')],queues[_0x2dc643[_0xf88c('0x48')]][_0xf88c('0x58')]));}else{utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x5a'),_0x2dc643['origtransfereruniqueid'],queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x20')],_0x2dc643[_0xf88c('0x50')]));queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x10')]=_0x2dc643['secondtransfererlinkedid'];}}}else if(_0x2dc643[_0xf88c('0x5b')]==_0x2dc643['secondtransfererlinkedid']){if(!_[_0xf88c('0x19')](queues[_0x2dc643[_0xf88c('0x4f')]])){utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x5c'),_0x2dc643[_0xf88c('0x4e')],queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x20')],_0x2dc643[_0xf88c('0x5b')],_0x2dc643['secondtransfererexten']));queues[_0x2dc643[_0xf88c('0x4f')]]['transfer']=!![];queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x49')]=_0xf88c('0x53');queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x4a')]=_0x2dc643[_0xf88c('0x5d')];queues[_0x2dc643['origtransfererlinkedid']][_0xf88c('0x4c')]=_0x2dc643[_0xf88c('0x5b')];queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0xb')]=_0xf88c('0x54');}if(!_[_0xf88c('0x19')](queues[_0x2dc643[_0xf88c('0x50')]])){if(_0x2dc643[_0xf88c('0x5e')]&&queues[_0x2dc643[_0xf88c('0x5e')]]){queues[_0x2dc643[_0xf88c('0x5e')]]['queuecallerenterreason']=0x1;queues[_0x2dc643['transfertargetuniqueid']]=_[_0xf88c('0x56')](queues[_0x2dc643['transfertargetlinkedid']]);queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x10')]=_0x2dc643[_0xf88c('0x57')];queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x22')]=0x2;queues[_0x2dc643[_0xf88c('0x57')]]['calleridnum']=queues[_0x2dc643[_0xf88c('0x4f')]][_0xf88c('0x9')];queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x58')]=queues[_0x2dc643['origtransfererlinkedid']][_0xf88c('0x58')];queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x38')]=utils[_0xf88c('0x16')]();queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x35')]=utils[_0xf88c('0x16')]();queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x36')]=0x0;queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x5f')]=0x0;utils[_0xf88c('0x2')](util[_0xf88c('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x2dc643[_0xf88c('0x4e')],queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x20')],queues[_0x2dc643['transfertargetuniqueid']][_0xf88c('0x10')],queues[_0x2dc643['transfertargetuniqueid']][_0xf88c('0x9')],queues[_0x2dc643[_0xf88c('0x57')]][_0xf88c('0x58')]));}else{utils['info'](util['format'](_0xf88c('0x5a'),_0x2dc643[_0xf88c('0x4e')],queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x20')],_0x2dc643[_0xf88c('0x4f')]));queues[_0x2dc643[_0xf88c('0x50')]][_0xf88c('0x10')]=_0x2dc643[_0xf88c('0x4f')];}}}}catch(_0x20c3c7){utils[_0xf88c('0x17')](util[_0xf88c('0x3')](_0xf88c('0x4d'),_0x2dc643['origtransfereruniqueid']),_0x20c3c7);}};exports[_0xf88c('0x60')]=function(_0xe3830b){try{if(!_[_0xf88c('0x19')](queues[_0xe3830b[_0xf88c('0x5')]])){utils['debug'](util['format'](_0xf88c('0x61'),_0xe3830b[_0xf88c('0x5')]),_0xe3830b);queues[_0xe3830b[_0xf88c('0x5')]][_0xf88c('0x62')]=utils[_0xf88c('0x16')]();utils[_0xf88c('0x2')](util[_0xf88c('0x3')](_0xf88c('0x63'),_0xe3830b[_0xf88c('0x5')],queues[_0xe3830b['uniqueid']][_0xf88c('0x20')],queues[_0xe3830b['uniqueid']]['musiconholdstartAt']));}}catch(_0x2491dc){utils['error'](util[_0xf88c('0x3')](_0xf88c('0x61'),_0xe3830b[_0xf88c('0x5')]),_0x2491dc);}};exports[_0xf88c('0x64')]=function(_0xc5730){try{if(!_[_0xf88c('0x19')](queues[_0xc5730[_0xf88c('0x5')]])){if(!_[_0xf88c('0x19')](queues[_0xc5730[_0xf88c('0x5')]][_0xf88c('0x62')])){utils[_0xf88c('0x12')](util[_0xf88c('0x3')](_0xf88c('0x65'),_0xc5730[_0xf88c('0x5')]),_0xc5730);queues[_0xc5730[_0xf88c('0x5')]]['mohtime']+=utils[_0xf88c('0x37')](utils[_0xf88c('0x16')](),queues[_0xc5730[_0xf88c('0x5')]][_0xf88c('0x62')]);utils[_0xf88c('0x2')](util[_0xf88c('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0xc5730[_0xf88c('0x5')],queues[_0xc5730['uniqueid']]['name'],queues[_0xc5730[_0xf88c('0x5')]]['mohtime']));delete queues[_0xc5730[_0xf88c('0x5')]][_0xf88c('0x62')];}}}catch(_0x1e5901){utils['error'](util[_0xf88c('0x3')](_0xf88c('0x65'),_0xc5730[_0xf88c('0x5')]),_0x1e5901);}};