Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / userSmsQueue / userSmsQueue.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 _0x215b=['message','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x9fdd53,_0xd7b5c0){var _0x4ed380=function(_0x365143){while(--_0x365143){_0x9fdd53['push'](_0x9fdd53['shift']());}};_0x4ed380(++_0xd7b5c0);}(_0x215b,0x122));var _0xb215=function(_0x8fb2a3,_0x4b0261){_0x8fb2a3=_0x8fb2a3-0x0;var _0x34ffd7=_0x215b[_0x8fb2a3];return _0x34ffd7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb215('0x0'));var rs=require(_0xb215('0x1'));var fs=require('fs');var Redis=require(_0xb215('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb215('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xb215('0x4'));var jayson=require(_0xb215('0x5'));var client=jayson[_0xb215('0x6')][_0xb215('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xeb0556,_0x3837df,_0x361ba0){return new BPromise(function(_0x2afca6,_0x41354a){return client['request'](_0xeb0556,_0x361ba0)[_0xb215('0x8')](function(_0x1276b6){logger[_0xb215('0x9')](_0xb215('0xa'),_0x3837df,_0xb215('0xb'));logger[_0xb215('0xc')](_0xb215('0xd'),_0x3837df,_0xb215('0xb'),JSON['stringify'](_0x1276b6));if(_0x1276b6[_0xb215('0xe')]){if(_0x1276b6[_0xb215('0xe')][_0xb215('0xf')]===0x1f4){logger[_0xb215('0xe')](_0xb215('0xa'),_0x3837df,_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);return _0x41354a(_0x1276b6['error'][_0xb215('0x10')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x3837df,_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);return _0x2afca6(_0x1276b6[_0xb215('0xe')][_0xb215('0x10')]);}else{logger[_0xb215('0x9')](_0xb215('0xa'),_0x3837df,_0xb215('0xb'));_0x2afca6(_0x1276b6['result'][_0xb215('0x10')]);}})[_0xb215('0x11')](function(_0x146497){logger[_0xb215('0xe')](_0xb215('0xa'),_0x3837df,_0x146497);_0x41354a(_0x146497);});});}