Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / voiceContext / voiceContext.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 _0xc639=['message','result','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x55e659,_0x233aa4){var _0xca08c7=function(_0xe1c5b0){while(--_0xe1c5b0){_0x55e659['push'](_0x55e659['shift']());}};_0xca08c7(++_0x233aa4);}(_0xc639,0xc0));var _0x9c63=function(_0xf58324,_0x5908fd){_0xf58324=_0xf58324-0x0;var _0x143ae3=_0xc639[_0xf58324];return _0x143ae3;};'use strict';var _=require(_0x9c63('0x0'));var util=require('util');var moment=require(_0x9c63('0x1'));var BPromise=require(_0x9c63('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c63('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c63('0x4'));var logger=require(_0x9c63('0x5'))(_0x9c63('0x6'));var config=require(_0x9c63('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9c63('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x308cf3,_0x1b9365,_0x490321){return new BPromise(function(_0x506234,_0x52c13d){return client['request'](_0x308cf3,_0x490321)[_0x9c63('0x9')](function(_0x376245){logger['info'](_0x9c63('0xa'),_0x1b9365,_0x9c63('0xb'));logger[_0x9c63('0xc')](_0x9c63('0xd'),_0x1b9365,_0x9c63('0xb'),JSON[_0x9c63('0xe')](_0x376245));if(_0x376245[_0x9c63('0xf')]){if(_0x376245[_0x9c63('0xf')][_0x9c63('0x10')]===0x1f4){logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0x376245[_0x9c63('0xf')][_0x9c63('0x11')]);return _0x52c13d(_0x376245['error']['message']);}logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0x376245[_0x9c63('0xf')][_0x9c63('0x11')]);return _0x506234(_0x376245['error'][_0x9c63('0x11')]);}else{logger['info'](_0x9c63('0xa'),_0x1b9365,'request\x20sent');_0x506234(_0x376245[_0x9c63('0x12')]['message']);}})['catch'](function(_0xc0f75c){logger[_0x9c63('0xf')](_0x9c63('0xa'),_0x1b9365,_0xc0f75c);_0x52c13d(_0xc0f75c);});});}