Built motion from commit 1ea47bf4.|2.6.34
[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 _0x1eb4=['toNumber','moment','lodash','util','../client','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','SIP/%s','TALKING','diff','seconds','calleridnum','exten','queue','agent','accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','outbound','dialstring'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x1eb4,0xa9));var _0x41eb=function(_0x20d400,_0x417891){_0x20d400=_0x20d400-0x0;var _0x3a99ab=_0x1eb4[_0x20d400];return _0x3a99ab;};'use strict';var moment=require(_0x41eb('0x0'));var _=require(_0x41eb('0x1'));var util=require(_0x41eb('0x2'));var client=require(_0x41eb('0x3'));exports['voiceQueueReport']=function(_0x367613){var _0xe1b671=_0x367613[_0x41eb('0x4')]||_0x367613['queuecallerexitAt'];return client[_0x41eb('0x5')](_0x41eb('0x6'),{'body':{'channel':'voice','membername':_0x367613[_0x41eb('0x7')],'interface':_[_0x41eb('0x8')](_0x367613[_0x41eb('0x9')])?util['format'](_0x41eb('0xa'),_0x367613['lastAssignedTo']):_0x367613['interface'],'type':_0x41eb('0xb'),'enterAt':_0x367613['queuecallerleaveAt'],'exitAt':_0xe1b671,'duration':moment(_0xe1b671)[_0x41eb('0xc')](_0x367613['queuecallerleaveAt'],_0x41eb('0xd')),'data1':'inbound','data2':_0x367613[_0x41eb('0xe')],'data3':_0x367613[_0x41eb('0xf')],'data4':null,'data5':_0x367613[_0x41eb('0x10')],'role':_0x41eb('0x11'),'internal':_0x367613[_0x41eb('0x12')]?_['toNumber'](_0x367613[_0x41eb('0x12')]):undefined,'uniqueid':_0x367613[_0x41eb('0x13')]},'log':_0x41eb('0x6')});};exports[_0x41eb('0x14')]=function(_0x21443f){return client[_0x41eb('0x5')](_0x41eb('0x6'),{'body':{'channel':_0x41eb('0x15'),'membername':_0x21443f[_0x41eb('0x16')],'interface':_0x21443f[_0x41eb('0x9')],'type':_0x41eb('0xb'),'enterAt':_0x21443f[_0x41eb('0x17')],'exitAt':_0x21443f['endtime'],'duration':moment(_0x21443f[_0x41eb('0x18')])[_0x41eb('0xc')](_0x21443f['starttime'],_0x41eb('0xd'))>=0x0?moment(_0x21443f[_0x41eb('0x18')])['diff'](_0x21443f[_0x41eb('0x17')],'seconds'):null,'data1':_0x41eb('0x19'),'data2':_0x21443f[_0x41eb('0x12')],'data3':_0x21443f[_0x41eb('0xf')],'data4':_0x21443f[_0x41eb('0x1a')]||null,'role':_0x41eb('0x11'),'internal':_0x21443f[_0x41eb('0x12')]?_[_0x41eb('0x1b')](_0x21443f[_0x41eb('0x12')]):undefined,'uniqueid':_0x21443f[_0x41eb('0x13')]},'log':_0x41eb('0x6')});};