Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / voiceMusicOnHold / voiceMusicOnHold.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 _0x14cb=['VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1758f1,_0x35446f){var _0x173003=function(_0x315aec){while(--_0x315aec){_0x1758f1['push'](_0x1758f1['shift']());}};_0x173003(++_0x35446f);}(_0x14cb,0x13a));var _0xb14c=function(_0x312487,_0x492ecc){_0x312487=_0x312487-0x0;var _0x327767=_0x14cb[_0x312487];return _0x327767;};'use strict';var _=require(_0xb14c('0x0'));var util=require('util');var moment=require(_0xb14c('0x1'));var BPromise=require(_0xb14c('0x2'));var rs=require(_0xb14c('0x3'));var fs=require('fs');var Redis=require(_0xb14c('0x4'));var db=require(_0xb14c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb14c('0x6'))(_0xb14c('0x7'));var config=require(_0xb14c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb14c('0x9')][_0xb14c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47a013,_0x1a9f87,_0x1dcd35){return new BPromise(function(_0x3dcc77,_0x37e85d){return client['request'](_0x47a013,_0x1dcd35)[_0xb14c('0xb')](function(_0xa3f616){logger[_0xb14c('0xc')](_0xb14c('0xd'),_0x1a9f87,_0xb14c('0xe'));logger[_0xb14c('0xf')](_0xb14c('0x10'),_0x1a9f87,_0xb14c('0xe'),JSON['stringify'](_0xa3f616));if(_0xa3f616['error']){if(_0xa3f616[_0xb14c('0x11')][_0xb14c('0x12')]===0x1f4){logger[_0xb14c('0x11')](_0xb14c('0xd'),_0x1a9f87,_0xa3f616['error'][_0xb14c('0x13')]);return _0x37e85d(_0xa3f616[_0xb14c('0x11')]['message']);}logger[_0xb14c('0x11')](_0xb14c('0xd'),_0x1a9f87,_0xa3f616[_0xb14c('0x11')][_0xb14c('0x13')]);return _0x3dcc77(_0xa3f616['error'][_0xb14c('0x13')]);}else{logger[_0xb14c('0xc')](_0xb14c('0xd'),_0x1a9f87,_0xb14c('0xe'));_0x3dcc77(_0xa3f616[_0xb14c('0x14')][_0xb14c('0x13')]);}})[_0xb14c('0x15')](function(_0x5d7f04){logger[_0xb14c('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1a9f87,_0x5d7f04);_0x37e85d(_0x5d7f04);});});}