f6fe7fa8cff34e6e2aa93fc8c675cbf235cc3c81
[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 _0x22b7=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','starttime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x262d80,_0x42ea7c){var _0x30f515=function(_0x486f02){while(--_0x486f02){_0x262d80['push'](_0x262d80['shift']());}};_0x30f515(++_0x42ea7c);}(_0x22b7,0x1df));var _0x722b=function(_0x49c957,_0x3509d8){_0x49c957=_0x49c957-0x0;var _0x5b1d38=_0x22b7[_0x49c957];return _0x5b1d38;};'use strict';var util=require(_0x722b('0x0'));var _=require(_0x722b('0x1'));var moment=require('moment');function getSeconds(_0x3e2910,_0x342abe){var _0x2fd644=moment(_0x3e2910)[_0x722b('0x2')](0x0);var _0x423227=moment(_0x342abe)[_0x722b('0x2')](0x0);return _0x2fd644[_0x722b('0x3')](_0x423227,_0x722b('0x4'));}function AgentComplete(_0x18cc4c,_0x240aa9){this[_0x722b('0x5')]=0x4;this[_0x722b('0x6')]=_0x722b('0x7');this[_0x722b('0x8')]=_0x18cc4c[_0x722b('0x8')];this[_0x722b('0x9')]=_0x18cc4c[_0x722b('0x9')];this['campaigntype']=_0x18cc4c[_0x722b('0x9')]===_0x722b('0xa')?_0x722b('0xb'):_0x18cc4c[_0x722b('0x9')];this[_0x722b('0xc')]=_0x18cc4c['countbusyretry'];this[_0x722b('0xd')]=_0x18cc4c[_0x722b('0xd')];this[_0x722b('0xe')]=_0x18cc4c[_0x722b('0xe')];this['countglobal']=_0x18cc4c[_0x722b('0xc')]+_0x18cc4c['countcongestionretry']+_0x18cc4c[_0x722b('0xe')]+_0x18cc4c[_0x722b('0xf')]+_0x18cc4c[_0x722b('0x10')]+_0x18cc4c[_0x722b('0x11')]+_0x18cc4c[_0x722b('0x12')]+_0x18cc4c[_0x722b('0x13')];this[_0x722b('0xf')]=_0x18cc4c[_0x722b('0xf')];this[_0x722b('0x10')]=_0x18cc4c[_0x722b('0x10')];this[_0x722b('0x11')]=_0x18cc4c[_0x722b('0x11')];this[_0x722b('0x12')]=_0x18cc4c[_0x722b('0x12')];this[_0x722b('0x13')]=_0x18cc4c['countagentrejectretry'];this['uniqueid']=_0x240aa9[_0x722b('0x14')];this[_0x722b('0x15')]=_0x18cc4c['name'];this[_0x722b('0x16')]=_0x18cc4c[_0x722b('0x17')];this['starttime']=_0x18cc4c['starttime'];this['responsetime']=_0x18cc4c[_0x722b('0x18')];this[_0x722b('0x19')]=_0x18cc4c['answertime'];this['endtime']=moment()[_0x722b('0x1a')](_0x722b('0x1b'));this['ringtime']=getSeconds(_0x18cc4c[_0x722b('0x18')],_0x18cc4c[_0x722b('0x1c')]);this[_0x722b('0x1d')]=getSeconds(_0x18cc4c[_0x722b('0x19')],_0x18cc4c[_0x722b('0x18')]);this[_0x722b('0x1e')]=getSeconds(this[_0x722b('0x1f')],_0x18cc4c['answertime']);this['queue']=_0x240aa9[_0x722b('0xb')];this['membername']=_0x240aa9[_0x722b('0x20')];this[_0x722b('0x21')]=_0x240aa9['reason'];this[_0x722b('0x22')]=_0x18cc4c[_0x722b('0x22')];this[_0x722b('0x23')]=_0x18cc4c[_0x722b('0x23')];this[_0x722b('0x24')]=_0x18cc4c[_0x722b('0x24')];this[_0x722b('0x25')]=_0x18cc4c[_0x722b('0x25')];this[_0x722b('0x26')]=_0x18cc4c[_0x722b('0x26')];this['ListId']=_0x18cc4c['ListId'];this[_0x722b('0x27')]=_0x18cc4c[_0x722b('0x27')];this[_0x722b('0x28')]=_0x18cc4c[_0x722b('0x28')];this[_0x722b('0x29')]=_0x18cc4c[_0x722b('0x29')];this[_0x722b('0x2a')]=_0x18cc4c[_0x722b('0x2a')]||'';this[_0x722b('0x2b')]=_0x18cc4c[_0x722b('0x2b')]||'';}module[_0x722b('0x2c')]=AgentComplete;