34bc9989cde317f1cb2179c82cc7c59adf338f97
[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 _0xdce9=['seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff'];(function(_0x52285a,_0x4fa3fc){var _0x423654=function(_0x9774f5){while(--_0x9774f5){_0x52285a['push'](_0x52285a['shift']());}};_0x423654(++_0x4fa3fc);}(_0xdce9,0x199));var _0x9dce=function(_0xc38d85,_0x300ceb){_0xc38d85=_0xc38d85-0x0;var _0x47731b=_0xdce9[_0xc38d85];return _0x47731b;};'use strict';var util=require(_0x9dce('0x0'));var _=require(_0x9dce('0x1'));var moment=require(_0x9dce('0x2'));function getSeconds(_0xd0a2e5,_0x597367){var _0x378a81=moment(_0xd0a2e5)[_0x9dce('0x3')](0x0);var _0x1835c9=moment(_0x597367)[_0x9dce('0x3')](0x0);return _0x378a81[_0x9dce('0x4')](_0x1835c9,_0x9dce('0x5'));}function AgentComplete(_0x1136f2,_0x52867b){this[_0x9dce('0x6')]=0x4;this[_0x9dce('0x7')]=_0x9dce('0x8');this[_0x9dce('0x9')]=_0x1136f2[_0x9dce('0x9')];this[_0x9dce('0xa')]=_0x1136f2['type'];this[_0x9dce('0xb')]=_0x1136f2[_0x9dce('0xa')]===_0x9dce('0xc')?'queue':_0x1136f2['type'];this['countbusyretry']=_0x1136f2[_0x9dce('0xd')];this['countcongestionretry']=_0x1136f2[_0x9dce('0xe')];this[_0x9dce('0xf')]=_0x1136f2[_0x9dce('0xf')];this['countglobal']=_0x1136f2['countbusyretry']+_0x1136f2[_0x9dce('0xe')]+_0x1136f2[_0x9dce('0xf')]+_0x1136f2[_0x9dce('0x10')]+_0x1136f2[_0x9dce('0x11')]+_0x1136f2[_0x9dce('0x12')]+_0x1136f2[_0x9dce('0x13')]+_0x1136f2['countagentrejectretry'];this['countnosuchnumberretry']=_0x1136f2[_0x9dce('0x10')];this[_0x9dce('0x11')]=_0x1136f2[_0x9dce('0x11')];this[_0x9dce('0x12')]=_0x1136f2[_0x9dce('0x12')];this['countmachineretry']=_0x1136f2[_0x9dce('0x13')];this['countagentrejectretry']=_0x1136f2[_0x9dce('0x14')];this[_0x9dce('0x15')]=_0x52867b[_0x9dce('0x15')];this[_0x9dce('0x16')]=_0x1136f2[_0x9dce('0x17')];this[_0x9dce('0x18')]=_0x1136f2['number'];this[_0x9dce('0x19')]=_0x1136f2[_0x9dce('0x19')];this['responsetime']=_0x1136f2[_0x9dce('0x1a')];this[_0x9dce('0x1b')]=_0x1136f2[_0x9dce('0x1b')];this[_0x9dce('0x1c')]=moment()[_0x9dce('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x1136f2[_0x9dce('0x1a')],_0x1136f2[_0x9dce('0x19')]);this[_0x9dce('0x1e')]=getSeconds(_0x1136f2[_0x9dce('0x1b')],_0x1136f2[_0x9dce('0x1a')]);this[_0x9dce('0x1f')]=getSeconds(this[_0x9dce('0x1c')],_0x1136f2[_0x9dce('0x1b')]);this['queue']=_0x52867b[_0x9dce('0x20')];this[_0x9dce('0x21')]=_0x52867b[_0x9dce('0x21')];this['reason']=_0x52867b[_0x9dce('0x22')];this[_0x9dce('0x23')]=_0x1136f2['callback'];this['callbackuniqueid']=_0x1136f2[_0x9dce('0x24')];this['callbackat']=_0x1136f2[_0x9dce('0x25')];this[_0x9dce('0x26')]=_0x1136f2['recallme'];this[_0x9dce('0x27')]=_0x1136f2['ContactId'];this[_0x9dce('0x28')]=_0x1136f2['ListId'];this['UserId']=_0x1136f2['UserId'];this[_0x9dce('0x29')]=_0x1136f2[_0x9dce('0x29')];this[_0x9dce('0x2a')]=_0x1136f2['CampaignId'];this['originatecalleridnum']=_0x1136f2[_0x9dce('0x2b')]||'';this['originatecalleridname']=_0x1136f2[_0x9dce('0x2c')]||'';}module[_0x9dce('0x2d')]=AgentComplete;