d4fbc4e5daf89eeef7bcdc89d3fdfc6076d43ffe
[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 _0x7085=['membername','IVR','cause-txt','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x7085,0x1a6));var _0x5708=function(_0x49fb87,_0x5d65bb){_0x49fb87=_0x49fb87-0x0;var _0x17db71=_0x7085[_0x49fb87];return _0x17db71;};'use strict';var util=require('util');var _=require(_0x5708('0x0'));var moment=require('moment');function getSeconds(_0x294326,_0x23d77e){var _0x484d34=moment(_0x294326)['milliseconds'](0x0);var _0xf33acc=moment(_0x23d77e)[_0x5708('0x1')](0x0);return _0x484d34['diff'](_0xf33acc,_0x5708('0x2'));}function Hangup(_0x10d409,_0x22e007){this[_0x5708('0x3')]=0x4;this[_0x5708('0x4')]=_0x5708('0x5');this['scheduledat']=_0x10d409[_0x5708('0x6')];this[_0x5708('0x7')]=_0x10d409['type'];this[_0x5708('0x8')]=_0x10d409[_0x5708('0x7')]===_0x5708('0x9')?_0x5708('0xa'):_0x10d409[_0x5708('0x7')];this[_0x5708('0xb')]=_0x10d409[_0x5708('0xb')];this[_0x5708('0xc')]=_0x10d409[_0x5708('0xc')];this[_0x5708('0xd')]=_0x10d409[_0x5708('0xd')];this[_0x5708('0xe')]=_0x10d409[_0x5708('0xb')]+_0x10d409['countcongestionretry']+_0x10d409[_0x5708('0xd')]+_0x10d409[_0x5708('0xf')]+_0x10d409[_0x5708('0x10')]+_0x10d409['countabandonedretry']+_0x10d409[_0x5708('0x11')]+_0x10d409[_0x5708('0x12')];this[_0x5708('0xf')]=_0x10d409[_0x5708('0xf')];this[_0x5708('0x10')]=_0x10d409[_0x5708('0x10')];this['countabandonedretry']=_0x10d409['countabandonedretry'];this[_0x5708('0x11')]=_0x10d409[_0x5708('0x11')];this[_0x5708('0x12')]=_0x10d409[_0x5708('0x12')];this[_0x5708('0x13')]=_0x22e007[_0x5708('0x13')];this['calleridname']=_0x10d409[_0x5708('0x14')];this['calleridnum']=_0x10d409[_0x5708('0x15')];this[_0x5708('0x16')]=_0x10d409[_0x5708('0x16')];this[_0x5708('0x17')]=_0x10d409[_0x5708('0x17')];this[_0x5708('0x18')]=moment()[_0x5708('0x19')](_0x5708('0x1a'));this[_0x5708('0x1b')]=getSeconds(_0x10d409[_0x5708('0x17')],_0x10d409[_0x5708('0x16')]);this[_0x5708('0x1c')]=0x0;this['talktime']=getSeconds(this[_0x5708('0x18')],_0x10d409['responsetime']);this[_0x5708('0xa')]=_0x10d409['queue'];this[_0x5708('0x1d')]=_0x5708('0x1e');this['reason']=_0x22e007[_0x5708('0x1f')];this[_0x5708('0x20')]=_0x10d409[_0x5708('0x20')];this[_0x5708('0x21')]=_0x10d409[_0x5708('0x21')];this['callbackat']=_0x10d409['callbackat'];this[_0x5708('0x22')]=_0x10d409[_0x5708('0x22')];this[_0x5708('0x23')]=_0x10d409[_0x5708('0x23')];this[_0x5708('0x24')]=_0x10d409[_0x5708('0x24')];this[_0x5708('0x25')]=_0x10d409[_0x5708('0x25')];this[_0x5708('0x26')]=_0x10d409[_0x5708('0x26')];this[_0x5708('0x27')]=_0x10d409[_0x5708('0x27')];}module[_0x5708('0x28')]=Hangup;