a0ac36f404fe5b4a1684277a1d626e5ed1db567a
[motion2.git] / server / services / ami / dialer / agentComplete.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 _0xf9ae=['exports','util','lodash','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x1946ed,_0x38df20){var _0x3a91c1=function(_0x1eeda0){while(--_0x1eeda0){_0x1946ed['push'](_0x1946ed['shift']());}};_0x3a91c1(++_0x38df20);}(_0xf9ae,0x85));var _0xef9a=function(_0x5989d1,_0x2bf765){_0x5989d1=_0x5989d1-0x0;var _0x534178=_0xf9ae[_0x5989d1];return _0x534178;};'use strict';var util=require(_0xef9a('0x0'));var _=require(_0xef9a('0x1'));var moment=require('moment');function getSeconds(_0x29291d,_0x23c429){var _0x105c06=moment(_0x29291d)[_0xef9a('0x2')](0x0);var _0x5259f5=moment(_0x23c429)[_0xef9a('0x2')](0x0);return _0x105c06[_0xef9a('0x3')](_0x5259f5,'seconds');}function AgentComplete(_0x3919dd,_0x2d1c4b){this[_0xef9a('0x4')]=0x4;this['statedesc']=_0xef9a('0x5');this[_0xef9a('0x6')]=_0x3919dd[_0xef9a('0x6')];this['type']=_0x3919dd[_0xef9a('0x7')];this[_0xef9a('0x8')]=_0x3919dd['type']===_0xef9a('0x9')?_0xef9a('0xa'):_0x3919dd[_0xef9a('0x7')];this['countbusyretry']=_0x3919dd[_0xef9a('0xb')];this['countcongestionretry']=_0x3919dd[_0xef9a('0xc')];this[_0xef9a('0xd')]=_0x3919dd[_0xef9a('0xd')];this[_0xef9a('0xe')]=_0x3919dd['countbusyretry']+_0x3919dd[_0xef9a('0xc')]+_0x3919dd['countnoanswerretry']+_0x3919dd[_0xef9a('0xf')]+_0x3919dd['countdropretry']+_0x3919dd[_0xef9a('0x10')]+_0x3919dd[_0xef9a('0x11')]+_0x3919dd[_0xef9a('0x12')];this[_0xef9a('0xf')]=_0x3919dd['countnosuchnumberretry'];this[_0xef9a('0x13')]=_0x3919dd[_0xef9a('0x13')];this[_0xef9a('0x10')]=_0x3919dd[_0xef9a('0x10')];this[_0xef9a('0x11')]=_0x3919dd[_0xef9a('0x11')];this[_0xef9a('0x12')]=_0x3919dd['countagentrejectretry'];this[_0xef9a('0x14')]=_0x2d1c4b[_0xef9a('0x14')];this['calleridname']=_0x3919dd[_0xef9a('0x15')];this[_0xef9a('0x16')]=_0x3919dd[_0xef9a('0x17')];this[_0xef9a('0x18')]=_0x3919dd[_0xef9a('0x18')];this[_0xef9a('0x19')]=_0x3919dd[_0xef9a('0x19')];this[_0xef9a('0x1a')]=_0x3919dd[_0xef9a('0x1a')];this['endtime']=moment()[_0xef9a('0x1b')](_0xef9a('0x1c'));this[_0xef9a('0x1d')]=getSeconds(_0x3919dd[_0xef9a('0x19')],_0x3919dd[_0xef9a('0x18')]);this[_0xef9a('0x1e')]=getSeconds(_0x3919dd[_0xef9a('0x1a')],_0x3919dd[_0xef9a('0x19')]);this[_0xef9a('0x1f')]=getSeconds(this[_0xef9a('0x20')],_0x3919dd['answertime']);this['queue']=_0x2d1c4b[_0xef9a('0xa')];this['membername']=_0x2d1c4b[_0xef9a('0x21')];this[_0xef9a('0x22')]=_0x2d1c4b[_0xef9a('0x22')];this['callback']=_0x3919dd[_0xef9a('0x23')];this[_0xef9a('0x24')]=_0x3919dd['callbackuniqueid'];this[_0xef9a('0x25')]=_0x3919dd['callbackat'];this['recallme']=_0x3919dd['recallme'];this['ContactId']=_0x3919dd['ContactId'];this['ListId']=_0x3919dd[_0xef9a('0x26')];this[_0xef9a('0x27')]=_0x3919dd[_0xef9a('0x27')];this['VoiceQueueId']=_0x3919dd['VoiceQueueId'];this[_0xef9a('0x28')]=_0x3919dd[_0xef9a('0x28')];this[_0xef9a('0x29')]=_0x3919dd[_0xef9a('0x29')]||'';this['originatecalleridname']=_0x3919dd[_0xef9a('0x2a')]||'';}module[_0xef9a('0x2b')]=AgentComplete;