8cfdce11043e467cdee3fcaf13b8de81c7fec6ca
[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 _0xf8ef=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment','seconds','state','statedesc'];(function(_0x2f7c2e,_0x156bad){var _0x2289e9=function(_0x58693f){while(--_0x58693f){_0x2f7c2e['push'](_0x2f7c2e['shift']());}};_0x2289e9(++_0x156bad);}(_0xf8ef,0x14b));var _0xff8e=function(_0x1669d0,_0x599eb7){_0x1669d0=_0x1669d0-0x0;var _0x20c1af=_0xf8ef[_0x1669d0];return _0x20c1af;};'use strict';var util=require(_0xff8e('0x0'));var _=require('lodash');var moment=require(_0xff8e('0x1'));function getSeconds(_0x2a945a,_0x51234b){var _0x3942b3=moment(_0x2a945a)['milliseconds'](0x0);var _0x565479=moment(_0x51234b)['milliseconds'](0x0);return _0x3942b3['diff'](_0x565479,_0xff8e('0x2'));}function Hangup(_0x476c97,_0x50855b){this[_0xff8e('0x3')]=0x4;this[_0xff8e('0x4')]='Answer';this['scheduledat']=_0x476c97[_0xff8e('0x5')];this[_0xff8e('0x6')]=_0x476c97[_0xff8e('0x6')];this[_0xff8e('0x7')]=_0x476c97[_0xff8e('0x6')]==='outbound'?_0xff8e('0x8'):_0x476c97[_0xff8e('0x6')];this[_0xff8e('0x9')]=_0x476c97[_0xff8e('0x9')];this[_0xff8e('0xa')]=_0x476c97[_0xff8e('0xa')];this['countnoanswerretry']=_0x476c97[_0xff8e('0xb')];this[_0xff8e('0xc')]=_0x476c97[_0xff8e('0x9')]+_0x476c97[_0xff8e('0xa')]+_0x476c97[_0xff8e('0xb')]+_0x476c97['countnosuchnumberretry']+_0x476c97[_0xff8e('0xd')]+_0x476c97[_0xff8e('0xe')]+_0x476c97[_0xff8e('0xf')]+_0x476c97[_0xff8e('0x10')];this[_0xff8e('0x11')]=_0x476c97['countnosuchnumberretry'];this['countdropretry']=_0x476c97[_0xff8e('0xd')];this['countabandonedretry']=_0x476c97['countabandonedretry'];this[_0xff8e('0xf')]=_0x476c97[_0xff8e('0xf')];this[_0xff8e('0x10')]=_0x476c97[_0xff8e('0x10')];this[_0xff8e('0x12')]=_0x50855b['uniqueid'];this[_0xff8e('0x13')]=_0x476c97[_0xff8e('0x14')];this[_0xff8e('0x15')]=_0x476c97['number'];this[_0xff8e('0x16')]=_0x476c97[_0xff8e('0x16')];this['responsetime']=_0x476c97[_0xff8e('0x17')];this['endtime']=moment()[_0xff8e('0x18')](_0xff8e('0x19'));this[_0xff8e('0x1a')]=getSeconds(_0x476c97[_0xff8e('0x17')],_0x476c97[_0xff8e('0x16')]);this[_0xff8e('0x1b')]=0x0;this[_0xff8e('0x1c')]=getSeconds(this[_0xff8e('0x1d')],_0x476c97[_0xff8e('0x17')]);this[_0xff8e('0x8')]=_0x476c97[_0xff8e('0x8')];this[_0xff8e('0x1e')]=_0xff8e('0x1f');this['reason']=_0x50855b[_0xff8e('0x20')];this[_0xff8e('0x21')]=_0x476c97[_0xff8e('0x21')];this[_0xff8e('0x22')]=_0x476c97['callbackuniqueid'];this[_0xff8e('0x23')]=_0x476c97[_0xff8e('0x23')];this[_0xff8e('0x24')]=_0x476c97[_0xff8e('0x24')];this[_0xff8e('0x25')]=_0x476c97[_0xff8e('0x25')];this[_0xff8e('0x26')]=_0x476c97['ListId'];this[_0xff8e('0x27')]=_0x476c97[_0xff8e('0x27')];this[_0xff8e('0x28')]=_0x476c97[_0xff8e('0x28')];this[_0xff8e('0x29')]=_0x476c97[_0xff8e('0x29')];}module['exports']=Hangup;