Built motion from commit (unavailable).|2.5.11
[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 _0xa786=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xa786,0x1f1));var _0x6a78=function(_0x245d3b,_0x40738d){_0x245d3b=_0x245d3b-0x0;var _0x498686=_0xa786[_0x245d3b];return _0x498686;};'use strict';var _=require(_0x6a78('0x0'));var util=require(_0x6a78('0x1'));var moment=require(_0x6a78('0x2'));var BPromise=require(_0x6a78('0x3'));var rs=require(_0x6a78('0x4'));var fs=require('fs');var Redis=require(_0x6a78('0x5'));var db=require(_0x6a78('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a78('0x7'))(_0x6a78('0x8'));var config=require(_0x6a78('0x9'));var jayson=require(_0x6a78('0xa'));var client=jayson['client'][_0x6a78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34deae,_0x3df8b4,_0x55482c){return new BPromise(function(_0x58d2bc,_0x489b26){return client[_0x6a78('0xc')](_0x34deae,_0x55482c)['then'](function(_0x5e3e6b){logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x3df8b4,_0x6a78('0xf'));logger[_0x6a78('0x10')](_0x6a78('0x11'),_0x3df8b4,'request\x20sent',JSON['stringify'](_0x5e3e6b));if(_0x5e3e6b[_0x6a78('0x12')]){if(_0x5e3e6b[_0x6a78('0x12')]['code']===0x1f4){logger[_0x6a78('0x12')](_0x6a78('0xe'),_0x3df8b4,_0x5e3e6b[_0x6a78('0x12')][_0x6a78('0x13')]);return _0x489b26(_0x5e3e6b[_0x6a78('0x12')]['message']);}logger[_0x6a78('0x12')](_0x6a78('0xe'),_0x3df8b4,_0x5e3e6b['error'][_0x6a78('0x13')]);return _0x58d2bc(_0x5e3e6b[_0x6a78('0x12')][_0x6a78('0x13')]);}else{logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x3df8b4,_0x6a78('0xf'));_0x58d2bc(_0x5e3e6b[_0x6a78('0x14')][_0x6a78('0x13')]);}})['catch'](function(_0x3f9482){logger[_0x6a78('0x12')](_0x6a78('0xe'),_0x3df8b4,_0x3f9482);_0x489b26(_0x3f9482);});});}