Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0x4e56=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x32e311,_0x443536){var _0x3b0230=function(_0x5191c1){while(--_0x5191c1){_0x32e311['push'](_0x32e311['shift']());}};_0x3b0230(++_0x443536);}(_0x4e56,0xb0));var _0x64e5=function(_0x53378b,_0x5083df){_0x53378b=_0x53378b-0x0;var _0x364ad2=_0x4e56[_0x53378b];return _0x364ad2;};'use strict';var _=require('lodash');var util=require(_0x64e5('0x0'));var moment=require(_0x64e5('0x1'));var BPromise=require(_0x64e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64e5('0x3'))['db'];var utils=require(_0x64e5('0x4'));var logger=require('../../config/logger')(_0x64e5('0x5'));var config=require('../../config/environment');var jayson=require(_0x64e5('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x64e5('0x7')]=_[_0x64e5('0x8')](config[_0x64e5('0x7')],{'host':_0x64e5('0x9'),'port':0x18eb});var socket=require(_0x64e5('0xa'))(new Redis(config[_0x64e5('0x7')]));require(_0x64e5('0xb'))[_0x64e5('0xc')](socket);function respondWithRpcPromise(_0x4211d5,_0x456e65,_0x13b911){return new BPromise(function(_0x4430d9,_0x1bba41){return client[_0x64e5('0xd')](_0x4211d5,_0x13b911)['then'](function(_0x2b2d5f){logger[_0x64e5('0xe')](_0x64e5('0xf'),_0x456e65,_0x64e5('0x10'));logger[_0x64e5('0x11')](_0x64e5('0x12'),_0x456e65,_0x64e5('0x10'),JSON[_0x64e5('0x13')](_0x2b2d5f));if(_0x2b2d5f[_0x64e5('0x14')]){if(_0x2b2d5f[_0x64e5('0x14')][_0x64e5('0x15')]===0x1f4){logger[_0x64e5('0x14')](_0x64e5('0xf'),_0x456e65,_0x2b2d5f[_0x64e5('0x14')][_0x64e5('0x16')]);return _0x1bba41(_0x2b2d5f['error'][_0x64e5('0x16')]);}logger[_0x64e5('0x14')](_0x64e5('0xf'),_0x456e65,_0x2b2d5f[_0x64e5('0x14')][_0x64e5('0x16')]);return _0x4430d9(_0x2b2d5f[_0x64e5('0x14')][_0x64e5('0x16')]);}else{logger[_0x64e5('0xe')](_0x64e5('0xf'),_0x456e65,_0x64e5('0x10'));_0x4430d9(_0x2b2d5f[_0x64e5('0x17')][_0x64e5('0x16')]);}})[_0x64e5('0x18')](function(_0xd8d6d){logger[_0x64e5('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x456e65,_0xd8d6d);_0x1bba41(_0xd8d6d);});});}