Built motion from commit (unavailable).|2.4.20
[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 _0xa803=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','Disposition,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x3a3e6e,_0x437020){var _0x3514ee=function(_0x426bce){while(--_0x426bce){_0x3a3e6e['push'](_0x3a3e6e['shift']());}};_0x3514ee(++_0x437020);}(_0xa803,0xad));var _0x3a80=function(_0x201ec8,_0x533426){_0x201ec8=_0x201ec8-0x0;var _0x37f802=_0xa803[_0x201ec8];return _0x37f802;};'use strict';var _=require(_0x3a80('0x0'));var util=require(_0x3a80('0x1'));var moment=require(_0x3a80('0x2'));var BPromise=require(_0x3a80('0x3'));var rs=require(_0x3a80('0x4'));var fs=require('fs');var Redis=require(_0x3a80('0x5'));var db=require(_0x3a80('0x6'))['db'];var utils=require(_0x3a80('0x7'));var logger=require(_0x3a80('0x8'))(_0x3a80('0x9'));var config=require(_0x3a80('0xa'));var jayson=require(_0x3a80('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e0d5d,_0x17498d,_0x51573a){return new BPromise(function(_0x4e7fb1,_0x2a0069){return client['request'](_0x5e0d5d,_0x51573a)['then'](function(_0x553680){logger['info']('Disposition,\x20%s,\x20%s',_0x17498d,_0x3a80('0xc'));logger['debug'](_0x3a80('0xd'),_0x17498d,'request\x20sent',JSON[_0x3a80('0xe')](_0x553680));if(_0x553680[_0x3a80('0xf')]){if(_0x553680['error'][_0x3a80('0x10')]===0x1f4){logger['error'](_0x3a80('0x11'),_0x17498d,_0x553680['error'][_0x3a80('0x12')]);return _0x2a0069(_0x553680[_0x3a80('0xf')][_0x3a80('0x12')]);}logger[_0x3a80('0xf')](_0x3a80('0x11'),_0x17498d,_0x553680[_0x3a80('0xf')][_0x3a80('0x12')]);return _0x4e7fb1(_0x553680[_0x3a80('0xf')][_0x3a80('0x12')]);}else{logger[_0x3a80('0x13')](_0x3a80('0x11'),_0x17498d,_0x3a80('0xc'));_0x4e7fb1(_0x553680[_0x3a80('0x14')][_0x3a80('0x12')]);}})[_0x3a80('0x15')](function(_0x3ecd79){logger[_0x3a80('0xf')](_0x3a80('0x11'),_0x17498d,_0x3ecd79);_0x2a0069(_0x3ecd79);});});}