Built motion from commit (unavailable).|2.4.13
[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 _0x720a=['client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x720a,0x10a));var _0xa720=function(_0x49f544,_0x43f5c6){_0x49f544=_0x49f544-0x0;var _0x88e3e2=_0x720a[_0x49f544];return _0x88e3e2;};'use strict';var _=require(_0xa720('0x0'));var util=require(_0xa720('0x1'));var moment=require(_0xa720('0x2'));var BPromise=require('bluebird');var rs=require(_0xa720('0x3'));var fs=require('fs');var Redis=require(_0xa720('0x4'));var db=require(_0xa720('0x5'))['db'];var utils=require(_0xa720('0x6'));var logger=require('../../config/logger')(_0xa720('0x7'));var config=require(_0xa720('0x8'));var jayson=require(_0xa720('0x9'));var client=jayson[_0xa720('0xa')][_0xa720('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13af3b,_0x2d29f5,_0x5b3d98){return new BPromise(function(_0x140849,_0x3ed6bc){return client[_0xa720('0xc')](_0x13af3b,_0x5b3d98)[_0xa720('0xd')](function(_0x33682f){logger[_0xa720('0xe')](_0xa720('0xf'),_0x2d29f5,_0xa720('0x10'));logger['debug'](_0xa720('0x11'),_0x2d29f5,'request\x20sent',JSON[_0xa720('0x12')](_0x33682f));if(_0x33682f['error']){if(_0x33682f['error']['code']===0x1f4){logger[_0xa720('0x13')](_0xa720('0xf'),_0x2d29f5,_0x33682f['error'][_0xa720('0x14')]);return _0x3ed6bc(_0x33682f[_0xa720('0x13')][_0xa720('0x14')]);}logger[_0xa720('0x13')](_0xa720('0xf'),_0x2d29f5,_0x33682f['error'][_0xa720('0x14')]);return _0x140849(_0x33682f['error'][_0xa720('0x14')]);}else{logger['info'](_0xa720('0xf'),_0x2d29f5,_0xa720('0x10'));_0x140849(_0x33682f[_0xa720('0x15')]['message']);}})[_0xa720('0x16')](function(_0x266934){logger[_0xa720('0x13')](_0xa720('0xf'),_0x2d29f5,_0x266934);_0x3ed6bc(_0x266934);});});}