Built motion from commit e02f907f.|2.6.14
[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 _0x6b3a=['CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','exten','queue','agent','accountcode','toNumber','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','uniqueid','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request'];(function(_0xbc9917,_0x479324){var _0x20ab5a=function(_0x43951d){while(--_0x43951d){_0xbc9917['push'](_0xbc9917['shift']());}};_0x20ab5a(++_0x479324);}(_0x6b3a,0x14e));var _0xa6b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b3a[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var _=require(_0xa6b3('0x0'));var util=require(_0xa6b3('0x1'));var client=require(_0xa6b3('0x2'));exports[_0xa6b3('0x3')]=function(_0x51f655){var _0x280b57=_0x51f655[_0xa6b3('0x4')]||_0x51f655[_0xa6b3('0x5')];return client[_0xa6b3('0x6')](_0xa6b3('0x7'),{'body':{'channel':_0xa6b3('0x8'),'membername':_0x51f655[_0xa6b3('0x9')],'interface':_[_0xa6b3('0xa')](_0x51f655[_0xa6b3('0xb')])?util[_0xa6b3('0xc')](_0xa6b3('0xd'),_0x51f655[_0xa6b3('0x9')]):_0x51f655[_0xa6b3('0xb')],'type':_0xa6b3('0xe'),'enterAt':_0x51f655['queuecallerleaveAt'],'exitAt':_0x280b57,'duration':moment(_0x280b57)['diff'](_0x51f655[_0xa6b3('0xf')],_0xa6b3('0x10')),'data1':_0xa6b3('0x11'),'data2':_0x51f655['calleridnum'],'data3':_0x51f655[_0xa6b3('0x12')],'data4':null,'data5':_0x51f655[_0xa6b3('0x13')],'role':_0xa6b3('0x14'),'internal':_0x51f655[_0xa6b3('0x15')]?_[_0xa6b3('0x16')](_0x51f655['accountcode']):undefined,'uniqueid':_0x51f655['uniqueid']},'log':'CreateMemberReport'});};exports[_0xa6b3('0x17')]=function(_0x4e3f20){return client[_0xa6b3('0x6')]('CreateMemberReport',{'body':{'channel':_0xa6b3('0x8'),'membername':_0x4e3f20[_0xa6b3('0x18')],'interface':_0x4e3f20[_0xa6b3('0xb')],'type':_0xa6b3('0xe'),'enterAt':_0x4e3f20[_0xa6b3('0x19')],'exitAt':_0x4e3f20[_0xa6b3('0x1a')],'duration':moment(_0x4e3f20[_0xa6b3('0x1a')])[_0xa6b3('0x1b')](_0x4e3f20[_0xa6b3('0x19')],_0xa6b3('0x10'))>=0x0?moment(_0x4e3f20['endtime'])[_0xa6b3('0x1b')](_0x4e3f20[_0xa6b3('0x19')],'seconds'):null,'data1':_0xa6b3('0x1c'),'data2':_0x4e3f20[_0xa6b3('0x15')],'data3':_0x4e3f20['exten'],'data4':_0x4e3f20[_0xa6b3('0x1d')]||null,'role':'agent','internal':_0x4e3f20[_0xa6b3('0x15')]?_[_0xa6b3('0x16')](_0x4e3f20[_0xa6b3('0x15')]):undefined,'uniqueid':_0x4e3f20[_0xa6b3('0x1e')]},'log':'CreateMemberReport'});};