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