Built motion from commit (unavailable).|2.5.2
[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 _0x48cf=['catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','error','message','result'];(function(_0x352b49,_0x16a4ee){var _0x2e314a=function(_0x339d73){while(--_0x339d73){_0x352b49['push'](_0x352b49['shift']());}};_0x2e314a(++_0x16a4ee);}(_0x48cf,0x145));var _0xf48c=function(_0x5d31a2,_0x296fdc){_0x5d31a2=_0x5d31a2-0x0;var _0x5d8937=_0x48cf[_0x5d31a2];return _0x5d8937;};'use strict';var _=require(_0xf48c('0x0'));var util=require(_0xf48c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf48c('0x2'));var fs=require('fs');var Redis=require(_0xf48c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf48c('0x4'));var logger=require('../../config/logger')(_0xf48c('0x5'));var config=require(_0xf48c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf48c('0x7')][_0xf48c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52ef08,_0x5468b4,_0x5bd71e){return new BPromise(function(_0x4f0d03,_0x3f4a23){return client['request'](_0x52ef08,_0x5bd71e)[_0xf48c('0x9')](function(_0x6c15b){logger[_0xf48c('0xa')](_0xf48c('0xb'),_0x5468b4,'request\x20sent');logger[_0xf48c('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0x5468b4,_0xf48c('0xd'),JSON['stringify'](_0x6c15b));if(_0x6c15b[_0xf48c('0xe')]){if(_0x6c15b['error']['code']===0x1f4){logger[_0xf48c('0xe')]('DeskField,\x20%s,\x20%s',_0x5468b4,_0x6c15b[_0xf48c('0xe')][_0xf48c('0xf')]);return _0x3f4a23(_0x6c15b[_0xf48c('0xe')]['message']);}logger[_0xf48c('0xe')]('DeskField,\x20%s,\x20%s',_0x5468b4,_0x6c15b[_0xf48c('0xe')]['message']);return _0x4f0d03(_0x6c15b[_0xf48c('0xe')][_0xf48c('0xf')]);}else{logger[_0xf48c('0xa')](_0xf48c('0xb'),_0x5468b4,'request\x20sent');_0x4f0d03(_0x6c15b[_0xf48c('0x10')][_0xf48c('0xf')]);}})[_0xf48c('0x11')](function(_0x32f132){logger[_0xf48c('0xe')](_0xf48c('0xb'),_0x5468b4,_0x32f132);_0x3f4a23(_0x32f132);});});}