Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / disposition / disposition.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 _0x347e=['code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x411b68,_0x52e768){var _0x41ff90=function(_0x2ab602){while(--_0x2ab602){_0x411b68['push'](_0x411b68['shift']());}};_0x41ff90(++_0x52e768);}(_0x347e,0xa5));var _0xe347=function(_0x2a6f78,_0x57aee6){_0x2a6f78=_0x2a6f78-0x0;var _0x37f15e=_0x347e[_0x2a6f78];return _0x37f15e;};'use strict';var _=require(_0xe347('0x0'));var util=require(_0xe347('0x1'));var moment=require(_0xe347('0x2'));var BPromise=require(_0xe347('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe347('0x4'));var db=require(_0xe347('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe347('0x6'))(_0xe347('0x7'));var config=require(_0xe347('0x8'));var jayson=require(_0xe347('0x9'));var client=jayson[_0xe347('0xa')][_0xe347('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cb12b,_0x5a244a,_0x560e49){return new BPromise(function(_0x3d7c3b,_0x273754){return client[_0xe347('0xc')](_0x3cb12b,_0x560e49)[_0xe347('0xd')](function(_0x945a5f){logger['info'](_0xe347('0xe'),_0x5a244a,'request\x20sent');logger[_0xe347('0xf')](_0xe347('0x10'),_0x5a244a,_0xe347('0x11'),JSON['stringify'](_0x945a5f));if(_0x945a5f['error']){if(_0x945a5f[_0xe347('0x12')][_0xe347('0x13')]===0x1f4){logger[_0xe347('0x12')]('Disposition,\x20%s,\x20%s',_0x5a244a,_0x945a5f[_0xe347('0x12')][_0xe347('0x14')]);return _0x273754(_0x945a5f[_0xe347('0x12')][_0xe347('0x14')]);}logger['error']('Disposition,\x20%s,\x20%s',_0x5a244a,_0x945a5f[_0xe347('0x12')][_0xe347('0x14')]);return _0x3d7c3b(_0x945a5f['error'][_0xe347('0x14')]);}else{logger[_0xe347('0x15')](_0xe347('0xe'),_0x5a244a,'request\x20sent');_0x3d7c3b(_0x945a5f[_0xe347('0x16')][_0xe347('0x14')]);}})['catch'](function(_0x519300){logger[_0xe347('0x12')](_0xe347('0xe'),_0x5a244a,_0x519300);_0x273754(_0x519300);});});}