Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / api / chatProactiveAction / chatProactiveAction.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 _0x723f=['code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x58a1a3,_0x5f54a8){var _0x5d5e22=function(_0x445527){while(--_0x445527){_0x58a1a3['push'](_0x58a1a3['shift']());}};_0x5d5e22(++_0x5f54a8);}(_0x723f,0xd6));var _0xf723=function(_0x20c0f5,_0x490a09){_0x20c0f5=_0x20c0f5-0x0;var _0x2a1933=_0x723f[_0x20c0f5];return _0x2a1933;};'use strict';var _=require('lodash');var util=require(_0xf723('0x0'));var moment=require('moment');var BPromise=require(_0xf723('0x1'));var rs=require(_0xf723('0x2'));var fs=require('fs');var Redis=require(_0xf723('0x3'));var db=require(_0xf723('0x4'))['db'];var utils=require(_0xf723('0x5'));var logger=require(_0xf723('0x6'))(_0xf723('0x7'));var config=require(_0xf723('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf723('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fc17,_0x5edc7e,_0x5acc5e){return new BPromise(function(_0x220d8a,_0x221f8d){return client[_0xf723('0xa')](_0x25fc17,_0x5acc5e)['then'](function(_0x53367e){logger[_0xf723('0xb')](_0xf723('0xc'),_0x5edc7e,'request\x20sent');logger[_0xf723('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5edc7e,_0xf723('0xe'),JSON[_0xf723('0xf')](_0x53367e));if(_0x53367e[_0xf723('0x10')]){if(_0x53367e[_0xf723('0x10')][_0xf723('0x11')]===0x1f4){logger[_0xf723('0x10')](_0xf723('0xc'),_0x5edc7e,_0x53367e[_0xf723('0x10')][_0xf723('0x12')]);return _0x221f8d(_0x53367e[_0xf723('0x10')][_0xf723('0x12')]);}logger[_0xf723('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5edc7e,_0x53367e['error'][_0xf723('0x12')]);return _0x220d8a(_0x53367e[_0xf723('0x10')][_0xf723('0x12')]);}else{logger[_0xf723('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x5edc7e,'request\x20sent');_0x220d8a(_0x53367e[_0xf723('0x13')][_0xf723('0x12')]);}})[_0xf723('0x14')](function(_0x1fc369){logger[_0xf723('0x10')](_0xf723('0xc'),_0x5edc7e,_0x1fc369);_0x221f8d(_0x1fc369);});});}