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