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