Built motion from commit (unavailable).|2.5.29
[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 _0xf155=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','info','result','lodash','util'];(function(_0x5c2aff,_0x340651){var _0x48ca2c=function(_0x352c10){while(--_0x352c10){_0x5c2aff['push'](_0x5c2aff['shift']());}};_0x48ca2c(++_0x340651);}(_0xf155,0xda));var _0x5f15=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0xf155[_0x5d30b4];return _0x1acfb8;};'use strict';var _=require(_0x5f15('0x0'));var util=require(_0x5f15('0x1'));var moment=require(_0x5f15('0x2'));var BPromise=require(_0x5f15('0x3'));var rs=require(_0x5f15('0x4'));var fs=require('fs');var Redis=require(_0x5f15('0x5'));var db=require(_0x5f15('0x6'))['db'];var utils=require(_0x5f15('0x7'));var logger=require(_0x5f15('0x8'))(_0x5f15('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f15('0xa'));var client=jayson['client'][_0x5f15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x84ae80,_0x213835,_0x1ce27f){return new BPromise(function(_0x1f1b0b,_0x2d4d58){return client['request'](_0x84ae80,_0x1ce27f)[_0x5f15('0xc')](function(_0x532cf6){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x213835,_0x5f15('0xd'));logger[_0x5f15('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x213835,_0x5f15('0xd'),JSON[_0x5f15('0xf')](_0x532cf6));if(_0x532cf6['error']){if(_0x532cf6[_0x5f15('0x10')][_0x5f15('0x11')]===0x1f4){logger['error'](_0x5f15('0x12'),_0x213835,_0x532cf6[_0x5f15('0x10')][_0x5f15('0x13')]);return _0x2d4d58(_0x532cf6['error'][_0x5f15('0x13')]);}logger[_0x5f15('0x10')](_0x5f15('0x12'),_0x213835,_0x532cf6[_0x5f15('0x10')]['message']);return _0x1f1b0b(_0x532cf6[_0x5f15('0x10')][_0x5f15('0x13')]);}else{logger[_0x5f15('0x14')](_0x5f15('0x12'),_0x213835,_0x5f15('0xd'));_0x1f1b0b(_0x532cf6[_0x5f15('0x15')][_0x5f15('0x13')]);}})['catch'](function(_0x2216f1){logger[_0x5f15('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x213835,_0x2216f1);_0x2d4d58(_0x2216f1);});});}