Built motion from commit (unavailable).|2.5.31
[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 _0x3bab=['uniqueid','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','queue','agent','accountcode','toNumber','voiceDialReport','starttime','endtime','outbound','dialstring'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x3bab,0x17a));var _0xb3ba=function(_0x5cd331,_0x28f838){_0x5cd331=_0x5cd331-0x0;var _0x3c313e=_0x3bab[_0x5cd331];return _0x3c313e;};'use strict';var moment=require(_0xb3ba('0x0'));var _=require('lodash');var util=require(_0xb3ba('0x1'));var client=require(_0xb3ba('0x2'));exports[_0xb3ba('0x3')]=function(_0xdcc437){var _0x4465fb=_0xdcc437[_0xb3ba('0x4')]||_0xdcc437[_0xb3ba('0x5')];return client[_0xb3ba('0x6')](_0xb3ba('0x7'),{'body':{'channel':_0xb3ba('0x8'),'membername':_0xdcc437[_0xb3ba('0x9')],'interface':_[_0xb3ba('0xa')](_0xdcc437[_0xb3ba('0xb')])?util['format'](_0xb3ba('0xc'),_0xdcc437[_0xb3ba('0x9')]):_0xdcc437['interface'],'type':_0xb3ba('0xd'),'enterAt':_0xdcc437[_0xb3ba('0xe')],'exitAt':_0x4465fb,'duration':moment(_0x4465fb)[_0xb3ba('0xf')](_0xdcc437[_0xb3ba('0xe')],_0xb3ba('0x10')),'data1':_0xb3ba('0x11'),'data2':_0xdcc437['calleridnum'],'data3':_0xdcc437[_0xb3ba('0x12')],'data4':null,'data5':_0xdcc437[_0xb3ba('0x13')],'role':_0xb3ba('0x14'),'internal':_0xdcc437[_0xb3ba('0x15')]?_[_0xb3ba('0x16')](_0xdcc437[_0xb3ba('0x15')]):undefined,'uniqueid':_0xdcc437['uniqueid']},'log':_0xb3ba('0x7')});};exports[_0xb3ba('0x17')]=function(_0x5a30a6){return client[_0xb3ba('0x6')]('CreateMemberReport',{'body':{'channel':_0xb3ba('0x8'),'membername':_0x5a30a6['membername'],'interface':_0x5a30a6['interface'],'type':_0xb3ba('0xd'),'enterAt':_0x5a30a6[_0xb3ba('0x18')],'exitAt':_0x5a30a6['endtime'],'duration':moment(_0x5a30a6[_0xb3ba('0x19')])[_0xb3ba('0xf')](_0x5a30a6['starttime'],'seconds')>=0x0?moment(_0x5a30a6[_0xb3ba('0x19')])[_0xb3ba('0xf')](_0x5a30a6[_0xb3ba('0x18')],_0xb3ba('0x10')):null,'data1':_0xb3ba('0x1a'),'data2':_0x5a30a6['accountcode'],'data3':_0x5a30a6[_0xb3ba('0x12')],'data4':_0x5a30a6[_0xb3ba('0x1b')]||null,'role':'agent','internal':_0x5a30a6[_0xb3ba('0x15')]?_[_0xb3ba('0x16')](_0x5a30a6[_0xb3ba('0x15')]):undefined,'uniqueid':_0x5a30a6[_0xb3ba('0x1c')]},'log':'CreateMemberReport'});};