d0d9fb1b507ee97f8fad36a831e1dc23147c1559
[motion2.git] / server / api / voiceChanSpy / voiceChanSpy.rpc.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 _0xa8ea=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x8e4e07,_0x51c198){var _0x34d001=function(_0x1c8cf3){while(--_0x1c8cf3){_0x8e4e07['push'](_0x8e4e07['shift']());}};_0x34d001(++_0x51c198);}(_0xa8ea,0x163));var _0xaa8e=function(_0x5aee68,_0x15d937){_0x5aee68=_0x5aee68-0x0;var _0x5bf097=_0xa8ea[_0x5aee68];return _0x5bf097;};'use strict';var _=require(_0xaa8e('0x0'));var util=require(_0xaa8e('0x1'));var moment=require(_0xaa8e('0x2'));var BPromise=require(_0xaa8e('0x3'));var rs=require(_0xaa8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa8e('0x5'))['db'];var utils=require(_0xaa8e('0x6'));var logger=require(_0xaa8e('0x7'))(_0xaa8e('0x8'));var config=require(_0xaa8e('0x9'));var jayson=require(_0xaa8e('0xa'));var client=jayson[_0xaa8e('0xb')][_0xaa8e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315f69,_0x4e007a,_0x1363e8){return new BPromise(function(_0x3ecf2f,_0x5deefd){return client['request'](_0x315f69,_0x1363e8)[_0xaa8e('0xd')](function(_0x364bfc){logger[_0xaa8e('0xe')](_0xaa8e('0xf'),_0x4e007a,_0xaa8e('0x10'));logger[_0xaa8e('0x11')](_0xaa8e('0x12'),_0x4e007a,'request\x20sent',JSON[_0xaa8e('0x13')](_0x364bfc));if(_0x364bfc[_0xaa8e('0x14')]){if(_0x364bfc[_0xaa8e('0x14')]['code']===0x1f4){logger[_0xaa8e('0x14')](_0xaa8e('0xf'),_0x4e007a,_0x364bfc[_0xaa8e('0x14')][_0xaa8e('0x15')]);return _0x5deefd(_0x364bfc[_0xaa8e('0x14')][_0xaa8e('0x15')]);}logger[_0xaa8e('0x14')](_0xaa8e('0xf'),_0x4e007a,_0x364bfc[_0xaa8e('0x14')][_0xaa8e('0x15')]);return _0x3ecf2f(_0x364bfc[_0xaa8e('0x14')][_0xaa8e('0x15')]);}else{logger[_0xaa8e('0xe')](_0xaa8e('0xf'),_0x4e007a,_0xaa8e('0x10'));_0x3ecf2f(_0x364bfc[_0xaa8e('0x16')]['message']);}})[_0xaa8e('0x17')](function(_0x1ad290){logger[_0xaa8e('0x14')](_0xaa8e('0xf'),_0x4e007a,_0x1ad290);_0x5deefd(_0x1ad290);});});}