Built motion from commit (unavailable).|2.4.21
[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 _0xeae7=['debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent'];(function(_0x3baa35,_0x2dbcff){var _0x3f2572=function(_0x5d5013){while(--_0x5d5013){_0x3baa35['push'](_0x3baa35['shift']());}};_0x3f2572(++_0x2dbcff);}(_0xeae7,0x14d));var _0x7eae=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xeae7[_0x2b0bc2];return _0x56e5b9;};'use strict';var _=require('lodash');var util=require(_0x7eae('0x0'));var moment=require(_0x7eae('0x1'));var BPromise=require(_0x7eae('0x2'));var rs=require(_0x7eae('0x3'));var fs=require('fs');var Redis=require(_0x7eae('0x4'));var db=require(_0x7eae('0x5'))['db'];var utils=require(_0x7eae('0x6'));var logger=require('../../config/logger')(_0x7eae('0x7'));var config=require(_0x7eae('0x8'));var jayson=require(_0x7eae('0x9'));var client=jayson[_0x7eae('0xa')][_0x7eae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x479afa,_0x9abdf1,_0x407e63){return new BPromise(function(_0x58cdd8,_0xc93f18){return client[_0x7eae('0xc')](_0x479afa,_0x407e63)[_0x7eae('0xd')](function(_0x45c2ab){logger[_0x7eae('0xe')](_0x7eae('0xf'),_0x9abdf1,_0x7eae('0x10'));logger[_0x7eae('0x11')](_0x7eae('0x12'),_0x9abdf1,_0x7eae('0x10'),JSON[_0x7eae('0x13')](_0x45c2ab));if(_0x45c2ab[_0x7eae('0x14')]){if(_0x45c2ab[_0x7eae('0x14')][_0x7eae('0x15')]===0x1f4){logger[_0x7eae('0x14')](_0x7eae('0xf'),_0x9abdf1,_0x45c2ab[_0x7eae('0x14')][_0x7eae('0x16')]);return _0xc93f18(_0x45c2ab['error']['message']);}logger[_0x7eae('0x14')](_0x7eae('0xf'),_0x9abdf1,_0x45c2ab[_0x7eae('0x14')][_0x7eae('0x16')]);return _0x58cdd8(_0x45c2ab[_0x7eae('0x14')][_0x7eae('0x16')]);}else{logger[_0x7eae('0xe')](_0x7eae('0xf'),_0x9abdf1,_0x7eae('0x10'));_0x58cdd8(_0x45c2ab[_0x7eae('0x17')][_0x7eae('0x16')]);}})[_0x7eae('0x18')](function(_0x1f623e){logger[_0x7eae('0x14')]('Disposition,\x20%s,\x20%s',_0x9abdf1,_0x1f623e);_0xc93f18(_0x1f623e);});});}