Built motion from commit (unavailable).|2.5.6
[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 _0x0804=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x1c048f,_0x8ad917){var _0x4dd989=function(_0x13bc2a){while(--_0x13bc2a){_0x1c048f['push'](_0x1c048f['shift']());}};_0x4dd989(++_0x8ad917);}(_0x0804,0x175));var _0x4080=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x0804[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x4080('0x0'));var util=require('util');var moment=require(_0x4080('0x1'));var BPromise=require(_0x4080('0x2'));var rs=require(_0x4080('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4080('0x4'))['db'];var utils=require(_0x4080('0x5'));var logger=require(_0x4080('0x6'))(_0x4080('0x7'));var config=require(_0x4080('0x8'));var jayson=require(_0x4080('0x9'));var client=jayson['client'][_0x4080('0xa')]({'port':0x232a});config[_0x4080('0xb')]=_[_0x4080('0xc')](config[_0x4080('0xb')],{'host':_0x4080('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4080('0xe'))[_0x4080('0xf')](socket);function respondWithRpcPromise(_0x20419f,_0xfebcd4,_0x50d460){return new BPromise(function(_0x4979c0,_0x17949d){return client[_0x4080('0x10')](_0x20419f,_0x50d460)[_0x4080('0x11')](function(_0x250cc4){logger[_0x4080('0x12')](_0x4080('0x13'),_0xfebcd4,_0x4080('0x14'));logger[_0x4080('0x15')](_0x4080('0x16'),_0xfebcd4,_0x4080('0x14'),JSON[_0x4080('0x17')](_0x250cc4));if(_0x250cc4['error']){if(_0x250cc4[_0x4080('0x18')][_0x4080('0x19')]===0x1f4){logger['error'](_0x4080('0x13'),_0xfebcd4,_0x250cc4[_0x4080('0x18')][_0x4080('0x1a')]);return _0x17949d(_0x250cc4[_0x4080('0x18')][_0x4080('0x1a')]);}logger[_0x4080('0x18')](_0x4080('0x13'),_0xfebcd4,_0x250cc4['error']['message']);return _0x4979c0(_0x250cc4['error'][_0x4080('0x1a')]);}else{logger['info'](_0x4080('0x13'),_0xfebcd4,_0x4080('0x14'));_0x4979c0(_0x250cc4[_0x4080('0x1b')][_0x4080('0x1a')]);}})[_0x4080('0x1c')](function(_0x12a3aa){logger[_0x4080('0x18')](_0x4080('0x13'),_0xfebcd4,_0x12a3aa);_0x17949d(_0x12a3aa);});});}