Built motion from commit (unavailable).|2.5.14
[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 _0x40f2=['jayson/promise','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x330d1f,_0x47c710){var _0x1df784=function(_0x3ec796){while(--_0x3ec796){_0x330d1f['push'](_0x330d1f['shift']());}};_0x1df784(++_0x47c710);}(_0x40f2,0x195));var _0x240f=function(_0x37d393,_0x2814e1){_0x37d393=_0x37d393-0x0;var _0x24132d=_0x40f2[_0x37d393];return _0x24132d;};'use strict';var _=require(_0x240f('0x0'));var util=require('util');var moment=require(_0x240f('0x1'));var BPromise=require(_0x240f('0x2'));var rs=require(_0x240f('0x3'));var fs=require('fs');var Redis=require(_0x240f('0x4'));var db=require(_0x240f('0x5'))['db'];var utils=require(_0x240f('0x6'));var logger=require(_0x240f('0x7'))(_0x240f('0x8'));var config=require('../../config/environment');var jayson=require(_0x240f('0x9'));var client=jayson['client'][_0x240f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33fdca,_0x5b6a7d,_0x48c202){return new BPromise(function(_0x1c67ca,_0x2255b0){return client[_0x240f('0xb')](_0x33fdca,_0x48c202)[_0x240f('0xc')](function(_0x403413){logger['info'](_0x240f('0xd'),_0x5b6a7d,_0x240f('0xe'));logger[_0x240f('0xf')](_0x240f('0x10'),_0x5b6a7d,_0x240f('0xe'),JSON[_0x240f('0x11')](_0x403413));if(_0x403413['error']){if(_0x403413[_0x240f('0x12')][_0x240f('0x13')]===0x1f4){logger[_0x240f('0x12')](_0x240f('0xd'),_0x5b6a7d,_0x403413[_0x240f('0x12')][_0x240f('0x14')]);return _0x2255b0(_0x403413[_0x240f('0x12')]['message']);}logger['error'](_0x240f('0xd'),_0x5b6a7d,_0x403413[_0x240f('0x12')][_0x240f('0x14')]);return _0x1c67ca(_0x403413[_0x240f('0x12')][_0x240f('0x14')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5b6a7d,_0x240f('0xe'));_0x1c67ca(_0x403413[_0x240f('0x15')]['message']);}})[_0x240f('0x16')](function(_0x4caf1b){logger[_0x240f('0x12')](_0x240f('0xd'),_0x5b6a7d,_0x4caf1b);_0x2255b0(_0x4caf1b);});});}