Built motion from commit (unavailable).|2.5.25
[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 _0x426e=['../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1ddbf6,_0x32db18){var _0x421ab3=function(_0x11a38b){while(--_0x11a38b){_0x1ddbf6['push'](_0x1ddbf6['shift']());}};_0x421ab3(++_0x32db18);}(_0x426e,0x1b8));var _0xe426=function(_0x310c56,_0x355e7e){_0x310c56=_0x310c56-0x0;var _0x2dad8c=_0x426e[_0x310c56];return _0x2dad8c;};'use strict';var _=require(_0xe426('0x0'));var util=require(_0xe426('0x1'));var moment=require(_0xe426('0x2'));var BPromise=require(_0xe426('0x3'));var rs=require(_0xe426('0x4'));var fs=require('fs');var Redis=require(_0xe426('0x5'));var db=require(_0xe426('0x6'))['db'];var utils=require(_0xe426('0x7'));var logger=require(_0xe426('0x8'))(_0xe426('0x9'));var config=require(_0xe426('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe426('0xb')][_0xe426('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ef20e,_0x235c2a,_0x472865){return new BPromise(function(_0x3bf26e,_0x2faa87){return client[_0xe426('0xd')](_0x4ef20e,_0x472865)[_0xe426('0xe')](function(_0x119d6a){logger['info'](_0xe426('0xf'),_0x235c2a,_0xe426('0x10'));logger[_0xe426('0x11')](_0xe426('0x12'),_0x235c2a,_0xe426('0x10'),JSON[_0xe426('0x13')](_0x119d6a));if(_0x119d6a[_0xe426('0x14')]){if(_0x119d6a[_0xe426('0x14')]['code']===0x1f4){logger[_0xe426('0x14')](_0xe426('0xf'),_0x235c2a,_0x119d6a['error']['message']);return _0x2faa87(_0x119d6a[_0xe426('0x14')][_0xe426('0x15')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x235c2a,_0x119d6a[_0xe426('0x14')][_0xe426('0x15')]);return _0x3bf26e(_0x119d6a[_0xe426('0x14')][_0xe426('0x15')]);}else{logger[_0xe426('0x16')]('VoiceChanSpy,\x20%s,\x20%s',_0x235c2a,_0xe426('0x10'));_0x3bf26e(_0x119d6a[_0xe426('0x17')][_0xe426('0x15')]);}})[_0xe426('0x18')](function(_0x175e65){logger[_0xe426('0x14')](_0xe426('0xf'),_0x235c2a,_0x175e65);_0x2faa87(_0x175e65);});});}