Built motion from commit (unavailable).|2.5.11
[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 _0x2fd9=['then','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0x2fd9,0x9b));var _0x92fd=function(_0x158902,_0x4c45bc){_0x158902=_0x158902-0x0;var _0x2bec55=_0x2fd9[_0x158902];return _0x2bec55;};'use strict';var _=require(_0x92fd('0x0'));var util=require(_0x92fd('0x1'));var moment=require(_0x92fd('0x2'));var BPromise=require(_0x92fd('0x3'));var rs=require(_0x92fd('0x4'));var fs=require('fs');var Redis=require(_0x92fd('0x5'));var db=require(_0x92fd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x92fd('0x7'))(_0x92fd('0x8'));var config=require(_0x92fd('0x9'));var jayson=require(_0x92fd('0xa'));var client=jayson[_0x92fd('0xb')][_0x92fd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ebdf3,_0x4c7703,_0x2a8d85){return new BPromise(function(_0x597008,_0x1f8347){return client['request'](_0x5ebdf3,_0x2a8d85)[_0x92fd('0xd')](function(_0x487b93){logger[_0x92fd('0xe')](_0x92fd('0xf'),_0x4c7703,'request\x20sent');logger[_0x92fd('0x10')](_0x92fd('0x11'),_0x4c7703,_0x92fd('0x12'),JSON[_0x92fd('0x13')](_0x487b93));if(_0x487b93[_0x92fd('0x14')]){if(_0x487b93[_0x92fd('0x14')][_0x92fd('0x15')]===0x1f4){logger[_0x92fd('0x14')](_0x92fd('0xf'),_0x4c7703,_0x487b93[_0x92fd('0x14')][_0x92fd('0x16')]);return _0x1f8347(_0x487b93[_0x92fd('0x14')][_0x92fd('0x16')]);}logger[_0x92fd('0x14')](_0x92fd('0xf'),_0x4c7703,_0x487b93['error'][_0x92fd('0x16')]);return _0x597008(_0x487b93[_0x92fd('0x14')][_0x92fd('0x16')]);}else{logger[_0x92fd('0xe')](_0x92fd('0xf'),_0x4c7703,_0x92fd('0x12'));_0x597008(_0x487b93['result'][_0x92fd('0x16')]);}})[_0x92fd('0x17')](function(_0x148da9){logger[_0x92fd('0x14')](_0x92fd('0xf'),_0x4c7703,_0x148da9);_0x1f8347(_0x148da9);});});}