Built motion from commit 85328c08.|2.5.50
[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 _0x9b12=['moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash'];(function(_0x193f83,_0x5d25ba){var _0x55bdc9=function(_0x2f1e31){while(--_0x2f1e31){_0x193f83['push'](_0x193f83['shift']());}};_0x55bdc9(++_0x5d25ba);}(_0x9b12,0x1d8));var _0x29b1=function(_0x406089,_0x57017c){_0x406089=_0x406089-0x0;var _0x451282=_0x9b12[_0x406089];return _0x451282;};'use strict';var util=require('util');var _=require(_0x29b1('0x0'));var moment=require(_0x29b1('0x1'));function getSeconds(_0x347f35,_0x208f05){var _0x58c5cd=moment(_0x347f35)[_0x29b1('0x2')](0x0);var _0x1e8532=moment(_0x208f05)['milliseconds'](0x0);return _0x58c5cd[_0x29b1('0x3')](_0x1e8532,_0x29b1('0x4'));}function AgentComplete(_0x344d90,_0x182c2e){this[_0x29b1('0x5')]=0x4;this[_0x29b1('0x6')]=_0x29b1('0x7');this[_0x29b1('0x8')]=_0x344d90[_0x29b1('0x8')];this[_0x29b1('0x9')]=_0x344d90[_0x29b1('0x9')];this['campaigntype']=_0x344d90[_0x29b1('0x9')]===_0x29b1('0xa')?_0x29b1('0xb'):_0x344d90['type'];this['countbusyretry']=_0x344d90[_0x29b1('0xc')];this['countcongestionretry']=_0x344d90['countcongestionretry'];this['countnoanswerretry']=_0x344d90[_0x29b1('0xd')];this[_0x29b1('0xe')]=_0x344d90[_0x29b1('0xc')]+_0x344d90[_0x29b1('0xf')]+_0x344d90[_0x29b1('0xd')]+_0x344d90['countnosuchnumberretry']+_0x344d90[_0x29b1('0x10')]+_0x344d90['countabandonedretry']+_0x344d90[_0x29b1('0x11')]+_0x344d90[_0x29b1('0x12')];this['countnosuchnumberretry']=_0x344d90[_0x29b1('0x13')];this[_0x29b1('0x10')]=_0x344d90[_0x29b1('0x10')];this['countabandonedretry']=_0x344d90['countabandonedretry'];this[_0x29b1('0x11')]=_0x344d90['countmachineretry'];this[_0x29b1('0x12')]=_0x344d90['countagentrejectretry'];this[_0x29b1('0x14')]=_0x182c2e['uniqueid'];this[_0x29b1('0x15')]=_0x344d90[_0x29b1('0x16')];this[_0x29b1('0x17')]=_0x344d90[_0x29b1('0x18')];this[_0x29b1('0x19')]=_0x344d90[_0x29b1('0x19')];this[_0x29b1('0x1a')]=_0x344d90['responsetime'];this['answertime']=_0x344d90[_0x29b1('0x1b')];this[_0x29b1('0x1c')]=moment()['format'](_0x29b1('0x1d'));this['ringtime']=getSeconds(_0x344d90[_0x29b1('0x1a')],_0x344d90[_0x29b1('0x19')]);this['holdtime']=getSeconds(_0x344d90[_0x29b1('0x1b')],_0x344d90[_0x29b1('0x1a')]);this['talktime']=getSeconds(this[_0x29b1('0x1c')],_0x344d90[_0x29b1('0x1b')]);this[_0x29b1('0xb')]=_0x182c2e[_0x29b1('0xb')];this['membername']=_0x182c2e[_0x29b1('0x1e')];this[_0x29b1('0x1f')]=_0x182c2e[_0x29b1('0x1f')];this[_0x29b1('0x20')]=_0x344d90[_0x29b1('0x20')];this[_0x29b1('0x21')]=_0x344d90['callbackuniqueid'];this['callbackat']=_0x344d90[_0x29b1('0x22')];this[_0x29b1('0x23')]=_0x344d90[_0x29b1('0x23')];this['ContactId']=_0x344d90['ContactId'];this[_0x29b1('0x24')]=_0x344d90[_0x29b1('0x24')];this[_0x29b1('0x25')]=_0x344d90['UserId'];this[_0x29b1('0x26')]=_0x344d90[_0x29b1('0x26')];this[_0x29b1('0x27')]=_0x344d90[_0x29b1('0x27')];this['originatecalleridnum']=_0x344d90[_0x29b1('0x28')]||'';this[_0x29b1('0x29')]=_0x344d90['originatecalleridname']||'';}module[_0x29b1('0x2a')]=AgentComplete;