Built motion from commit (unavailable).|2.5.11
[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 _0xe31f=['voice','lastAssignedTo','interface','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','accountcode','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','outbound','dialstring','agent','toNumber','moment','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0xe31f,0xfe));var _0xfe31=function(_0x7c96dc,_0x32d2b8){_0x7c96dc=_0x7c96dc-0x0;var _0x585fea=_0xe31f[_0x7c96dc];return _0x585fea;};'use strict';var moment=require(_0xfe31('0x0'));var _=require('lodash');var util=require('util');var client=require(_0xfe31('0x1'));exports[_0xfe31('0x2')]=function(_0x262517){var _0x16a007=_0x262517['queuecallercompleteAt']||_0x262517[_0xfe31('0x3')];return client[_0xfe31('0x4')](_0xfe31('0x5'),{'body':{'channel':_0xfe31('0x6'),'membername':_0x262517[_0xfe31('0x7')],'interface':_['isNil'](_0x262517[_0xfe31('0x8')])?util['format']('SIP/%s',_0x262517['lastAssignedTo']):_0x262517['interface'],'type':'TALKING','enterAt':_0x262517[_0xfe31('0x9')],'exitAt':_0x16a007,'duration':moment(_0x16a007)[_0xfe31('0xa')](_0x262517[_0xfe31('0x9')],_0xfe31('0xb')),'data1':_0xfe31('0xc'),'data2':_0x262517[_0xfe31('0xd')],'data3':_0x262517[_0xfe31('0xe')],'data4':null,'data5':_0x262517['queue'],'role':'agent','internal':_0x262517[_0xfe31('0xf')]?_['toNumber'](_0x262517[_0xfe31('0xf')]):undefined,'uniqueid':_0x262517[_0xfe31('0x10')]},'log':_0xfe31('0x5')});};exports[_0xfe31('0x11')]=function(_0x2f953b){return client[_0xfe31('0x4')](_0xfe31('0x5'),{'body':{'channel':_0xfe31('0x6'),'membername':_0x2f953b[_0xfe31('0x12')],'interface':_0x2f953b['interface'],'type':_0xfe31('0x13'),'enterAt':_0x2f953b[_0xfe31('0x14')],'exitAt':_0x2f953b['endtime'],'duration':moment(_0x2f953b[_0xfe31('0x15')])[_0xfe31('0xa')](_0x2f953b['starttime'],'seconds')>=0x0?moment(_0x2f953b[_0xfe31('0x15')])[_0xfe31('0xa')](_0x2f953b[_0xfe31('0x14')],_0xfe31('0xb')):null,'data1':_0xfe31('0x16'),'data2':_0x2f953b[_0xfe31('0xf')],'data3':_0x2f953b['exten'],'data4':_0x2f953b[_0xfe31('0x17')]||null,'role':_0xfe31('0x18'),'internal':_0x2f953b[_0xfe31('0xf')]?_[_0xfe31('0x19')](_0x2f953b['accountcode']):undefined,'uniqueid':_0x2f953b['uniqueid']},'log':'CreateMemberReport'});};