Built motion from commit 1fa89557.|2.6.10
[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 _0xdad2=['dialstring','toNumber','uniqueid','moment','lodash','util','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','voiceDialReport','membername','endtime','diff','starttime','outbound'];(function(_0x2dad1c,_0x8eb2e7){var _0x5a283d=function(_0x535f46){while(--_0x535f46){_0x2dad1c['push'](_0x2dad1c['shift']());}};_0x5a283d(++_0x8eb2e7);}(_0xdad2,0x153));var _0x2dad=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xdad2[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0x2dad('0x0'));var _=require(_0x2dad('0x1'));var util=require(_0x2dad('0x2'));var client=require('../client');exports['voiceQueueReport']=function(_0x22d571){var _0x50eed1=_0x22d571['queuecallercompleteAt']||_0x22d571[_0x2dad('0x3')];return client['Request'](_0x2dad('0x4'),{'body':{'channel':_0x2dad('0x5'),'membername':_0x22d571[_0x2dad('0x6')],'interface':_[_0x2dad('0x7')](_0x22d571[_0x2dad('0x8')])?util['format'](_0x2dad('0x9'),_0x22d571[_0x2dad('0x6')]):_0x22d571[_0x2dad('0x8')],'type':_0x2dad('0xa'),'enterAt':_0x22d571[_0x2dad('0xb')],'exitAt':_0x50eed1,'duration':moment(_0x50eed1)['diff'](_0x22d571['queuecallerleaveAt'],_0x2dad('0xc')),'data1':_0x2dad('0xd'),'data2':_0x22d571[_0x2dad('0xe')],'data3':_0x22d571[_0x2dad('0xf')],'data4':null,'data5':_0x22d571[_0x2dad('0x10')],'role':_0x2dad('0x11'),'internal':_0x22d571[_0x2dad('0x12')]?_['toNumber'](_0x22d571[_0x2dad('0x12')]):undefined,'uniqueid':_0x22d571['uniqueid']},'log':_0x2dad('0x4')});};exports[_0x2dad('0x13')]=function(_0x425ecb){return client['Request'](_0x2dad('0x4'),{'body':{'channel':'voice','membername':_0x425ecb[_0x2dad('0x14')],'interface':_0x425ecb['interface'],'type':_0x2dad('0xa'),'enterAt':_0x425ecb['starttime'],'exitAt':_0x425ecb[_0x2dad('0x15')],'duration':moment(_0x425ecb['endtime'])[_0x2dad('0x16')](_0x425ecb[_0x2dad('0x17')],'seconds')>=0x0?moment(_0x425ecb[_0x2dad('0x15')])[_0x2dad('0x16')](_0x425ecb[_0x2dad('0x17')],_0x2dad('0xc')):null,'data1':_0x2dad('0x18'),'data2':_0x425ecb[_0x2dad('0x12')],'data3':_0x425ecb['exten'],'data4':_0x425ecb[_0x2dad('0x19')]||null,'role':_0x2dad('0x11'),'internal':_0x425ecb['accountcode']?_[_0x2dad('0x1a')](_0x425ecb[_0x2dad('0x12')]):undefined,'uniqueid':_0x425ecb[_0x2dad('0x1b')]},'log':'CreateMemberReport'});};