Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / api / intDeskField / intDeskField.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 _0x918e=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e2359,_0x1915f4){var _0x4a65c1=function(_0x539444){while(--_0x539444){_0x2e2359['push'](_0x2e2359['shift']());}};_0x4a65c1(++_0x1915f4);}(_0x918e,0x1a6));var _0xe918=function(_0x14e99a,_0x13fb58){_0x14e99a=_0x14e99a-0x0;var _0x11e26c=_0x918e[_0x14e99a];return _0x11e26c;};'use strict';var _=require(_0xe918('0x0'));var util=require('util');var moment=require(_0xe918('0x1'));var BPromise=require('bluebird');var rs=require(_0xe918('0x2'));var fs=require('fs');var Redis=require(_0xe918('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe918('0x4'));var logger=require('../../config/logger')(_0xe918('0x5'));var config=require('../../config/environment');var jayson=require(_0xe918('0x6'));var client=jayson['client'][_0xe918('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x585265,_0x383472,_0x1597cc){return new BPromise(function(_0x27da35,_0x5d28bc){return client['request'](_0x585265,_0x1597cc)[_0xe918('0x8')](function(_0x3d340c){logger[_0xe918('0x9')](_0xe918('0xa'),_0x383472,'request\x20sent');logger[_0xe918('0xb')](_0xe918('0xc'),_0x383472,'request\x20sent',JSON[_0xe918('0xd')](_0x3d340c));if(_0x3d340c[_0xe918('0xe')]){if(_0x3d340c['error'][_0xe918('0xf')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x383472,_0x3d340c[_0xe918('0xe')][_0xe918('0x10')]);return _0x5d28bc(_0x3d340c[_0xe918('0xe')]['message']);}logger[_0xe918('0xe')](_0xe918('0xa'),_0x383472,_0x3d340c[_0xe918('0xe')][_0xe918('0x10')]);return _0x27da35(_0x3d340c[_0xe918('0xe')]['message']);}else{logger[_0xe918('0x9')]('DeskField,\x20%s,\x20%s',_0x383472,'request\x20sent');_0x27da35(_0x3d340c[_0xe918('0x11')][_0xe918('0x10')]);}})[_0xe918('0x12')](function(_0x43a0d3){logger['error'](_0xe918('0xa'),_0x383472,_0x43a0d3);_0x5d28bc(_0x43a0d3);});});}