7b2de03a3b97505e9a6419bbe8130a5f45f80f5d
[motion2.git] / server / services / ami / rpc / memberReport.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 _0x6a45=['isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','agent','accountcode','toNumber','voiceDialReport','voice','starttime','endtime','dialstring','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x6a45,0x147));var _0x56a4=function(_0x1d1083,_0x2474d7){_0x1d1083=_0x1d1083-0x0;var _0x517e2c=_0x6a45[_0x1d1083];return _0x517e2c;};'use strict';var moment=require(_0x56a4('0x0'));var _=require(_0x56a4('0x1'));var util=require(_0x56a4('0x2'));var client=require(_0x56a4('0x3'));exports['voiceQueueReport']=function(_0x75be9b){var _0x34796a=_0x75be9b[_0x56a4('0x4')]||_0x75be9b[_0x56a4('0x5')];return client[_0x56a4('0x6')](_0x56a4('0x7'),{'body':{'channel':'voice','membername':_0x75be9b[_0x56a4('0x8')],'interface':_[_0x56a4('0x9')](_0x75be9b[_0x56a4('0xa')])?util[_0x56a4('0xb')](_0x56a4('0xc'),_0x75be9b['lastAssignedTo']):_0x75be9b[_0x56a4('0xa')],'type':_0x56a4('0xd'),'enterAt':_0x75be9b[_0x56a4('0xe')],'exitAt':_0x34796a,'duration':moment(_0x34796a)[_0x56a4('0xf')](_0x75be9b['queuecallerleaveAt'],_0x56a4('0x10')),'data1':'inbound','data2':_0x75be9b[_0x56a4('0x11')],'data3':_0x75be9b[_0x56a4('0x12')],'data4':null,'data5':_0x75be9b[_0x56a4('0x13')],'role':_0x56a4('0x14'),'internal':_0x75be9b[_0x56a4('0x15')]?_[_0x56a4('0x16')](_0x75be9b[_0x56a4('0x15')]):undefined,'uniqueid':_0x75be9b['uniqueid']},'log':_0x56a4('0x7')});};exports[_0x56a4('0x17')]=function(_0x45b4c7){return client['Request'](_0x56a4('0x7'),{'body':{'channel':_0x56a4('0x18'),'membername':_0x45b4c7['membername'],'interface':_0x45b4c7[_0x56a4('0xa')],'type':_0x56a4('0xd'),'enterAt':_0x45b4c7[_0x56a4('0x19')],'exitAt':_0x45b4c7[_0x56a4('0x1a')],'duration':moment(_0x45b4c7[_0x56a4('0x1a')])[_0x56a4('0xf')](_0x45b4c7['starttime'],'seconds')>=0x0?moment(_0x45b4c7[_0x56a4('0x1a')])[_0x56a4('0xf')](_0x45b4c7['starttime'],_0x56a4('0x10')):null,'data1':'outbound','data2':_0x45b4c7[_0x56a4('0x15')],'data3':_0x45b4c7[_0x56a4('0x12')],'data4':_0x45b4c7[_0x56a4('0x1b')]||null,'role':_0x56a4('0x14'),'internal':_0x45b4c7[_0x56a4('0x15')]?_[_0x56a4('0x16')](_0x45b4c7['accountcode']):undefined,'uniqueid':_0x45b4c7['uniqueid']},'log':'CreateMemberReport'});};