6aa5f71ed6940fb6276b2512c614a103c3ea9eb8
[motion2.git] / server / services / ami / dialer / hangup.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 _0x6516=['Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','starttime','holdtime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','state','statedesc'];(function(_0x51a542,_0x541222){var _0x22d761=function(_0x981ada){while(--_0x981ada){_0x51a542['push'](_0x51a542['shift']());}};_0x22d761(++_0x541222);}(_0x6516,0x18e));var _0x6651=function(_0x1726e7,_0x4e6e8a){_0x1726e7=_0x1726e7-0x0;var _0x399324=_0x6516[_0x1726e7];return _0x399324;};'use strict';var util=require(_0x6651('0x0'));var _=require('lodash');var moment=require(_0x6651('0x1'));function getSeconds(_0x508154,_0x5f0531){var _0xa77d3c=moment(_0x508154)['milliseconds'](0x0);var _0x4fe8a8=moment(_0x5f0531)[_0x6651('0x2')](0x0);return _0xa77d3c[_0x6651('0x3')](_0x4fe8a8,_0x6651('0x4'));}function Hangup(_0x1c60ac,_0xe877ae){this[_0x6651('0x5')]=0x4;this[_0x6651('0x6')]=_0x6651('0x7');this[_0x6651('0x8')]=_0x1c60ac[_0x6651('0x8')];this[_0x6651('0x9')]=_0x1c60ac[_0x6651('0x9')];this[_0x6651('0xa')]=_0x1c60ac[_0x6651('0x9')]==='outbound'?'queue':_0x1c60ac[_0x6651('0x9')];this[_0x6651('0xb')]=_0x1c60ac[_0x6651('0xb')];this[_0x6651('0xc')]=_0x1c60ac[_0x6651('0xc')];this['countnoanswerretry']=_0x1c60ac[_0x6651('0xd')];this[_0x6651('0xe')]=_0x1c60ac['countbusyretry']+_0x1c60ac[_0x6651('0xc')]+_0x1c60ac[_0x6651('0xd')]+_0x1c60ac[_0x6651('0xf')]+_0x1c60ac[_0x6651('0x10')]+_0x1c60ac[_0x6651('0x11')]+_0x1c60ac[_0x6651('0x12')]+_0x1c60ac[_0x6651('0x13')];this['countnosuchnumberretry']=_0x1c60ac[_0x6651('0xf')];this['countdropretry']=_0x1c60ac[_0x6651('0x10')];this['countabandonedretry']=_0x1c60ac[_0x6651('0x11')];this[_0x6651('0x12')]=_0x1c60ac[_0x6651('0x12')];this[_0x6651('0x13')]=_0x1c60ac[_0x6651('0x13')];this[_0x6651('0x14')]=_0xe877ae[_0x6651('0x14')];this[_0x6651('0x15')]=_0x1c60ac[_0x6651('0x16')];this[_0x6651('0x17')]=_0x1c60ac[_0x6651('0x18')];this['starttime']=_0x1c60ac['starttime'];this[_0x6651('0x19')]=_0x1c60ac[_0x6651('0x19')];this[_0x6651('0x1a')]=moment()[_0x6651('0x1b')](_0x6651('0x1c'));this['ringtime']=getSeconds(_0x1c60ac['responsetime'],_0x1c60ac[_0x6651('0x1d')]);this[_0x6651('0x1e')]=0x0;this['talktime']=getSeconds(this[_0x6651('0x1a')],_0x1c60ac[_0x6651('0x19')]);this['queue']=_0x1c60ac[_0x6651('0x1f')];this[_0x6651('0x20')]='IVR';this[_0x6651('0x21')]=_0xe877ae[_0x6651('0x22')];this['callback']=_0x1c60ac[_0x6651('0x23')];this[_0x6651('0x24')]=_0x1c60ac[_0x6651('0x24')];this[_0x6651('0x25')]=_0x1c60ac['callbackat'];this[_0x6651('0x26')]=_0x1c60ac['recallme'];this['ContactId']=_0x1c60ac[_0x6651('0x27')];this[_0x6651('0x28')]=_0x1c60ac[_0x6651('0x28')];this[_0x6651('0x29')]=_0x1c60ac[_0x6651('0x29')];this[_0x6651('0x2a')]=_0x1c60ac[_0x6651('0x2a')];this[_0x6651('0x2b')]=_0x1c60ac[_0x6651('0x2b')];}module[_0x6651('0x2c')]=Hangup;