fda0d854827710c350a222266a843a7c81054aac
[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 _0x98f9=['responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','answertime','membername','reason','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','starttime'];(function(_0x3bd137,_0x36310c){var _0xc0b383=function(_0x2d8a72){while(--_0x2d8a72){_0x3bd137['push'](_0x3bd137['shift']());}};_0xc0b383(++_0x36310c);}(_0x98f9,0x1a8));var _0x998f=function(_0x51b2d4,_0x22a398){_0x51b2d4=_0x51b2d4-0x0;var _0x58f4f2=_0x98f9[_0x51b2d4];return _0x58f4f2;};'use strict';var util=require(_0x998f('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2d23ae,_0x5a41f6){var _0x4dd12d=moment(_0x2d23ae)['milliseconds'](0x0);var _0x45ee03=moment(_0x5a41f6)['milliseconds'](0x0);return _0x4dd12d['diff'](_0x45ee03,_0x998f('0x1'));}function AgentComplete(_0x237809,_0x49368d){this[_0x998f('0x2')]=0x4;this[_0x998f('0x3')]='Answer';this[_0x998f('0x4')]=_0x237809[_0x998f('0x4')];this[_0x998f('0x5')]=_0x237809[_0x998f('0x5')];this[_0x998f('0x6')]=_0x237809[_0x998f('0x5')]==='outbound'?_0x998f('0x7'):_0x237809[_0x998f('0x5')];this[_0x998f('0x8')]=_0x237809[_0x998f('0x8')];this['countcongestionretry']=_0x237809['countcongestionretry'];this['countnoanswerretry']=_0x237809[_0x998f('0x9')];this[_0x998f('0xa')]=_0x237809[_0x998f('0x8')]+_0x237809[_0x998f('0xb')]+_0x237809[_0x998f('0x9')]+_0x237809['countnosuchnumberretry']+_0x237809['countdropretry']+_0x237809[_0x998f('0xc')]+_0x237809[_0x998f('0xd')]+_0x237809['countagentrejectretry'];this[_0x998f('0xe')]=_0x237809[_0x998f('0xe')];this['countdropretry']=_0x237809['countdropretry'];this[_0x998f('0xc')]=_0x237809[_0x998f('0xc')];this[_0x998f('0xd')]=_0x237809[_0x998f('0xd')];this[_0x998f('0xf')]=_0x237809[_0x998f('0xf')];this[_0x998f('0x10')]=_0x49368d[_0x998f('0x10')];this[_0x998f('0x11')]=_0x237809[_0x998f('0x12')];this['calleridnum']=_0x237809['number'];this[_0x998f('0x13')]=_0x237809['starttime'];this[_0x998f('0x14')]=_0x237809[_0x998f('0x14')];this['answertime']=_0x237809['answertime'];this[_0x998f('0x15')]=moment()['format'](_0x998f('0x16'));this[_0x998f('0x17')]=getSeconds(_0x237809['responsetime'],_0x237809[_0x998f('0x13')]);this['holdtime']=getSeconds(_0x237809[_0x998f('0x18')],_0x237809[_0x998f('0x14')]);this['talktime']=getSeconds(this[_0x998f('0x15')],_0x237809['answertime']);this['queue']=_0x49368d['queue'];this[_0x998f('0x19')]=_0x49368d[_0x998f('0x19')];this[_0x998f('0x1a')]=_0x49368d[_0x998f('0x1a')];this['callback']=_0x237809[_0x998f('0x1b')];this['callbackuniqueid']=_0x237809[_0x998f('0x1c')];this['callbackat']=_0x237809['callbackat'];this[_0x998f('0x1d')]=_0x237809[_0x998f('0x1d')];this[_0x998f('0x1e')]=_0x237809[_0x998f('0x1e')];this[_0x998f('0x1f')]=_0x237809[_0x998f('0x1f')];this[_0x998f('0x20')]=_0x237809[_0x998f('0x20')];this[_0x998f('0x21')]=_0x237809[_0x998f('0x21')];this[_0x998f('0x22')]=_0x237809[_0x998f('0x22')];this[_0x998f('0x23')]=_0x237809[_0x998f('0x23')]||'';this['originatecalleridname']=_0x237809[_0x998f('0x24')]||'';}module['exports']=AgentComplete;