1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xaa57=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0xb35c2c,_0x554438){var _0x20bfb7=function(_0x1ddf18){while(--_0x1ddf18){_0xb35c2c['push'](_0xb35c2c['shift']());}};_0x20bfb7(++_0x554438);}(_0xaa57,0x1e2));var _0x7aa5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xaa57[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7aa5('0x0'));var util=require('util');var moment=require(_0x7aa5('0x1'));var BPromise=require(_0x7aa5('0x2'));var rs=require(_0x7aa5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7aa5('0x4'))['db'];var utils=require(_0x7aa5('0x5'));var logger=require(_0x7aa5('0x6'))(_0x7aa5('0x7'));var config=require(_0x7aa5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7aa5('0x9')][_0x7aa5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecec7,_0x3b905f,_0x192df8){return new BPromise(function(_0x1be09d,_0x451be4){return client[_0x7aa5('0xb')](_0x5ecec7,_0x192df8)[_0x7aa5('0xc')](function(_0x20f76d){logger[_0x7aa5('0xd')](_0x7aa5('0xe'),_0x3b905f,'request\x20sent');logger[_0x7aa5('0xf')](_0x7aa5('0x10'),_0x3b905f,_0x7aa5('0x11'),JSON['stringify'](_0x20f76d));if(_0x20f76d[_0x7aa5('0x12')]){if(_0x20f76d['error'][_0x7aa5('0x13')]===0x1f4){logger['error'](_0x7aa5('0xe'),_0x3b905f,_0x20f76d[_0x7aa5('0x12')][_0x7aa5('0x14')]);return _0x451be4(_0x20f76d[_0x7aa5('0x12')][_0x7aa5('0x14')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x3b905f,_0x20f76d[_0x7aa5('0x12')]['message']);return _0x1be09d(_0x20f76d['error']['message']);}else{logger[_0x7aa5('0xd')]('VoiceContext,\x20%s,\x20%s',_0x3b905f,_0x7aa5('0x11'));_0x1be09d(_0x20f76d[_0x7aa5('0x15')][_0x7aa5('0x14')]);}})[_0x7aa5('0x16')](function(_0x355f88){logger[_0x7aa5('0x12')](_0x7aa5('0xe'),_0x3b905f,_0x355f88);_0x451be4(_0x355f88);});});}