Built motion from commit 616d3211.|2.6.4
[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 _0xdda9=['endtime','starttime','exten','dialstring','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','queuecallerleaveAt','diff','seconds','inbound','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','interface','TALKING'];(function(_0x314972,_0x557a0d){var _0x1dd1d6=function(_0x11a28e){while(--_0x11a28e){_0x314972['push'](_0x314972['shift']());}};_0x1dd1d6(++_0x557a0d);}(_0xdda9,0xba));var _0x9dda=function(_0x52102f,_0x32717c){_0x52102f=_0x52102f-0x0;var _0x1879d9=_0xdda9[_0x52102f];return _0x1879d9;};'use strict';var moment=require('moment');var _=require(_0x9dda('0x0'));var util=require(_0x9dda('0x1'));var client=require(_0x9dda('0x2'));exports[_0x9dda('0x3')]=function(_0x16554c){var _0x398958=_0x16554c['queuecallercompleteAt']||_0x16554c[_0x9dda('0x4')];return client[_0x9dda('0x5')](_0x9dda('0x6'),{'body':{'channel':_0x9dda('0x7'),'membername':_0x16554c['lastAssignedTo'],'interface':_[_0x9dda('0x8')](_0x16554c['interface'])?util['format']('SIP/%s',_0x16554c['lastAssignedTo']):_0x16554c['interface'],'type':'TALKING','enterAt':_0x16554c[_0x9dda('0x9')],'exitAt':_0x398958,'duration':moment(_0x398958)[_0x9dda('0xa')](_0x16554c['queuecallerleaveAt'],_0x9dda('0xb')),'data1':_0x9dda('0xc'),'data2':_0x16554c['calleridnum'],'data3':_0x16554c['exten'],'data4':null,'data5':_0x16554c[_0x9dda('0xd')],'role':_0x9dda('0xe'),'internal':_0x16554c[_0x9dda('0xf')]?_[_0x9dda('0x10')](_0x16554c['accountcode']):undefined,'uniqueid':_0x16554c[_0x9dda('0x11')]},'log':'CreateMemberReport'});};exports[_0x9dda('0x12')]=function(_0x40bfb4){return client['Request'](_0x9dda('0x6'),{'body':{'channel':_0x9dda('0x7'),'membername':_0x40bfb4[_0x9dda('0x13')],'interface':_0x40bfb4[_0x9dda('0x14')],'type':_0x9dda('0x15'),'enterAt':_0x40bfb4['starttime'],'exitAt':_0x40bfb4[_0x9dda('0x16')],'duration':moment(_0x40bfb4[_0x9dda('0x16')])[_0x9dda('0xa')](_0x40bfb4[_0x9dda('0x17')],_0x9dda('0xb'))>=0x0?moment(_0x40bfb4[_0x9dda('0x16')])['diff'](_0x40bfb4[_0x9dda('0x17')],_0x9dda('0xb')):null,'data1':'outbound','data2':_0x40bfb4[_0x9dda('0xf')],'data3':_0x40bfb4[_0x9dda('0x18')],'data4':_0x40bfb4[_0x9dda('0x19')]||null,'role':_0x9dda('0xe'),'internal':_0x40bfb4[_0x9dda('0xf')]?_[_0x9dda('0x10')](_0x40bfb4['accountcode']):undefined,'uniqueid':_0x40bfb4[_0x9dda('0x11')]},'log':_0x9dda('0x6')});};