Built motion from commit 14588770.|2.5.38
[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 _0xac6a=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac6a,0xa2));var _0xaac6=function(_0x57bb89,_0x2e6ba4){_0x57bb89=_0x57bb89-0x0;var _0x1dfe15=_0xac6a[_0x57bb89];return _0x1dfe15;};'use strict';var _=require(_0xaac6('0x0'));var util=require('util');var moment=require(_0xaac6('0x1'));var BPromise=require(_0xaac6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaac6('0x3'));var db=require(_0xaac6('0x4'))['db'];var utils=require(_0xaac6('0x5'));var logger=require('../../config/logger')(_0xaac6('0x6'));var config=require(_0xaac6('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x289411,_0x1093aa,_0x91069a){return new BPromise(function(_0x5d4e52,_0x1f48ec){return client[_0xaac6('0x8')](_0x289411,_0x91069a)[_0xaac6('0x9')](function(_0x46cd13){logger[_0xaac6('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x1093aa,'request\x20sent');logger[_0xaac6('0xb')](_0xaac6('0xc'),_0x1093aa,'request\x20sent',JSON[_0xaac6('0xd')](_0x46cd13));if(_0x46cd13['error']){if(_0x46cd13[_0xaac6('0xe')][_0xaac6('0xf')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1093aa,_0x46cd13['error'][_0xaac6('0x10')]);return _0x1f48ec(_0x46cd13[_0xaac6('0xe')][_0xaac6('0x10')]);}logger[_0xaac6('0xe')](_0xaac6('0x11'),_0x1093aa,_0x46cd13[_0xaac6('0xe')][_0xaac6('0x10')]);return _0x5d4e52(_0x46cd13[_0xaac6('0xe')][_0xaac6('0x10')]);}else{logger[_0xaac6('0xa')](_0xaac6('0x11'),_0x1093aa,'request\x20sent');_0x5d4e52(_0x46cd13['result'][_0xaac6('0x10')]);}})['catch'](function(_0x555778){logger['error'](_0xaac6('0x11'),_0x1093aa,_0x555778);_0x1f48ec(_0x555778);});});}