Built motion from commit (unavailable).|2.5.25
[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 _0x87f5=['../../mysqldb','../../config/logger','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','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5201c0,_0x171649){var _0x11222a=function(_0x3c0499){while(--_0x3c0499){_0x5201c0['push'](_0x5201c0['shift']());}};_0x11222a(++_0x171649);}(_0x87f5,0x14a));var _0x587f=function(_0x392cc6,_0x3031f7){_0x392cc6=_0x392cc6-0x0;var _0x3f9f22=_0x87f5[_0x392cc6];return _0x3f9f22;};'use strict';var _=require(_0x587f('0x0'));var util=require(_0x587f('0x1'));var moment=require(_0x587f('0x2'));var BPromise=require(_0x587f('0x3'));var rs=require(_0x587f('0x4'));var fs=require('fs');var Redis=require(_0x587f('0x5'));var db=require(_0x587f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x587f('0x7'))(_0x587f('0x8'));var config=require(_0x587f('0x9'));var jayson=require(_0x587f('0xa'));var client=jayson['client'][_0x587f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x119973,_0x2f1262,_0x44dd38){return new BPromise(function(_0x364ccc,_0x47b7f2){return client[_0x587f('0xc')](_0x119973,_0x44dd38)[_0x587f('0xd')](function(_0x5d486d){logger[_0x587f('0xe')](_0x587f('0xf'),_0x2f1262,_0x587f('0x10'));logger[_0x587f('0x11')](_0x587f('0x12'),_0x2f1262,_0x587f('0x10'),JSON[_0x587f('0x13')](_0x5d486d));if(_0x5d486d[_0x587f('0x14')]){if(_0x5d486d[_0x587f('0x14')][_0x587f('0x15')]===0x1f4){logger[_0x587f('0x14')](_0x587f('0xf'),_0x2f1262,_0x5d486d[_0x587f('0x14')][_0x587f('0x16')]);return _0x47b7f2(_0x5d486d['error'][_0x587f('0x16')]);}logger[_0x587f('0x14')](_0x587f('0xf'),_0x2f1262,_0x5d486d[_0x587f('0x14')][_0x587f('0x16')]);return _0x364ccc(_0x5d486d['error'][_0x587f('0x16')]);}else{logger[_0x587f('0xe')](_0x587f('0xf'),_0x2f1262,'request\x20sent');_0x364ccc(_0x5d486d['result']['message']);}})[_0x587f('0x17')](function(_0xc907a9){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x2f1262,_0xc907a9);_0x47b7f2(_0xc907a9);});});}