Built motion from commit d9028345.|2.5.43
[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 _0x83a4=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','starttime','responsetime','answertime','endtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x83a4,0x182));var _0x483a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x83a4[_0x422905];return _0x33dc6c;};'use strict';var util=require(_0x483a('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x1d609c,_0x39478f){var _0x520c0b=moment(_0x1d609c)[_0x483a('0x1')](0x0);var _0x378a3d=moment(_0x39478f)[_0x483a('0x1')](0x0);return _0x520c0b[_0x483a('0x2')](_0x378a3d,_0x483a('0x3'));}function AgentComplete(_0x1e0cea,_0x571c89){this[_0x483a('0x4')]=0x4;this[_0x483a('0x5')]=_0x483a('0x6');this[_0x483a('0x7')]=_0x1e0cea[_0x483a('0x7')];this[_0x483a('0x8')]=_0x1e0cea['type'];this[_0x483a('0x9')]=_0x1e0cea['type']===_0x483a('0xa')?_0x483a('0xb'):_0x1e0cea['type'];this[_0x483a('0xc')]=_0x1e0cea[_0x483a('0xc')];this[_0x483a('0xd')]=_0x1e0cea[_0x483a('0xd')];this['countnoanswerretry']=_0x1e0cea[_0x483a('0xe')];this[_0x483a('0xf')]=_0x1e0cea[_0x483a('0xc')]+_0x1e0cea['countcongestionretry']+_0x1e0cea['countnoanswerretry']+_0x1e0cea[_0x483a('0x10')]+_0x1e0cea[_0x483a('0x11')]+_0x1e0cea[_0x483a('0x12')]+_0x1e0cea['countmachineretry']+_0x1e0cea[_0x483a('0x13')];this[_0x483a('0x10')]=_0x1e0cea[_0x483a('0x10')];this[_0x483a('0x11')]=_0x1e0cea['countdropretry'];this[_0x483a('0x12')]=_0x1e0cea[_0x483a('0x12')];this[_0x483a('0x14')]=_0x1e0cea[_0x483a('0x14')];this['countagentrejectretry']=_0x1e0cea['countagentrejectretry'];this[_0x483a('0x15')]=_0x571c89[_0x483a('0x15')];this['calleridname']=_0x1e0cea[_0x483a('0x16')];this[_0x483a('0x17')]=_0x1e0cea['number'];this[_0x483a('0x18')]=_0x1e0cea[_0x483a('0x18')];this[_0x483a('0x19')]=_0x1e0cea['responsetime'];this[_0x483a('0x1a')]=_0x1e0cea[_0x483a('0x1a')];this[_0x483a('0x1b')]=moment()[_0x483a('0x1c')](_0x483a('0x1d'));this[_0x483a('0x1e')]=getSeconds(_0x1e0cea['responsetime'],_0x1e0cea[_0x483a('0x18')]);this[_0x483a('0x1f')]=getSeconds(_0x1e0cea['answertime'],_0x1e0cea[_0x483a('0x19')]);this[_0x483a('0x20')]=getSeconds(this[_0x483a('0x1b')],_0x1e0cea[_0x483a('0x1a')]);this[_0x483a('0xb')]=_0x571c89[_0x483a('0xb')];this[_0x483a('0x21')]=_0x571c89[_0x483a('0x21')];this['reason']=_0x571c89[_0x483a('0x22')];this[_0x483a('0x23')]=_0x1e0cea['callback'];this[_0x483a('0x24')]=_0x1e0cea[_0x483a('0x24')];this[_0x483a('0x25')]=_0x1e0cea[_0x483a('0x25')];this[_0x483a('0x26')]=_0x1e0cea[_0x483a('0x26')];this[_0x483a('0x27')]=_0x1e0cea['ContactId'];this[_0x483a('0x28')]=_0x1e0cea[_0x483a('0x28')];this[_0x483a('0x29')]=_0x1e0cea[_0x483a('0x29')];this['VoiceQueueId']=_0x1e0cea[_0x483a('0x2a')];this[_0x483a('0x2b')]=_0x1e0cea['CampaignId'];this[_0x483a('0x2c')]=_0x1e0cea[_0x483a('0x2c')]||'';this['originatecalleridname']=_0x1e0cea['originatecalleridname']||'';}module[_0x483a('0x2d')]=AgentComplete;