Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / whatsappApplication / whatsappApplication.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 _0x446c=['request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0x446c,0x156));var _0xc446=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x446c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var moment=require(_0xc446('0x2'));var BPromise=require(_0xc446('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc446('0x4'));var db=require(_0xc446('0x5'))['db'];var utils=require(_0xc446('0x6'));var logger=require('../../config/logger')(_0xc446('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc446('0x8')][_0xc446('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x578895,_0x549fac,_0x2eea75){return new BPromise(function(_0x3e9e70,_0x1ddeaf){return client[_0xc446('0xa')](_0x578895,_0x2eea75)[_0xc446('0xb')](function(_0x4a2a80){logger[_0xc446('0xc')](_0xc446('0xd'),_0x549fac,_0xc446('0xe'));logger[_0xc446('0xf')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x549fac,_0xc446('0xe'),JSON[_0xc446('0x10')](_0x4a2a80));if(_0x4a2a80[_0xc446('0x11')]){if(_0x4a2a80[_0xc446('0x11')][_0xc446('0x12')]===0x1f4){logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);return _0x1ddeaf(_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);}logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);return _0x3e9e70(_0x4a2a80[_0xc446('0x11')][_0xc446('0x13')]);}else{logger[_0xc446('0xc')](_0xc446('0xd'),_0x549fac,'request\x20sent');_0x3e9e70(_0x4a2a80[_0xc446('0x14')][_0xc446('0x13')]);}})[_0xc446('0x15')](function(_0x4690c5){logger[_0xc446('0x11')](_0xc446('0xd'),_0x549fac,_0x4690c5);_0x1ddeaf(_0x4690c5);});});}