Built motion from commit (unavailable).|2.5.30
[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 _0xdf32=['info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','Disposition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2152e4,_0x2ba423){var _0x43ee50=function(_0x522078){while(--_0x522078){_0x2152e4['push'](_0x2152e4['shift']());}};_0x43ee50(++_0x2ba423);}(_0xdf32,0xff));var _0x2df3=function(_0xdb7e29,_0x7dc66c){_0xdb7e29=_0xdb7e29-0x0;var _0x3fd5ee=_0xdf32[_0xdb7e29];return _0x3fd5ee;};'use strict';var _=require(_0x2df3('0x0'));var util=require(_0x2df3('0x1'));var moment=require(_0x2df3('0x2'));var BPromise=require(_0x2df3('0x3'));var rs=require(_0x2df3('0x4'));var fs=require('fs');var Redis=require(_0x2df3('0x5'));var db=require(_0x2df3('0x6'))['db'];var utils=require(_0x2df3('0x7'));var logger=require(_0x2df3('0x8'))(_0x2df3('0x9'));var config=require(_0x2df3('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2df3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x488935,_0xee90ac,_0x5bf9a2){return new BPromise(function(_0x3aa720,_0x55a88c){return client[_0x2df3('0xc')](_0x488935,_0x5bf9a2)[_0x2df3('0xd')](function(_0x5d4355){logger['info'](_0x2df3('0xe'),_0xee90ac,_0x2df3('0xf'));logger[_0x2df3('0x10')]('Disposition,\x20%s,\x20%s,\x20%s',_0xee90ac,_0x2df3('0xf'),JSON[_0x2df3('0x11')](_0x5d4355));if(_0x5d4355[_0x2df3('0x12')]){if(_0x5d4355[_0x2df3('0x12')][_0x2df3('0x13')]===0x1f4){logger[_0x2df3('0x12')](_0x2df3('0xe'),_0xee90ac,_0x5d4355[_0x2df3('0x12')][_0x2df3('0x14')]);return _0x55a88c(_0x5d4355[_0x2df3('0x12')][_0x2df3('0x14')]);}logger[_0x2df3('0x12')]('Disposition,\x20%s,\x20%s',_0xee90ac,_0x5d4355[_0x2df3('0x12')][_0x2df3('0x14')]);return _0x3aa720(_0x5d4355[_0x2df3('0x12')]['message']);}else{logger[_0x2df3('0x15')](_0x2df3('0xe'),_0xee90ac,_0x2df3('0xf'));_0x3aa720(_0x5d4355[_0x2df3('0x16')]['message']);}})['catch'](function(_0x1440bb){logger[_0x2df3('0x12')](_0x2df3('0xe'),_0xee90ac,_0x1440bb);_0x55a88c(_0x1440bb);});});}