Built motion from commit d6d69adf.|2.6.33
[motion2.git] / server / api / smsApplication / smsApplication.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 _0x3ef7=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3a34c2,_0x3fb737){var _0x58cdef=function(_0x3336d1){while(--_0x3336d1){_0x3a34c2['push'](_0x3a34c2['shift']());}};_0x58cdef(++_0x3fb737);}(_0x3ef7,0xa2));var _0x73ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ef7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var moment=require(_0x73ef('0x1'));var BPromise=require(_0x73ef('0x2'));var rs=require(_0x73ef('0x3'));var fs=require('fs');var Redis=require(_0x73ef('0x4'));var db=require(_0x73ef('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73ef('0x6'))(_0x73ef('0x7'));var config=require(_0x73ef('0x8'));var jayson=require(_0x73ef('0x9'));var client=jayson['client'][_0x73ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x137f35,_0x1bc285,_0x1b2802){return new BPromise(function(_0xe938e1,_0x4cd5ce){return client[_0x73ef('0xb')](_0x137f35,_0x1b2802)[_0x73ef('0xc')](function(_0x50098a){logger[_0x73ef('0xd')](_0x73ef('0xe'),_0x1bc285,_0x73ef('0xf'));logger[_0x73ef('0x10')](_0x73ef('0x11'),_0x1bc285,'request\x20sent',JSON[_0x73ef('0x12')](_0x50098a));if(_0x50098a[_0x73ef('0x13')]){if(_0x50098a[_0x73ef('0x13')][_0x73ef('0x14')]===0x1f4){logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x50098a[_0x73ef('0x13')][_0x73ef('0x15')]);return _0x4cd5ce(_0x50098a[_0x73ef('0x13')][_0x73ef('0x15')]);}logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x50098a[_0x73ef('0x13')]['message']);return _0xe938e1(_0x50098a[_0x73ef('0x13')]['message']);}else{logger[_0x73ef('0xd')](_0x73ef('0xe'),_0x1bc285,_0x73ef('0xf'));_0xe938e1(_0x50098a['result'][_0x73ef('0x15')]);}})[_0x73ef('0x16')](function(_0x4bccf6){logger[_0x73ef('0x13')](_0x73ef('0xe'),_0x1bc285,_0x4bccf6);_0x4cd5ce(_0x4bccf6);});});}