Built motion from commit d6d69adf.|2.6.33
[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 _0xf253=['agent','accountcode','toNumber','CreateMemberReport','TALKING','endtime','starttime','dialstring','moment','lodash','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','seconds','inbound','exten','queue'];(function(_0x5d7701,_0x494f71){var _0x269483=function(_0x39ae7c){while(--_0x39ae7c){_0x5d7701['push'](_0x5d7701['shift']());}};_0x269483(++_0x494f71);}(_0xf253,0x1b1));var _0x3f25=function(_0x5a361d,_0x259dfc){_0x5a361d=_0x5a361d-0x0;var _0x24a315=_0xf253[_0x5a361d];return _0x24a315;};'use strict';var moment=require(_0x3f25('0x0'));var _=require(_0x3f25('0x1'));var util=require('util');var client=require('../client');exports[_0x3f25('0x2')]=function(_0x3fa183){var _0x3f4fdc=_0x3fa183[_0x3f25('0x3')]||_0x3fa183[_0x3f25('0x4')];return client[_0x3f25('0x5')]('CreateMemberReport',{'body':{'channel':_0x3f25('0x6'),'membername':_0x3fa183[_0x3f25('0x7')],'interface':_[_0x3f25('0x8')](_0x3fa183[_0x3f25('0x9')])?util[_0x3f25('0xa')](_0x3f25('0xb'),_0x3fa183[_0x3f25('0x7')]):_0x3fa183[_0x3f25('0x9')],'type':'TALKING','enterAt':_0x3fa183[_0x3f25('0xc')],'exitAt':_0x3f4fdc,'duration':moment(_0x3f4fdc)['diff'](_0x3fa183[_0x3f25('0xc')],_0x3f25('0xd')),'data1':_0x3f25('0xe'),'data2':_0x3fa183['calleridnum'],'data3':_0x3fa183[_0x3f25('0xf')],'data4':null,'data5':_0x3fa183[_0x3f25('0x10')],'role':_0x3f25('0x11'),'internal':_0x3fa183[_0x3f25('0x12')]?_[_0x3f25('0x13')](_0x3fa183[_0x3f25('0x12')]):undefined,'uniqueid':_0x3fa183['uniqueid']},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x23d890){return client[_0x3f25('0x5')](_0x3f25('0x14'),{'body':{'channel':_0x3f25('0x6'),'membername':_0x23d890['membername'],'interface':_0x23d890['interface'],'type':_0x3f25('0x15'),'enterAt':_0x23d890['starttime'],'exitAt':_0x23d890[_0x3f25('0x16')],'duration':moment(_0x23d890[_0x3f25('0x16')])['diff'](_0x23d890['starttime'],_0x3f25('0xd'))>=0x0?moment(_0x23d890[_0x3f25('0x16')])['diff'](_0x23d890[_0x3f25('0x17')],'seconds'):null,'data1':'outbound','data2':_0x23d890[_0x3f25('0x12')],'data3':_0x23d890['exten'],'data4':_0x23d890[_0x3f25('0x18')]||null,'role':_0x3f25('0x11'),'internal':_0x23d890[_0x3f25('0x12')]?_[_0x3f25('0x13')](_0x23d890[_0x3f25('0x12')]):undefined,'uniqueid':_0x23d890['uniqueid']},'log':_0x3f25('0x14')});};