Built motion from commit 67e5df37.|2.0.68
[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 _0x5a31=['state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','queue','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff'];(function(_0x26a327,_0x29a5aa){var _0x3eef87=function(_0x365878){while(--_0x365878){_0x26a327['push'](_0x26a327['shift']());}};_0x3eef87(++_0x29a5aa);}(_0x5a31,0x12b));var _0x15a3=function(_0x1eed54,_0x4e134f){_0x1eed54=_0x1eed54-0x0;var _0x3f76b9=_0x5a31[_0x1eed54];return _0x3f76b9;};'use strict';var util=require(_0x15a3('0x0'));var _=require(_0x15a3('0x1'));var moment=require(_0x15a3('0x2'));function getSeconds(_0xf3360d,_0x3ad0e7){var _0x358176=moment(_0xf3360d)[_0x15a3('0x3')](0x0);var _0x49cd3c=moment(_0x3ad0e7)['milliseconds'](0x0);return _0x358176[_0x15a3('0x4')](_0x49cd3c,'seconds');}function AgentComplete(_0xb7a8e2,_0x75394b){this[_0x15a3('0x5')]=0x4;this[_0x15a3('0x6')]=_0x15a3('0x7');this[_0x15a3('0x8')]=_0xb7a8e2[_0x15a3('0x8')];this[_0x15a3('0x9')]=_0xb7a8e2[_0x15a3('0x9')];this['campaigntype']=_0xb7a8e2[_0x15a3('0x9')]==='outbound'?'queue':_0xb7a8e2[_0x15a3('0x9')];this[_0x15a3('0xa')]=_0xb7a8e2['countbusyretry'];this[_0x15a3('0xb')]=_0xb7a8e2['countcongestionretry'];this[_0x15a3('0xc')]=_0xb7a8e2[_0x15a3('0xc')];this[_0x15a3('0xd')]=_0xb7a8e2[_0x15a3('0xa')]+_0xb7a8e2[_0x15a3('0xb')]+_0xb7a8e2[_0x15a3('0xc')];this[_0x15a3('0xe')]=_0x75394b[_0x15a3('0xe')];this[_0x15a3('0xf')]=_0xb7a8e2[_0x15a3('0x10')];this[_0x15a3('0x11')]=_0xb7a8e2['number'];this[_0x15a3('0x12')]=_0xb7a8e2['starttime'];this[_0x15a3('0x13')]=_0xb7a8e2[_0x15a3('0x13')];this[_0x15a3('0x14')]=_0xb7a8e2[_0x15a3('0x14')];this['endtime']=moment()[_0x15a3('0x15')](_0x15a3('0x16'));this[_0x15a3('0x17')]=getSeconds(_0xb7a8e2['responsetime'],_0xb7a8e2['starttime']);this[_0x15a3('0x18')]=getSeconds(_0xb7a8e2[_0x15a3('0x14')],_0xb7a8e2['responsetime']);this[_0x15a3('0x19')]=getSeconds(this[_0x15a3('0x1a')],_0xb7a8e2[_0x15a3('0x14')]);this[_0x15a3('0x1b')]=_0x75394b['queue'];this['membername']=_0x75394b['membername'];this['reason']=_0x75394b[_0x15a3('0x1c')];this[_0x15a3('0x1d')]=_0xb7a8e2[_0x15a3('0x1d')];this['callbackuniqueid']=_0xb7a8e2['callbackuniqueid'];this[_0x15a3('0x1e')]=_0xb7a8e2[_0x15a3('0x1e')];this[_0x15a3('0x1f')]=_0xb7a8e2[_0x15a3('0x1f')];this['ContactId']=_0xb7a8e2[_0x15a3('0x20')];this[_0x15a3('0x21')]=_0xb7a8e2[_0x15a3('0x21')];this[_0x15a3('0x22')]=_0xb7a8e2['UserId'];this[_0x15a3('0x23')]=_0xb7a8e2[_0x15a3('0x23')];this[_0x15a3('0x24')]=_0xb7a8e2['CampaignId'];}module[_0x15a3('0x25')]=AgentComplete;