dac605c1b8cb9bdcebddb5fbf6b9443564a6b220
[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 _0x4d85=['accountcode','toNumber','uniqueid','TALKING','endtime','starttime','outbound','exten','dialstring','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','queuecallerleaveAt','diff','seconds','inbound','calleridnum','queue','agent'];(function(_0x4c03ae,_0x5856b0){var _0x1acaab=function(_0x8c9f5f){while(--_0x8c9f5f){_0x4c03ae['push'](_0x4c03ae['shift']());}};_0x1acaab(++_0x5856b0);}(_0x4d85,0x7d));var _0x54d8=function(_0x31ddd0,_0x2c1ffb){_0x31ddd0=_0x31ddd0-0x0;var _0x30e826=_0x4d85[_0x31ddd0];return _0x30e826;};'use strict';var moment=require('moment');var _=require(_0x54d8('0x0'));var util=require(_0x54d8('0x1'));var client=require('../client');exports[_0x54d8('0x2')]=function(_0x254f9a){var _0x3e71e7=_0x254f9a[_0x54d8('0x3')]||_0x254f9a[_0x54d8('0x4')];return client[_0x54d8('0x5')](_0x54d8('0x6'),{'body':{'channel':_0x54d8('0x7'),'membername':_0x254f9a['lastAssignedTo'],'interface':_[_0x54d8('0x8')](_0x254f9a[_0x54d8('0x9')])?util[_0x54d8('0xa')](_0x54d8('0xb'),_0x254f9a[_0x54d8('0xc')]):_0x254f9a[_0x54d8('0x9')],'type':'TALKING','enterAt':_0x254f9a[_0x54d8('0xd')],'exitAt':_0x3e71e7,'duration':moment(_0x3e71e7)[_0x54d8('0xe')](_0x254f9a[_0x54d8('0xd')],_0x54d8('0xf')),'data1':_0x54d8('0x10'),'data2':_0x254f9a[_0x54d8('0x11')],'data3':_0x254f9a['exten'],'data4':null,'data5':_0x254f9a[_0x54d8('0x12')],'role':_0x54d8('0x13'),'internal':_0x254f9a[_0x54d8('0x14')]?_[_0x54d8('0x15')](_0x254f9a[_0x54d8('0x14')]):undefined,'uniqueid':_0x254f9a[_0x54d8('0x16')]},'log':_0x54d8('0x6')});};exports['voiceDialReport']=function(_0x13ffed){return client[_0x54d8('0x5')](_0x54d8('0x6'),{'body':{'channel':_0x54d8('0x7'),'membername':_0x13ffed['membername'],'interface':_0x13ffed[_0x54d8('0x9')],'type':_0x54d8('0x17'),'enterAt':_0x13ffed['starttime'],'exitAt':_0x13ffed[_0x54d8('0x18')],'duration':moment(_0x13ffed[_0x54d8('0x18')])[_0x54d8('0xe')](_0x13ffed[_0x54d8('0x19')],_0x54d8('0xf'))>=0x0?moment(_0x13ffed['endtime'])['diff'](_0x13ffed[_0x54d8('0x19')],_0x54d8('0xf')):null,'data1':_0x54d8('0x1a'),'data2':_0x13ffed['accountcode'],'data3':_0x13ffed[_0x54d8('0x1b')],'data4':_0x13ffed[_0x54d8('0x1c')]||null,'role':_0x54d8('0x13'),'internal':_0x13ffed[_0x54d8('0x14')]?_[_0x54d8('0x15')](_0x13ffed[_0x54d8('0x14')]):undefined,'uniqueid':_0x13ffed['uniqueid']},'log':'CreateMemberReport'});};