Built motion from commit (unavailable).|2.5.8
[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 _0xc214=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','info','result'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xc214,0x12c));var _0x4c21=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xc214[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x4c21('0x0'));var util=require(_0x4c21('0x1'));var moment=require(_0x4c21('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c21('0x3'));var fs=require('fs');var Redis=require(_0x4c21('0x4'));var db=require(_0x4c21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c21('0x6'))('rpc');var config=require(_0x4c21('0x7'));var jayson=require(_0x4c21('0x8'));var client=jayson[_0x4c21('0x9')][_0x4c21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57d879,_0x539329,_0x20a60d){return new BPromise(function(_0xbf108b,_0x2438bf){return client[_0x4c21('0xb')](_0x57d879,_0x20a60d)[_0x4c21('0xc')](function(_0x1c6167){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x539329,_0x4c21('0xd'));logger[_0x4c21('0xe')](_0x4c21('0xf'),_0x539329,_0x4c21('0xd'),JSON['stringify'](_0x1c6167));if(_0x1c6167[_0x4c21('0x10')]){if(_0x1c6167[_0x4c21('0x10')][_0x4c21('0x11')]===0x1f4){logger[_0x4c21('0x10')](_0x4c21('0x12'),_0x539329,_0x1c6167[_0x4c21('0x10')][_0x4c21('0x13')]);return _0x2438bf(_0x1c6167[_0x4c21('0x10')][_0x4c21('0x13')]);}logger[_0x4c21('0x10')](_0x4c21('0x12'),_0x539329,_0x1c6167[_0x4c21('0x10')][_0x4c21('0x13')]);return _0xbf108b(_0x1c6167[_0x4c21('0x10')][_0x4c21('0x13')]);}else{logger[_0x4c21('0x14')](_0x4c21('0x12'),_0x539329,_0x4c21('0xd'));_0xbf108b(_0x1c6167[_0x4c21('0x15')]['message']);}})[_0x4c21('0x16')](function(_0x2ec93e){logger[_0x4c21('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x539329,_0x2ec93e);_0x2438bf(_0x2ec93e);});});}