Built motion from commit (unavailable).|2.5.18
[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 _0x954a=['then','info','debug','request\x20sent','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','request'];(function(_0x155b15,_0x55f0d5){var _0x30d567=function(_0x49fd85){while(--_0x49fd85){_0x155b15['push'](_0x155b15['shift']());}};_0x30d567(++_0x55f0d5);}(_0x954a,0x66));var _0xa954=function(_0x3d3720,_0x40bb41){_0x3d3720=_0x3d3720-0x0;var _0x1d90e0=_0x954a[_0x3d3720];return _0x1d90e0;};'use strict';var _=require(_0xa954('0x0'));var util=require('util');var moment=require(_0xa954('0x1'));var BPromise=require(_0xa954('0x2'));var rs=require(_0xa954('0x3'));var fs=require('fs');var Redis=require(_0xa954('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa954('0x5'));var logger=require('../../config/logger')(_0xa954('0x6'));var config=require(_0xa954('0x7'));var jayson=require(_0xa954('0x8'));var client=jayson[_0xa954('0x9')]['http']({'port':0x232a});config[_0xa954('0xa')]=_['defaults'](config[_0xa954('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa954('0xb'))(new Redis(config[_0xa954('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x249489,_0x4d86c5,_0x3f7e23){return new BPromise(function(_0x58789d,_0x3b7731){return client[_0xa954('0xc')](_0x249489,_0x3f7e23)[_0xa954('0xd')](function(_0x572f5f){logger[_0xa954('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x4d86c5,'request\x20sent');logger[_0xa954('0xf')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4d86c5,_0xa954('0x10'),JSON[_0xa954('0x11')](_0x572f5f));if(_0x572f5f[_0xa954('0x12')]){if(_0x572f5f[_0xa954('0x12')][_0xa954('0x13')]===0x1f4){logger['error'](_0xa954('0x14'),_0x4d86c5,_0x572f5f[_0xa954('0x12')]['message']);return _0x3b7731(_0x572f5f[_0xa954('0x12')][_0xa954('0x15')]);}logger[_0xa954('0x12')](_0xa954('0x14'),_0x4d86c5,_0x572f5f[_0xa954('0x12')][_0xa954('0x15')]);return _0x58789d(_0x572f5f[_0xa954('0x12')]['message']);}else{logger[_0xa954('0xe')]('VoicePrefix,\x20%s,\x20%s',_0x4d86c5,'request\x20sent');_0x58789d(_0x572f5f[_0xa954('0x16')][_0xa954('0x15')]);}})['catch'](function(_0x105fdc){logger[_0xa954('0x12')](_0xa954('0x14'),_0x4d86c5,_0x105fdc);_0x3b7731(_0x105fdc);});});}