Built motion from commit (unavailable).|2.3.1
[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 _0xe1d6=['lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','voiceDialReport','membername','endtime','starttime','outbound','dialstring','uniqueid','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x4dedc5,_0x771d24){var _0x1c36a9=function(_0x24b9eb){while(--_0x24b9eb){_0x4dedc5['push'](_0x4dedc5['shift']());}};_0x1c36a9(++_0x771d24);}(_0xe1d6,0x1a9));var _0x6e1d=function(_0x304d85,_0x3bd383){_0x304d85=_0x304d85-0x0;var _0x570077=_0xe1d6[_0x304d85];return _0x570077;};'use strict';var moment=require('moment');var _=require(_0x6e1d('0x0'));var util=require(_0x6e1d('0x1'));var client=require(_0x6e1d('0x2'));exports[_0x6e1d('0x3')]=function(_0x2bea68){var _0x19e9df=_0x2bea68[_0x6e1d('0x4')]||_0x2bea68[_0x6e1d('0x5')];return client[_0x6e1d('0x6')](_0x6e1d('0x7'),{'body':{'channel':_0x6e1d('0x8'),'membername':_0x2bea68[_0x6e1d('0x9')],'interface':_[_0x6e1d('0xa')](_0x2bea68[_0x6e1d('0xb')])?util[_0x6e1d('0xc')](_0x6e1d('0xd'),_0x2bea68['lastAssignedTo']):_0x2bea68['interface'],'type':_0x6e1d('0xe'),'enterAt':_0x2bea68[_0x6e1d('0xf')],'exitAt':_0x19e9df,'duration':moment(_0x19e9df)[_0x6e1d('0x10')](_0x2bea68[_0x6e1d('0xf')],_0x6e1d('0x11')),'data1':_0x6e1d('0x12'),'data2':_0x2bea68[_0x6e1d('0x13')],'data3':_0x2bea68[_0x6e1d('0x14')],'data4':null,'data5':_0x2bea68[_0x6e1d('0x15')],'role':_0x6e1d('0x16'),'internal':_0x2bea68[_0x6e1d('0x17')]?_['toNumber'](_0x2bea68[_0x6e1d('0x17')]):undefined,'uniqueid':_0x2bea68['uniqueid']},'log':_0x6e1d('0x7')});};exports[_0x6e1d('0x18')]=function(_0x3b0f05){return client[_0x6e1d('0x6')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3b0f05[_0x6e1d('0x19')],'interface':_0x3b0f05['interface'],'type':_0x6e1d('0xe'),'enterAt':_0x3b0f05['starttime'],'exitAt':_0x3b0f05['endtime'],'duration':moment(_0x3b0f05[_0x6e1d('0x1a')])['diff'](_0x3b0f05[_0x6e1d('0x1b')],_0x6e1d('0x11'))>=0x0?moment(_0x3b0f05[_0x6e1d('0x1a')])[_0x6e1d('0x10')](_0x3b0f05[_0x6e1d('0x1b')],'seconds'):null,'data1':_0x6e1d('0x1c'),'data2':_0x3b0f05['accountcode'],'data3':_0x3b0f05[_0x6e1d('0x14')],'data4':_0x3b0f05[_0x6e1d('0x1d')]||null,'role':_0x6e1d('0x16'),'internal':_0x3b0f05[_0x6e1d('0x17')]?_['toNumber'](_0x3b0f05[_0x6e1d('0x17')]):undefined,'uniqueid':_0x3b0f05[_0x6e1d('0x1e')]},'log':_0x6e1d('0x7')});};