Built motion from commit e6806ed6.|2.6.0
[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 _0xc3bb=['exports','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x22e30e,_0x226251){var _0xaca7f5=function(_0x3e2a44){while(--_0x3e2a44){_0x22e30e['push'](_0x22e30e['shift']());}};_0xaca7f5(++_0x226251);}(_0xc3bb,0xad));var _0xbc3b=function(_0xa54104,_0x154839){_0xa54104=_0xa54104-0x0;var _0x10933f=_0xc3bb[_0xa54104];return _0x10933f;};'use strict';var util=require('util');var _=require(_0xbc3b('0x0'));var moment=require(_0xbc3b('0x1'));function getSeconds(_0x2698d9,_0x3726fb){var _0x50fcae=moment(_0x2698d9)[_0xbc3b('0x2')](0x0);var _0x4c482e=moment(_0x3726fb)[_0xbc3b('0x2')](0x0);return _0x50fcae['diff'](_0x4c482e,_0xbc3b('0x3'));}function AgentComplete(_0x85f28a,_0x554d54){this[_0xbc3b('0x4')]=0x4;this[_0xbc3b('0x5')]='Answer';this[_0xbc3b('0x6')]=_0x85f28a[_0xbc3b('0x6')];this[_0xbc3b('0x7')]=_0x85f28a[_0xbc3b('0x7')];this['campaigntype']=_0x85f28a[_0xbc3b('0x7')]===_0xbc3b('0x8')?_0xbc3b('0x9'):_0x85f28a['type'];this[_0xbc3b('0xa')]=_0x85f28a[_0xbc3b('0xa')];this[_0xbc3b('0xb')]=_0x85f28a[_0xbc3b('0xb')];this[_0xbc3b('0xc')]=_0x85f28a[_0xbc3b('0xc')];this[_0xbc3b('0xd')]=_0x85f28a['countbusyretry']+_0x85f28a[_0xbc3b('0xb')]+_0x85f28a[_0xbc3b('0xc')]+_0x85f28a['countnosuchnumberretry']+_0x85f28a[_0xbc3b('0xe')]+_0x85f28a[_0xbc3b('0xf')]+_0x85f28a[_0xbc3b('0x10')]+_0x85f28a[_0xbc3b('0x11')];this[_0xbc3b('0x12')]=_0x85f28a[_0xbc3b('0x12')];this[_0xbc3b('0xe')]=_0x85f28a[_0xbc3b('0xe')];this['countabandonedretry']=_0x85f28a[_0xbc3b('0xf')];this[_0xbc3b('0x10')]=_0x85f28a[_0xbc3b('0x10')];this[_0xbc3b('0x11')]=_0x85f28a['countagentrejectretry'];this['uniqueid']=_0x554d54['uniqueid'];this[_0xbc3b('0x13')]=_0x85f28a['name'];this[_0xbc3b('0x14')]=_0x85f28a[_0xbc3b('0x15')];this[_0xbc3b('0x16')]=_0x85f28a[_0xbc3b('0x16')];this[_0xbc3b('0x17')]=_0x85f28a['responsetime'];this[_0xbc3b('0x18')]=_0x85f28a[_0xbc3b('0x18')];this[_0xbc3b('0x19')]=moment()[_0xbc3b('0x1a')](_0xbc3b('0x1b'));this[_0xbc3b('0x1c')]=getSeconds(_0x85f28a[_0xbc3b('0x17')],_0x85f28a[_0xbc3b('0x16')]);this['holdtime']=getSeconds(_0x85f28a[_0xbc3b('0x18')],_0x85f28a[_0xbc3b('0x17')]);this[_0xbc3b('0x1d')]=getSeconds(this[_0xbc3b('0x19')],_0x85f28a[_0xbc3b('0x18')]);this[_0xbc3b('0x9')]=_0x554d54[_0xbc3b('0x9')];this[_0xbc3b('0x1e')]=_0x554d54['membername'];this[_0xbc3b('0x1f')]=_0x554d54[_0xbc3b('0x1f')];this[_0xbc3b('0x20')]=_0x85f28a[_0xbc3b('0x20')];this[_0xbc3b('0x21')]=_0x85f28a['callbackuniqueid'];this['callbackat']=_0x85f28a[_0xbc3b('0x22')];this['recallme']=_0x85f28a['recallme'];this[_0xbc3b('0x23')]=_0x85f28a[_0xbc3b('0x23')];this[_0xbc3b('0x24')]=_0x85f28a[_0xbc3b('0x24')];this[_0xbc3b('0x25')]=_0x85f28a[_0xbc3b('0x25')];this[_0xbc3b('0x26')]=_0x85f28a['VoiceQueueId'];this[_0xbc3b('0x27')]=_0x85f28a[_0xbc3b('0x27')];this[_0xbc3b('0x28')]=_0x85f28a[_0xbc3b('0x28')]||'';this[_0xbc3b('0x29')]=_0x85f28a['originatecalleridname']||'';}module[_0xbc3b('0x2a')]=AgentComplete;