Built motion from commit (unavailable).|2.5.28
[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 _0x2e92=['Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','debug'];(function(_0x122051,_0x43e0c7){var _0x23e443=function(_0x12b794){while(--_0x12b794){_0x122051['push'](_0x122051['shift']());}};_0x23e443(++_0x43e0c7);}(_0x2e92,0x98));var _0x22e9=function(_0x49c47d,_0x4ffb66){_0x49c47d=_0x49c47d-0x0;var _0x16dbdb=_0x2e92[_0x49c47d];return _0x16dbdb;};'use strict';var _=require(_0x22e9('0x0'));var util=require(_0x22e9('0x1'));var moment=require(_0x22e9('0x2'));var BPromise=require(_0x22e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x22e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x22e9('0x5'));var logger=require(_0x22e9('0x6'))(_0x22e9('0x7'));var config=require(_0x22e9('0x8'));var jayson=require(_0x22e9('0x9'));var client=jayson[_0x22e9('0xa')][_0x22e9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ba0d4,_0x2084b3,_0x4f28b6){return new BPromise(function(_0x562a39,_0x56164d){return client['request'](_0x5ba0d4,_0x4f28b6)[_0x22e9('0xc')](function(_0x4acd2f){logger[_0x22e9('0xd')](_0x22e9('0xe'),_0x2084b3,'request\x20sent');logger[_0x22e9('0xf')](_0x22e9('0x10'),_0x2084b3,'request\x20sent',JSON[_0x22e9('0x11')](_0x4acd2f));if(_0x4acd2f[_0x22e9('0x12')]){if(_0x4acd2f[_0x22e9('0x12')][_0x22e9('0x13')]===0x1f4){logger[_0x22e9('0x12')](_0x22e9('0xe'),_0x2084b3,_0x4acd2f['error'][_0x22e9('0x14')]);return _0x56164d(_0x4acd2f[_0x22e9('0x12')][_0x22e9('0x14')]);}logger['error'](_0x22e9('0xe'),_0x2084b3,_0x4acd2f[_0x22e9('0x12')]['message']);return _0x562a39(_0x4acd2f[_0x22e9('0x12')]['message']);}else{logger[_0x22e9('0xd')]('Disposition,\x20%s,\x20%s',_0x2084b3,_0x22e9('0x15'));_0x562a39(_0x4acd2f[_0x22e9('0x16')][_0x22e9('0x14')]);}})[_0x22e9('0x17')](function(_0x23ad1a){logger['error'](_0x22e9('0xe'),_0x2084b3,_0x23ad1a);_0x56164d(_0x23ad1a);});});}