38ced04e708357053f350c33883da76cf325b1b5
[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 _0xe76c=['responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe76c,0x6e));var _0xce76=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xe76c[_0x5c9307];return _0x373e29;};'use strict';var util=require('util');var _=require(_0xce76('0x0'));var moment=require('moment');function getSeconds(_0x147b7d,_0x6aebba){var _0x3674b3=moment(_0x147b7d)[_0xce76('0x1')](0x0);var _0x48dd7a=moment(_0x6aebba)[_0xce76('0x1')](0x0);return _0x3674b3[_0xce76('0x2')](_0x48dd7a,_0xce76('0x3'));}function AgentComplete(_0x335258,_0x40189a){this[_0xce76('0x4')]=0x4;this[_0xce76('0x5')]='Answer';this['scheduledat']=_0x335258[_0xce76('0x6')];this['type']=_0x335258[_0xce76('0x7')];this[_0xce76('0x8')]=_0x335258[_0xce76('0x7')]==='outbound'?_0xce76('0x9'):_0x335258['type'];this[_0xce76('0xa')]=_0x335258[_0xce76('0xa')];this[_0xce76('0xb')]=_0x335258[_0xce76('0xb')];this[_0xce76('0xc')]=_0x335258['countnoanswerretry'];this[_0xce76('0xd')]=_0x335258['countbusyretry']+_0x335258['countcongestionretry']+_0x335258[_0xce76('0xc')]+_0x335258[_0xce76('0xe')]+_0x335258[_0xce76('0xf')]+_0x335258[_0xce76('0x10')]+_0x335258[_0xce76('0x11')]+_0x335258[_0xce76('0x12')];this[_0xce76('0xe')]=_0x335258['countnosuchnumberretry'];this[_0xce76('0xf')]=_0x335258[_0xce76('0xf')];this['countabandonedretry']=_0x335258[_0xce76('0x10')];this['countmachineretry']=_0x335258[_0xce76('0x11')];this[_0xce76('0x12')]=_0x335258[_0xce76('0x12')];this[_0xce76('0x13')]=_0x40189a[_0xce76('0x13')];this[_0xce76('0x14')]=_0x335258[_0xce76('0x15')];this[_0xce76('0x16')]=_0x335258[_0xce76('0x17')];this[_0xce76('0x18')]=_0x335258[_0xce76('0x18')];this[_0xce76('0x19')]=_0x335258['responsetime'];this[_0xce76('0x1a')]=_0x335258[_0xce76('0x1a')];this[_0xce76('0x1b')]=moment()[_0xce76('0x1c')](_0xce76('0x1d'));this['ringtime']=getSeconds(_0x335258['responsetime'],_0x335258[_0xce76('0x18')]);this[_0xce76('0x1e')]=getSeconds(_0x335258[_0xce76('0x1a')],_0x335258['responsetime']);this[_0xce76('0x1f')]=getSeconds(this['endtime'],_0x335258[_0xce76('0x1a')]);this['queue']=_0x40189a[_0xce76('0x9')];this['membername']=_0x40189a[_0xce76('0x20')];this[_0xce76('0x21')]=_0x40189a[_0xce76('0x21')];this['callback']=_0x335258['callback'];this[_0xce76('0x22')]=_0x335258[_0xce76('0x22')];this[_0xce76('0x23')]=_0x335258[_0xce76('0x23')];this[_0xce76('0x24')]=_0x335258[_0xce76('0x24')];this[_0xce76('0x25')]=_0x335258['ContactId'];this[_0xce76('0x26')]=_0x335258['ListId'];this['UserId']=_0x335258[_0xce76('0x27')];this[_0xce76('0x28')]=_0x335258[_0xce76('0x28')];this[_0xce76('0x29')]=_0x335258[_0xce76('0x29')];this['originatecalleridnum']=_0x335258[_0xce76('0x2a')]||'';this[_0xce76('0x2b')]=_0x335258[_0xce76('0x2b')]||'';}module[_0xce76('0x2c')]=AgentComplete;