Built motion from commit 14588770.|2.5.38
[motion2.git] / server / api / userWhatsappQueue / userWhatsappQueue.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 _0x95fc=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ac10c,_0x5a6415){var _0x58b91f=function(_0x42ac5f){while(--_0x42ac5f){_0x3ac10c['push'](_0x3ac10c['shift']());}};_0x58b91f(++_0x5a6415);}(_0x95fc,0x1b2));var _0xc95f=function(_0x31ab90,_0x145a96){_0x31ab90=_0x31ab90-0x0;var _0x2d6123=_0x95fc[_0x31ab90];return _0x2d6123;};'use strict';var _=require(_0xc95f('0x0'));var util=require(_0xc95f('0x1'));var moment=require(_0xc95f('0x2'));var BPromise=require(_0xc95f('0x3'));var rs=require(_0xc95f('0x4'));var fs=require('fs');var Redis=require(_0xc95f('0x5'));var db=require(_0xc95f('0x6'))['db'];var utils=require(_0xc95f('0x7'));var logger=require(_0xc95f('0x8'))('rpc');var config=require(_0xc95f('0x9'));var jayson=require(_0xc95f('0xa'));var client=jayson['client'][_0xc95f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9280a3,_0x228bf8,_0x920327){return new BPromise(function(_0x5a4fc9,_0x366798){return client[_0xc95f('0xc')](_0x9280a3,_0x920327)[_0xc95f('0xd')](function(_0x4bfeb0){logger[_0xc95f('0xe')](_0xc95f('0xf'),_0x228bf8,_0xc95f('0x10'));logger[_0xc95f('0x11')](_0xc95f('0x12'),_0x228bf8,_0xc95f('0x10'),JSON[_0xc95f('0x13')](_0x4bfeb0));if(_0x4bfeb0[_0xc95f('0x14')]){if(_0x4bfeb0[_0xc95f('0x14')][_0xc95f('0x15')]===0x1f4){logger[_0xc95f('0x14')](_0xc95f('0xf'),_0x228bf8,_0x4bfeb0['error'][_0xc95f('0x16')]);return _0x366798(_0x4bfeb0[_0xc95f('0x14')]['message']);}logger[_0xc95f('0x14')](_0xc95f('0xf'),_0x228bf8,_0x4bfeb0[_0xc95f('0x14')][_0xc95f('0x16')]);return _0x5a4fc9(_0x4bfeb0[_0xc95f('0x14')]['message']);}else{logger[_0xc95f('0xe')](_0xc95f('0xf'),_0x228bf8,'request\x20sent');_0x5a4fc9(_0x4bfeb0['result'][_0xc95f('0x16')]);}})[_0xc95f('0x17')](function(_0x20e215){logger[_0xc95f('0x14')](_0xc95f('0xf'),_0x228bf8,_0x20e215);_0x366798(_0x20e215);});});}