Built motion from commit (unavailable).|2.5.2
[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 _0xb6a9=['then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x28b7ff,_0xf9114a){var _0x397e28=function(_0x54df8e){while(--_0x54df8e){_0x28b7ff['push'](_0x28b7ff['shift']());}};_0x397e28(++_0xf9114a);}(_0xb6a9,0x1c4));var _0x9b6a=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb6a9[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x9b6a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9b6a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b6a('0x2'));var db=require(_0x9b6a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b6a('0x4'))(_0x9b6a('0x5'));var config=require(_0x9b6a('0x6'));var jayson=require(_0x9b6a('0x7'));var client=jayson['client'][_0x9b6a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35006e,_0x3c3e0e,_0x5dd619){return new BPromise(function(_0x491543,_0x1765f7){return client[_0x9b6a('0x9')](_0x35006e,_0x5dd619)[_0x9b6a('0xa')](function(_0x5655ca){logger[_0x9b6a('0xb')](_0x9b6a('0xc'),_0x3c3e0e,_0x9b6a('0xd'));logger[_0x9b6a('0xe')](_0x9b6a('0xf'),_0x3c3e0e,_0x9b6a('0xd'),JSON[_0x9b6a('0x10')](_0x5655ca));if(_0x5655ca['error']){if(_0x5655ca[_0x9b6a('0x11')][_0x9b6a('0x12')]===0x1f4){logger[_0x9b6a('0x11')](_0x9b6a('0xc'),_0x3c3e0e,_0x5655ca[_0x9b6a('0x11')][_0x9b6a('0x13')]);return _0x1765f7(_0x5655ca['error'][_0x9b6a('0x13')]);}logger[_0x9b6a('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3c3e0e,_0x5655ca[_0x9b6a('0x11')][_0x9b6a('0x13')]);return _0x491543(_0x5655ca[_0x9b6a('0x11')][_0x9b6a('0x13')]);}else{logger[_0x9b6a('0xb')]('VoiceContext,\x20%s,\x20%s',_0x3c3e0e,_0x9b6a('0xd'));_0x491543(_0x5655ca[_0x9b6a('0x14')][_0x9b6a('0x13')]);}})['catch'](function(_0x4cb6e9){logger[_0x9b6a('0x11')]('VoiceContext,\x20%s,\x20%s',_0x3c3e0e,_0x4cb6e9);_0x1765f7(_0x4cb6e9);});});}