dc2bf906fd6a007af9134c9a18724d8f4ce83a3d
[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 _0xd072=['http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2ca7ac,_0x10e35c){var _0x287238=function(_0x36787b){while(--_0x36787b){_0x2ca7ac['push'](_0x2ca7ac['shift']());}};_0x287238(++_0x10e35c);}(_0xd072,0x17b));var _0x2d07=function(_0x223dd7,_0x430f0c){_0x223dd7=_0x223dd7-0x0;var _0x84128d=_0xd072[_0x223dd7];return _0x84128d;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var moment=require(_0x2d07('0x2'));var BPromise=require(_0x2d07('0x3'));var rs=require(_0x2d07('0x4'));var fs=require('fs');var Redis=require(_0x2d07('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2d07('0x6'));var logger=require(_0x2d07('0x7'))(_0x2d07('0x8'));var config=require(_0x2d07('0x9'));var jayson=require(_0x2d07('0xa'));var client=jayson[_0x2d07('0xb')][_0x2d07('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a76ec,_0x11d1c8,_0x5e080a){return new BPromise(function(_0x50e91d,_0x29b154){return client['request'](_0x2a76ec,_0x5e080a)[_0x2d07('0xd')](function(_0x2729d5){logger[_0x2d07('0xe')](_0x2d07('0xf'),_0x11d1c8,_0x2d07('0x10'));logger[_0x2d07('0x11')](_0x2d07('0x12'),_0x11d1c8,_0x2d07('0x10'),JSON[_0x2d07('0x13')](_0x2729d5));if(_0x2729d5[_0x2d07('0x14')]){if(_0x2729d5['error'][_0x2d07('0x15')]===0x1f4){logger[_0x2d07('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x11d1c8,_0x2729d5[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x29b154(_0x2729d5['error'][_0x2d07('0x16')]);}logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x11d1c8,_0x2729d5[_0x2d07('0x14')][_0x2d07('0x16')]);return _0x50e91d(_0x2729d5[_0x2d07('0x14')][_0x2d07('0x16')]);}else{logger[_0x2d07('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x11d1c8,_0x2d07('0x10'));_0x50e91d(_0x2729d5['result']['message']);}})['catch'](function(_0xa55cde){logger[_0x2d07('0x14')](_0x2d07('0xf'),_0x11d1c8,_0xa55cde);_0x29b154(_0xa55cde);});});}