Built motion from commit (unavailable).|2.5.30
[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 _0x7cd1=['request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7cd1,0xee));var _0x17cd=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x7cd1[_0x56756b];return _0xa3002;};'use strict';var _=require(_0x17cd('0x0'));var util=require(_0x17cd('0x1'));var moment=require(_0x17cd('0x2'));var BPromise=require(_0x17cd('0x3'));var rs=require(_0x17cd('0x4'));var fs=require('fs');var Redis=require(_0x17cd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x17cd('0x6'));var logger=require(_0x17cd('0x7'))(_0x17cd('0x8'));var config=require(_0x17cd('0x9'));var jayson=require(_0x17cd('0xa'));var client=jayson['client'][_0x17cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543ed5,_0x48fba3,_0xaeec2d){return new BPromise(function(_0x3ab3cb,_0x301f69){return client[_0x17cd('0xc')](_0x543ed5,_0xaeec2d)['then'](function(_0x3e84f2){logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x48fba3,_0x17cd('0xf'));logger[_0x17cd('0x10')](_0x17cd('0x11'),_0x48fba3,_0x17cd('0xf'),JSON[_0x17cd('0x12')](_0x3e84f2));if(_0x3e84f2[_0x17cd('0x13')]){if(_0x3e84f2['error'][_0x17cd('0x14')]===0x1f4){logger[_0x17cd('0x13')](_0x17cd('0xe'),_0x48fba3,_0x3e84f2['error']['message']);return _0x301f69(_0x3e84f2['error'][_0x17cd('0x15')]);}logger[_0x17cd('0x13')](_0x17cd('0xe'),_0x48fba3,_0x3e84f2[_0x17cd('0x13')]['message']);return _0x3ab3cb(_0x3e84f2[_0x17cd('0x13')][_0x17cd('0x15')]);}else{logger[_0x17cd('0xd')](_0x17cd('0xe'),_0x48fba3,'request\x20sent');_0x3ab3cb(_0x3e84f2[_0x17cd('0x16')][_0x17cd('0x15')]);}})['catch'](function(_0x2f2756){logger[_0x17cd('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x48fba3,_0x2f2756);_0x301f69(_0x2f2756);});});}