Built motion from commit (unavailable).|2.5.3
[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 _0x5f0d=['queue','membername','IVR','reason','cause-txt','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','endtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f0d,0x1e6));var _0xd5f0=function(_0x3eb82e,_0x31dbfc){_0x3eb82e=_0x3eb82e-0x0;var _0x9c103d=_0x5f0d[_0x3eb82e];return _0x9c103d;};'use strict';var util=require('util');var _=require(_0xd5f0('0x0'));var moment=require('moment');function getSeconds(_0x47edf7,_0x46bbfe){var _0x44b90b=moment(_0x47edf7)[_0xd5f0('0x1')](0x0);var _0x3f8fe9=moment(_0x46bbfe)[_0xd5f0('0x1')](0x0);return _0x44b90b[_0xd5f0('0x2')](_0x3f8fe9,_0xd5f0('0x3'));}function Hangup(_0x122986,_0x820cc8){this[_0xd5f0('0x4')]=0x4;this[_0xd5f0('0x5')]='Answer';this['scheduledat']=_0x122986[_0xd5f0('0x6')];this[_0xd5f0('0x7')]=_0x122986[_0xd5f0('0x7')];this[_0xd5f0('0x8')]=_0x122986['type']===_0xd5f0('0x9')?'queue':_0x122986['type'];this[_0xd5f0('0xa')]=_0x122986['countbusyretry'];this[_0xd5f0('0xb')]=_0x122986[_0xd5f0('0xb')];this['countnoanswerretry']=_0x122986[_0xd5f0('0xc')];this[_0xd5f0('0xd')]=_0x122986['countbusyretry']+_0x122986[_0xd5f0('0xb')]+_0x122986[_0xd5f0('0xc')]+_0x122986['countnosuchnumberretry']+_0x122986[_0xd5f0('0xe')]+_0x122986[_0xd5f0('0xf')]+_0x122986[_0xd5f0('0x10')]+_0x122986['countagentrejectretry'];this[_0xd5f0('0x11')]=_0x122986[_0xd5f0('0x11')];this[_0xd5f0('0xe')]=_0x122986[_0xd5f0('0xe')];this['countabandonedretry']=_0x122986[_0xd5f0('0xf')];this[_0xd5f0('0x10')]=_0x122986['countmachineretry'];this[_0xd5f0('0x12')]=_0x122986[_0xd5f0('0x12')];this[_0xd5f0('0x13')]=_0x820cc8[_0xd5f0('0x13')];this[_0xd5f0('0x14')]=_0x122986[_0xd5f0('0x15')];this[_0xd5f0('0x16')]=_0x122986[_0xd5f0('0x17')];this[_0xd5f0('0x18')]=_0x122986[_0xd5f0('0x18')];this[_0xd5f0('0x19')]=_0x122986[_0xd5f0('0x19')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd5f0('0x1a')]=getSeconds(_0x122986[_0xd5f0('0x19')],_0x122986[_0xd5f0('0x18')]);this[_0xd5f0('0x1b')]=0x0;this[_0xd5f0('0x1c')]=getSeconds(this[_0xd5f0('0x1d')],_0x122986[_0xd5f0('0x19')]);this['queue']=_0x122986[_0xd5f0('0x1e')];this[_0xd5f0('0x1f')]=_0xd5f0('0x20');this[_0xd5f0('0x21')]=_0x820cc8[_0xd5f0('0x22')];this['callback']=_0x122986['callback'];this[_0xd5f0('0x23')]=_0x122986['callbackuniqueid'];this[_0xd5f0('0x24')]=_0x122986[_0xd5f0('0x24')];this['recallme']=_0x122986['recallme'];this[_0xd5f0('0x25')]=_0x122986[_0xd5f0('0x25')];this[_0xd5f0('0x26')]=_0x122986[_0xd5f0('0x26')];this[_0xd5f0('0x27')]=_0x122986['UserId'];this[_0xd5f0('0x28')]=_0x122986[_0xd5f0('0x28')];this[_0xd5f0('0x29')]=_0x122986['CampaignId'];}module[_0xd5f0('0x2a')]=Hangup;