Built motion from commit (unavailable).|2.5.31
[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 _0xf6c7=['rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x2c3e76,_0x5afb43){var _0x50b4fd=function(_0x54714f){while(--_0x54714f){_0x2c3e76['push'](_0x2c3e76['shift']());}};_0x50b4fd(++_0x5afb43);}(_0xf6c7,0x117));var _0x7f6c=function(_0x3249fc,_0x33e505){_0x3249fc=_0x3249fc-0x0;var _0x1251d6=_0xf6c7[_0x3249fc];return _0x1251d6;};'use strict';var _=require('lodash');var util=require(_0x7f6c('0x0'));var moment=require(_0x7f6c('0x1'));var BPromise=require(_0x7f6c('0x2'));var rs=require(_0x7f6c('0x3'));var fs=require('fs');var Redis=require(_0x7f6c('0x4'));var db=require(_0x7f6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f6c('0x6'))(_0x7f6c('0x7'));var config=require(_0x7f6c('0x8'));var jayson=require(_0x7f6c('0x9'));var client=jayson[_0x7f6c('0xa')][_0x7f6c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272a2d,_0x1f429a,_0x4d25e4){return new BPromise(function(_0x9ac920,_0x24c198){return client[_0x7f6c('0xc')](_0x272a2d,_0x4d25e4)['then'](function(_0x580a8c){logger[_0x7f6c('0xd')](_0x7f6c('0xe'),_0x1f429a,_0x7f6c('0xf'));logger['debug'](_0x7f6c('0x10'),_0x1f429a,_0x7f6c('0xf'),JSON[_0x7f6c('0x11')](_0x580a8c));if(_0x580a8c['error']){if(_0x580a8c['error'][_0x7f6c('0x12')]===0x1f4){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x1f429a,_0x580a8c[_0x7f6c('0x13')]['message']);return _0x24c198(_0x580a8c[_0x7f6c('0x13')][_0x7f6c('0x14')]);}logger[_0x7f6c('0x13')](_0x7f6c('0xe'),_0x1f429a,_0x580a8c['error'][_0x7f6c('0x14')]);return _0x9ac920(_0x580a8c[_0x7f6c('0x13')][_0x7f6c('0x14')]);}else{logger[_0x7f6c('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1f429a,_0x7f6c('0xf'));_0x9ac920(_0x580a8c[_0x7f6c('0x15')][_0x7f6c('0x14')]);}})['catch'](function(_0x3f4033){logger[_0x7f6c('0x13')](_0x7f6c('0xe'),_0x1f429a,_0x3f4033);_0x24c198(_0x3f4033);});});}