f7347c8666e4b329715094471dd2935795f7d523
[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 _0xb642=['toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','seconds','outbound','accountcode','exten','dialstring','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','interface','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','diff','inbound','calleridnum','queue','agent'];(function(_0x57d556,_0x2dc7cd){var _0x39bf5c=function(_0x143082){while(--_0x143082){_0x57d556['push'](_0x57d556['shift']());}};_0x39bf5c(++_0x2dc7cd);}(_0xb642,0xa1));var _0x2b64=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xb642[_0x2bf141];return _0x48277b;};'use strict';var moment=require(_0x2b64('0x0'));var _=require('lodash');var util=require(_0x2b64('0x1'));var client=require(_0x2b64('0x2'));exports[_0x2b64('0x3')]=function(_0x38a0a6){var _0x593d85=_0x38a0a6[_0x2b64('0x4')]||_0x38a0a6[_0x2b64('0x5')];return client[_0x2b64('0x6')](_0x2b64('0x7'),{'body':{'channel':_0x2b64('0x8'),'membername':_0x38a0a6['lastAssignedTo'],'interface':_['isNil'](_0x38a0a6[_0x2b64('0x9')])?util['format'](_0x2b64('0xa'),_0x38a0a6[_0x2b64('0xb')]):_0x38a0a6[_0x2b64('0x9')],'type':_0x2b64('0xc'),'enterAt':_0x38a0a6[_0x2b64('0xd')],'exitAt':_0x593d85,'duration':moment(_0x593d85)[_0x2b64('0xe')](_0x38a0a6[_0x2b64('0xd')],'seconds'),'data1':_0x2b64('0xf'),'data2':_0x38a0a6[_0x2b64('0x10')],'data3':_0x38a0a6['exten'],'data4':null,'data5':_0x38a0a6[_0x2b64('0x11')],'role':_0x2b64('0x12'),'internal':_0x38a0a6['accountcode']?_[_0x2b64('0x13')](_0x38a0a6['accountcode']):undefined,'uniqueid':_0x38a0a6[_0x2b64('0x14')]},'log':_0x2b64('0x7')});};exports[_0x2b64('0x15')]=function(_0x22c80f){return client['Request'](_0x2b64('0x7'),{'body':{'channel':_0x2b64('0x8'),'membername':_0x22c80f[_0x2b64('0x16')],'interface':_0x22c80f[_0x2b64('0x9')],'type':_0x2b64('0xc'),'enterAt':_0x22c80f[_0x2b64('0x17')],'exitAt':_0x22c80f[_0x2b64('0x18')],'duration':moment(_0x22c80f[_0x2b64('0x18')])[_0x2b64('0xe')](_0x22c80f['starttime'],_0x2b64('0x19'))>=0x0?moment(_0x22c80f[_0x2b64('0x18')])['diff'](_0x22c80f['starttime'],'seconds'):null,'data1':_0x2b64('0x1a'),'data2':_0x22c80f[_0x2b64('0x1b')],'data3':_0x22c80f[_0x2b64('0x1c')],'data4':_0x22c80f[_0x2b64('0x1d')]||null,'role':_0x2b64('0x12'),'internal':_0x22c80f[_0x2b64('0x1b')]?_[_0x2b64('0x13')](_0x22c80f[_0x2b64('0x1b')]):undefined,'uniqueid':_0x22c80f['uniqueid']},'log':_0x2b64('0x7')});};