Built motion from commit c116dc8b.|2.6.30
[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 _0x1f47=['util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','isNil','format','interface','diff','queuecallerleaveAt','seconds','inbound','calleridnum','agent','accountcode','uniqueid','voice','membername','TALKING','starttime','endtime','outbound','exten','dialstring','toNumber','lodash'];(function(_0x343a7f,_0x56df8c){var _0x138dab=function(_0x1fcf8a){while(--_0x1fcf8a){_0x343a7f['push'](_0x343a7f['shift']());}};_0x138dab(++_0x56df8c);}(_0x1f47,0x179));var _0x71f4=function(_0x18d7d4,_0x5404dd){_0x18d7d4=_0x18d7d4-0x0;var _0x24444f=_0x1f47[_0x18d7d4];return _0x24444f;};'use strict';var moment=require('moment');var _=require(_0x71f4('0x0'));var util=require(_0x71f4('0x1'));var client=require(_0x71f4('0x2'));exports[_0x71f4('0x3')]=function(_0x51b646){var _0x5b4519=_0x51b646['queuecallercompleteAt']||_0x51b646[_0x71f4('0x4')];return client[_0x71f4('0x5')](_0x71f4('0x6'),{'body':{'channel':'voice','membername':_0x51b646['lastAssignedTo'],'interface':_[_0x71f4('0x7')](_0x51b646['interface'])?util[_0x71f4('0x8')]('SIP/%s',_0x51b646['lastAssignedTo']):_0x51b646[_0x71f4('0x9')],'type':'TALKING','enterAt':_0x51b646['queuecallerleaveAt'],'exitAt':_0x5b4519,'duration':moment(_0x5b4519)[_0x71f4('0xa')](_0x51b646[_0x71f4('0xb')],_0x71f4('0xc')),'data1':_0x71f4('0xd'),'data2':_0x51b646[_0x71f4('0xe')],'data3':_0x51b646['exten'],'data4':null,'data5':_0x51b646['queue'],'role':_0x71f4('0xf'),'internal':_0x51b646[_0x71f4('0x10')]?_['toNumber'](_0x51b646['accountcode']):undefined,'uniqueid':_0x51b646[_0x71f4('0x11')]},'log':_0x71f4('0x6')});};exports['voiceDialReport']=function(_0x962b0b){return client['Request']('CreateMemberReport',{'body':{'channel':_0x71f4('0x12'),'membername':_0x962b0b[_0x71f4('0x13')],'interface':_0x962b0b[_0x71f4('0x9')],'type':_0x71f4('0x14'),'enterAt':_0x962b0b[_0x71f4('0x15')],'exitAt':_0x962b0b[_0x71f4('0x16')],'duration':moment(_0x962b0b['endtime'])['diff'](_0x962b0b['starttime'],'seconds')>=0x0?moment(_0x962b0b[_0x71f4('0x16')])[_0x71f4('0xa')](_0x962b0b['starttime'],_0x71f4('0xc')):null,'data1':_0x71f4('0x17'),'data2':_0x962b0b['accountcode'],'data3':_0x962b0b[_0x71f4('0x18')],'data4':_0x962b0b[_0x71f4('0x19')]||null,'role':_0x71f4('0xf'),'internal':_0x962b0b['accountcode']?_[_0x71f4('0x1a')](_0x962b0b[_0x71f4('0x10')]):undefined,'uniqueid':_0x962b0b[_0x71f4('0x11')]},'log':_0x71f4('0x6')});};