Built motion from commit 936e8062.|2.5.33
[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 _0x62b7=['VoiceContext,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e41d6,_0x522918){var _0x51d7e9=function(_0x36dfee){while(--_0x36dfee){_0x1e41d6['push'](_0x1e41d6['shift']());}};_0x51d7e9(++_0x522918);}(_0x62b7,0x179));var _0x762b=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0x62b7[_0x14b767];return _0x22267a;};'use strict';var _=require(_0x762b('0x0'));var util=require(_0x762b('0x1'));var moment=require(_0x762b('0x2'));var BPromise=require(_0x762b('0x3'));var rs=require(_0x762b('0x4'));var fs=require('fs');var Redis=require(_0x762b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x762b('0x6'));var logger=require('../../config/logger')(_0x762b('0x7'));var config=require(_0x762b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x762b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ff9b,_0x3e26a9,_0x27554f){return new BPromise(function(_0x3bf174,_0x11a460){return client[_0x762b('0xa')](_0x48ff9b,_0x27554f)[_0x762b('0xb')](function(_0x1b7697){logger[_0x762b('0xc')]('VoiceContext,\x20%s,\x20%s',_0x3e26a9,_0x762b('0xd'));logger[_0x762b('0xe')](_0x762b('0xf'),_0x3e26a9,_0x762b('0xd'),JSON[_0x762b('0x10')](_0x1b7697));if(_0x1b7697[_0x762b('0x11')]){if(_0x1b7697[_0x762b('0x11')][_0x762b('0x12')]===0x1f4){logger[_0x762b('0x11')](_0x762b('0x13'),_0x3e26a9,_0x1b7697[_0x762b('0x11')]['message']);return _0x11a460(_0x1b7697[_0x762b('0x11')][_0x762b('0x14')]);}logger[_0x762b('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3e26a9,_0x1b7697['error']['message']);return _0x3bf174(_0x1b7697[_0x762b('0x11')]['message']);}else{logger[_0x762b('0xc')](_0x762b('0x13'),_0x3e26a9,'request\x20sent');_0x3bf174(_0x1b7697[_0x762b('0x15')][_0x762b('0x14')]);}})['catch'](function(_0x4f5a5f){logger[_0x762b('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3e26a9,_0x4f5a5f);_0x11a460(_0x4f5a5f);});});}