Built motion from commit (unavailable).|2.5.21
[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 _0x55fa=['moment','lodash','util','voiceQueueReport','queuecallercompleteAt','CreateMemberReport','voice','lastAssignedTo','isNil','format','SIP/%s','interface','diff','inbound','exten','agent','accountcode','uniqueid','voiceDialReport','Request','membername','TALKING','starttime','endtime','seconds','outbound','toNumber'];(function(_0x19488e,_0x20ae6b){var _0x255e3d=function(_0x1ca994){while(--_0x1ca994){_0x19488e['push'](_0x19488e['shift']());}};_0x255e3d(++_0x20ae6b);}(_0x55fa,0x87));var _0xa55f=function(_0x8a7e59,_0x5efa06){_0x8a7e59=_0x8a7e59-0x0;var _0x14d10a=_0x55fa[_0x8a7e59];return _0x14d10a;};'use strict';var moment=require(_0xa55f('0x0'));var _=require(_0xa55f('0x1'));var util=require(_0xa55f('0x2'));var client=require('../client');exports[_0xa55f('0x3')]=function(_0x59521e){var _0x25dcce=_0x59521e[_0xa55f('0x4')]||_0x59521e['queuecallerexitAt'];return client['Request'](_0xa55f('0x5'),{'body':{'channel':_0xa55f('0x6'),'membername':_0x59521e[_0xa55f('0x7')],'interface':_[_0xa55f('0x8')](_0x59521e['interface'])?util[_0xa55f('0x9')](_0xa55f('0xa'),_0x59521e[_0xa55f('0x7')]):_0x59521e[_0xa55f('0xb')],'type':'TALKING','enterAt':_0x59521e['queuecallerleaveAt'],'exitAt':_0x25dcce,'duration':moment(_0x25dcce)[_0xa55f('0xc')](_0x59521e['queuecallerleaveAt'],'seconds'),'data1':_0xa55f('0xd'),'data2':_0x59521e['calleridnum'],'data3':_0x59521e[_0xa55f('0xe')],'data4':null,'data5':_0x59521e['queue'],'role':_0xa55f('0xf'),'internal':_0x59521e[_0xa55f('0x10')]?_['toNumber'](_0x59521e[_0xa55f('0x10')]):undefined,'uniqueid':_0x59521e[_0xa55f('0x11')]},'log':'CreateMemberReport'});};exports[_0xa55f('0x12')]=function(_0x4a230a){return client[_0xa55f('0x13')](_0xa55f('0x5'),{'body':{'channel':'voice','membername':_0x4a230a[_0xa55f('0x14')],'interface':_0x4a230a[_0xa55f('0xb')],'type':_0xa55f('0x15'),'enterAt':_0x4a230a[_0xa55f('0x16')],'exitAt':_0x4a230a[_0xa55f('0x17')],'duration':moment(_0x4a230a[_0xa55f('0x17')])[_0xa55f('0xc')](_0x4a230a[_0xa55f('0x16')],_0xa55f('0x18'))>=0x0?moment(_0x4a230a[_0xa55f('0x17')])[_0xa55f('0xc')](_0x4a230a['starttime'],_0xa55f('0x18')):null,'data1':_0xa55f('0x19'),'data2':_0x4a230a[_0xa55f('0x10')],'data3':_0x4a230a[_0xa55f('0xe')],'data4':_0x4a230a['dialstring']||null,'role':_0xa55f('0xf'),'internal':_0x4a230a[_0xa55f('0x10')]?_[_0xa55f('0x1a')](_0x4a230a[_0xa55f('0x10')]):undefined,'uniqueid':_0x4a230a[_0xa55f('0x11')]},'log':_0xa55f('0x5')});};