Built motion from commit (unavailable).|2.2.0
[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 _0xfc65=['result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58a23,_0x30ce52){var _0x3d4fb5=function(_0x39e2d8){while(--_0x39e2d8){_0x58a23['push'](_0x58a23['shift']());}};_0x3d4fb5(++_0x30ce52);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x10ad4e,_0x5003e3){_0x10ad4e=_0x10ad4e-0x0;var _0x181ec8=_0xfc65[_0x10ad4e];return _0x181ec8;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5fc6('0x1'));var rs=require(_0x5fc6('0x2'));var fs=require('fs');var Redis=require(_0x5fc6('0x3'));var db=require(_0x5fc6('0x4'))['db'];var utils=require(_0x5fc6('0x5'));var logger=require(_0x5fc6('0x6'))(_0x5fc6('0x7'));var config=require(_0x5fc6('0x8'));var jayson=require(_0x5fc6('0x9'));var client=jayson[_0x5fc6('0xa')][_0x5fc6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x409c5f,_0x1a9600,_0x572941){return new BPromise(function(_0x3921c5,_0x1f1409){return client[_0x5fc6('0xc')](_0x409c5f,_0x572941)[_0x5fc6('0xd')](function(_0x16c285){logger[_0x5fc6('0xe')](_0x5fc6('0xf'),_0x1a9600,_0x5fc6('0x10'));logger[_0x5fc6('0x11')](_0x5fc6('0x12'),_0x1a9600,'request\x20sent',JSON[_0x5fc6('0x13')](_0x16c285));if(_0x16c285['error']){if(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x15')]===0x1f4){logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x16c285['error'][_0x5fc6('0x16')]);return _0x1f1409(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);}logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);return _0x3921c5(_0x16c285[_0x5fc6('0x14')][_0x5fc6('0x16')]);}else{logger[_0x5fc6('0xe')]('Disposition,\x20%s,\x20%s',_0x1a9600,'request\x20sent');_0x3921c5(_0x16c285[_0x5fc6('0x17')][_0x5fc6('0x16')]);}})['catch'](function(_0x26d2ba){logger[_0x5fc6('0x14')](_0x5fc6('0xf'),_0x1a9600,_0x26d2ba);_0x1f1409(_0x26d2ba);});});}