Built motion from commit 9d0783e6.|2.6.13
[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 _0x8f87=['catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x202836,_0x507ef8){var _0x478dd4=function(_0x288b61){while(--_0x288b61){_0x202836['push'](_0x202836['shift']());}};_0x478dd4(++_0x507ef8);}(_0x8f87,0xfe));var _0x78f8=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0x8f87[_0x2dbce7];return _0x3a3ed0;};'use strict';var _=require(_0x78f8('0x0'));var util=require(_0x78f8('0x1'));var moment=require(_0x78f8('0x2'));var BPromise=require(_0x78f8('0x3'));var rs=require(_0x78f8('0x4'));var fs=require('fs');var Redis=require(_0x78f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78f8('0x6'));var config=require(_0x78f8('0x7'));var jayson=require(_0x78f8('0x8'));var client=jayson['client'][_0x78f8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c7fb5,_0xcd247a,_0x442c6c){return new BPromise(function(_0x4e17d9,_0x3440ea){return client[_0x78f8('0xa')](_0x3c7fb5,_0x442c6c)[_0x78f8('0xb')](function(_0x188933){logger[_0x78f8('0xc')](_0x78f8('0xd'),_0xcd247a,_0x78f8('0xe'));logger[_0x78f8('0xf')](_0x78f8('0x10'),_0xcd247a,'request\x20sent',JSON[_0x78f8('0x11')](_0x188933));if(_0x188933[_0x78f8('0x12')]){if(_0x188933[_0x78f8('0x12')][_0x78f8('0x13')]===0x1f4){logger[_0x78f8('0x12')](_0x78f8('0xd'),_0xcd247a,_0x188933[_0x78f8('0x12')]['message']);return _0x3440ea(_0x188933[_0x78f8('0x12')][_0x78f8('0x14')]);}logger[_0x78f8('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0xcd247a,_0x188933['error'][_0x78f8('0x14')]);return _0x4e17d9(_0x188933[_0x78f8('0x12')]['message']);}else{logger[_0x78f8('0xc')](_0x78f8('0xd'),_0xcd247a,_0x78f8('0xe'));_0x4e17d9(_0x188933[_0x78f8('0x15')]['message']);}})[_0x78f8('0x16')](function(_0x1c5468){logger[_0x78f8('0x12')](_0x78f8('0xd'),_0xcd247a,_0x1c5468);_0x3440ea(_0x1c5468);});});}