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 _0x793b=['error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8e9386,_0x3cc60f){var _0x4abf26=function(_0x59de5a){while(--_0x59de5a){_0x8e9386['push'](_0x8e9386['shift']());}};_0x4abf26(++_0x3cc60f);}(_0x793b,0x1b6));var _0xb793=function(_0x4a0a5e,_0x5f478e){_0x4a0a5e=_0x4a0a5e-0x0;var _0x288f66=_0x793b[_0x4a0a5e];return _0x288f66;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var moment=require(_0xb793('0x2'));var BPromise=require(_0xb793('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb793('0x4'));var db=require(_0xb793('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb793('0x6'))(_0xb793('0x7'));var config=require(_0xb793('0x8'));var jayson=require(_0xb793('0x9'));var client=jayson[_0xb793('0xa')][_0xb793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16094c,_0xfad508,_0x204c35){return new BPromise(function(_0x5d1b96,_0x610374){return client['request'](_0x16094c,_0x204c35)[_0xb793('0xc')](function(_0x4e4076){logger[_0xb793('0xd')]('DeskField,\x20%s,\x20%s',_0xfad508,_0xb793('0xe'));logger[_0xb793('0xf')](_0xb793('0x10'),_0xfad508,_0xb793('0xe'),JSON[_0xb793('0x11')](_0x4e4076));if(_0x4e4076['error']){if(_0x4e4076[_0xb793('0x12')][_0xb793('0x13')]===0x1f4){logger['error'](_0xb793('0x14'),_0xfad508,_0x4e4076[_0xb793('0x12')][_0xb793('0x15')]);return _0x610374(_0x4e4076['error'][_0xb793('0x15')]);}logger[_0xb793('0x12')](_0xb793('0x14'),_0xfad508,_0x4e4076[_0xb793('0x12')]['message']);return _0x5d1b96(_0x4e4076[_0xb793('0x12')][_0xb793('0x15')]);}else{logger[_0xb793('0xd')]('DeskField,\x20%s,\x20%s',_0xfad508,'request\x20sent');_0x5d1b96(_0x4e4076[_0xb793('0x16')][_0xb793('0x15')]);}})[_0xb793('0x17')](function(_0x5d647d){logger['error'](_0xb793('0x14'),_0xfad508,_0x5d647d);_0x610374(_0x5d647d);});});}