Built motion from commit f7863d46.|2.5.41
[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 _0x38c7=['catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x38c7,0x1cf));var _0x738c=function(_0x44e7a7,_0x244ca8){_0x44e7a7=_0x44e7a7-0x0;var _0x923e7f=_0x38c7[_0x44e7a7];return _0x923e7f;};'use strict';var _=require(_0x738c('0x0'));var util=require('util');var moment=require(_0x738c('0x1'));var BPromise=require(_0x738c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x738c('0x3'))['db'];var utils=require(_0x738c('0x4'));var logger=require(_0x738c('0x5'))(_0x738c('0x6'));var config=require(_0x738c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x738c('0x8')][_0x738c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b2ff,_0x47dff2,_0x2a3842){return new BPromise(function(_0x58fbd0,_0x3e0695){return client[_0x738c('0xa')](_0x36b2ff,_0x2a3842)[_0x738c('0xb')](function(_0x16403a){logger[_0x738c('0xc')](_0x738c('0xd'),_0x47dff2,_0x738c('0xe'));logger[_0x738c('0xf')](_0x738c('0x10'),_0x47dff2,_0x738c('0xe'),JSON[_0x738c('0x11')](_0x16403a));if(_0x16403a['error']){if(_0x16403a[_0x738c('0x12')][_0x738c('0x13')]===0x1f4){logger[_0x738c('0x12')](_0x738c('0xd'),_0x47dff2,_0x16403a[_0x738c('0x12')][_0x738c('0x14')]);return _0x3e0695(_0x16403a['error'][_0x738c('0x14')]);}logger['error'](_0x738c('0xd'),_0x47dff2,_0x16403a[_0x738c('0x12')][_0x738c('0x14')]);return _0x58fbd0(_0x16403a[_0x738c('0x12')][_0x738c('0x14')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x47dff2,'request\x20sent');_0x58fbd0(_0x16403a['result'][_0x738c('0x14')]);}})[_0x738c('0x15')](function(_0x56754e){logger[_0x738c('0x12')](_0x738c('0xd'),_0x47dff2,_0x56754e);_0x3e0695(_0x56754e);});});}