Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / smsTransferReport / smsTransferReport.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 _0xc99e=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x34fc47,_0x13769f){var _0x47f78=function(_0x1a1f0e){while(--_0x1a1f0e){_0x34fc47['push'](_0x34fc47['shift']());}};_0x47f78(++_0x13769f);}(_0xc99e,0x6e));var _0xec99=function(_0x1f7b72,_0x3d22f1){_0x1f7b72=_0x1f7b72-0x0;var _0x1f79fb=_0xc99e[_0x1f7b72];return _0x1f79fb;};'use strict';var _=require(_0xec99('0x0'));var util=require(_0xec99('0x1'));var moment=require(_0xec99('0x2'));var BPromise=require(_0xec99('0x3'));var rs=require(_0xec99('0x4'));var fs=require('fs');var Redis=require(_0xec99('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xec99('0x6'));var logger=require(_0xec99('0x7'))(_0xec99('0x8'));var config=require(_0xec99('0x9'));var jayson=require(_0xec99('0xa'));var client=jayson[_0xec99('0xb')][_0xec99('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x470d70,_0x558b08,_0x797806){return new BPromise(function(_0x425a61,_0x546391){return client[_0xec99('0xd')](_0x470d70,_0x797806)[_0xec99('0xe')](function(_0x47ecf6){logger['info'](_0xec99('0xf'),_0x558b08,_0xec99('0x10'));logger[_0xec99('0x11')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x558b08,_0xec99('0x10'),JSON[_0xec99('0x12')](_0x47ecf6));if(_0x47ecf6[_0xec99('0x13')]){if(_0x47ecf6[_0xec99('0x13')][_0xec99('0x14')]===0x1f4){logger[_0xec99('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x558b08,_0x47ecf6[_0xec99('0x13')]['message']);return _0x546391(_0x47ecf6[_0xec99('0x13')]['message']);}logger[_0xec99('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x558b08,_0x47ecf6['error'][_0xec99('0x15')]);return _0x425a61(_0x47ecf6['error'][_0xec99('0x15')]);}else{logger[_0xec99('0x16')](_0xec99('0xf'),_0x558b08,_0xec99('0x10'));_0x425a61(_0x47ecf6[_0xec99('0x17')][_0xec99('0x15')]);}})[_0xec99('0x18')](function(_0x4e03db){logger[_0xec99('0x13')](_0xec99('0xf'),_0x558b08,_0x4e03db);_0x546391(_0x4e03db);});});}