Built motion from commit 87cd5f02.|2.5.48
[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 _0x2ddb=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','Answer'];(function(_0x45b506,_0x481de7){var _0x1fd9ec=function(_0x549918){while(--_0x549918){_0x45b506['push'](_0x45b506['shift']());}};_0x1fd9ec(++_0x481de7);}(_0x2ddb,0xd0));var _0xb2dd=function(_0x1e841f,_0x3731ee){_0x1e841f=_0x1e841f-0x0;var _0x3fa9ad=_0x2ddb[_0x1e841f];return _0x3fa9ad;};'use strict';var util=require(_0xb2dd('0x0'));var _=require(_0xb2dd('0x1'));var moment=require(_0xb2dd('0x2'));function getSeconds(_0x248c3b,_0xfa8065){var _0x77db67=moment(_0x248c3b)[_0xb2dd('0x3')](0x0);var _0x1c0a53=moment(_0xfa8065)[_0xb2dd('0x3')](0x0);return _0x77db67[_0xb2dd('0x4')](_0x1c0a53,_0xb2dd('0x5'));}function Hangup(_0x1e6640,_0x59fb8d){this['state']=0x4;this['statedesc']=_0xb2dd('0x6');this[_0xb2dd('0x7')]=_0x1e6640[_0xb2dd('0x7')];this[_0xb2dd('0x8')]=_0x1e6640[_0xb2dd('0x8')];this[_0xb2dd('0x9')]=_0x1e6640[_0xb2dd('0x8')]==='outbound'?_0xb2dd('0xa'):_0x1e6640['type'];this[_0xb2dd('0xb')]=_0x1e6640['countbusyretry'];this['countcongestionretry']=_0x1e6640[_0xb2dd('0xc')];this[_0xb2dd('0xd')]=_0x1e6640[_0xb2dd('0xd')];this[_0xb2dd('0xe')]=_0x1e6640['countbusyretry']+_0x1e6640[_0xb2dd('0xc')]+_0x1e6640[_0xb2dd('0xd')]+_0x1e6640[_0xb2dd('0xf')]+_0x1e6640[_0xb2dd('0x10')]+_0x1e6640[_0xb2dd('0x11')]+_0x1e6640['countmachineretry']+_0x1e6640[_0xb2dd('0x12')];this[_0xb2dd('0xf')]=_0x1e6640[_0xb2dd('0xf')];this['countdropretry']=_0x1e6640[_0xb2dd('0x10')];this[_0xb2dd('0x11')]=_0x1e6640['countabandonedretry'];this[_0xb2dd('0x13')]=_0x1e6640[_0xb2dd('0x13')];this[_0xb2dd('0x12')]=_0x1e6640['countagentrejectretry'];this[_0xb2dd('0x14')]=_0x59fb8d['uniqueid'];this[_0xb2dd('0x15')]=_0x1e6640['name'];this[_0xb2dd('0x16')]=_0x1e6640[_0xb2dd('0x17')];this['starttime']=_0x1e6640[_0xb2dd('0x18')];this[_0xb2dd('0x19')]=_0x1e6640[_0xb2dd('0x19')];this[_0xb2dd('0x1a')]=moment()['format'](_0xb2dd('0x1b'));this['ringtime']=getSeconds(_0x1e6640[_0xb2dd('0x19')],_0x1e6640[_0xb2dd('0x18')]);this['holdtime']=0x0;this[_0xb2dd('0x1c')]=getSeconds(this[_0xb2dd('0x1a')],_0x1e6640[_0xb2dd('0x19')]);this[_0xb2dd('0xa')]=_0x1e6640['queue'];this[_0xb2dd('0x1d')]=_0xb2dd('0x1e');this[_0xb2dd('0x1f')]=_0x59fb8d[_0xb2dd('0x20')];this[_0xb2dd('0x21')]=_0x1e6640[_0xb2dd('0x21')];this[_0xb2dd('0x22')]=_0x1e6640[_0xb2dd('0x22')];this[_0xb2dd('0x23')]=_0x1e6640[_0xb2dd('0x23')];this['recallme']=_0x1e6640[_0xb2dd('0x24')];this['ContactId']=_0x1e6640[_0xb2dd('0x25')];this[_0xb2dd('0x26')]=_0x1e6640['ListId'];this[_0xb2dd('0x27')]=_0x1e6640[_0xb2dd('0x27')];this[_0xb2dd('0x28')]=_0x1e6640[_0xb2dd('0x28')];this[_0xb2dd('0x29')]=_0x1e6640[_0xb2dd('0x29')];}module[_0xb2dd('0x2a')]=Hangup;