Built motion from commit da617fac.|2.6.6
[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 _0x590a=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56ac6a,_0x35ed04){var _0x169575=function(_0x1c5694){while(--_0x1c5694){_0x56ac6a['push'](_0x56ac6a['shift']());}};_0x169575(++_0x35ed04);}(_0x590a,0x159));var _0xa590=function(_0x1be143,_0x2f58ed){_0x1be143=_0x1be143-0x0;var _0xaa3f65=_0x590a[_0x1be143];return _0xaa3f65;};'use strict';var _=require('lodash');var util=require(_0xa590('0x0'));var moment=require(_0xa590('0x1'));var BPromise=require(_0xa590('0x2'));var rs=require(_0xa590('0x3'));var fs=require('fs');var Redis=require(_0xa590('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa590('0x5'))(_0xa590('0x6'));var config=require(_0xa590('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa590('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2dcf20,_0x163d19,_0x2ad01a){return new BPromise(function(_0x27a5fa,_0x5d9565){return client['request'](_0x2dcf20,_0x2ad01a)[_0xa590('0x9')](function(_0x486f78){logger[_0xa590('0xa')](_0xa590('0xb'),_0x163d19,_0xa590('0xc'));logger['debug'](_0xa590('0xd'),_0x163d19,_0xa590('0xc'),JSON[_0xa590('0xe')](_0x486f78));if(_0x486f78[_0xa590('0xf')]){if(_0x486f78[_0xa590('0xf')][_0xa590('0x10')]===0x1f4){logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78['error'][_0xa590('0x11')]);return _0x5d9565(_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);}logger[_0xa590('0xf')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0x486f78[_0xa590('0xf')][_0xa590('0x11')]);return _0x27a5fa(_0x486f78['error']['message']);}else{logger[_0xa590('0xa')]('VoiceContext,\x20%s,\x20%s',_0x163d19,_0xa590('0xc'));_0x27a5fa(_0x486f78[_0xa590('0x12')][_0xa590('0x11')]);}})[_0xa590('0x13')](function(_0xfb7055){logger[_0xa590('0xf')](_0xa590('0xb'),_0x163d19,_0xfb7055);_0x5d9565(_0xfb7055);});});}