Built motion from commit (unavailable).|2.4.17
[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 _0x392b=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x4b3418,_0x4c8ca7){var _0x5d2fb5=function(_0x5be0a0){while(--_0x5be0a0){_0x4b3418['push'](_0x4b3418['shift']());}};_0x5d2fb5(++_0x4c8ca7);}(_0x392b,0xa4));var _0xb392=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x392b[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xb392('0x0'));var util=require(_0xb392('0x1'));var moment=require(_0xb392('0x2'));var BPromise=require(_0xb392('0x3'));var rs=require(_0xb392('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb392('0x5'));var logger=require(_0xb392('0x6'))(_0xb392('0x7'));var config=require(_0xb392('0x8'));var jayson=require(_0xb392('0x9'));var client=jayson[_0xb392('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45516e,_0x579b87,_0x51c344){return new BPromise(function(_0x506c92,_0x286502){return client[_0xb392('0xb')](_0x45516e,_0x51c344)['then'](function(_0x19a999){logger[_0xb392('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x579b87,_0xb392('0xd'));logger[_0xb392('0xe')](_0xb392('0xf'),_0x579b87,_0xb392('0xd'),JSON[_0xb392('0x10')](_0x19a999));if(_0x19a999[_0xb392('0x11')]){if(_0x19a999[_0xb392('0x11')][_0xb392('0x12')]===0x1f4){logger['error'](_0xb392('0x13'),_0x579b87,_0x19a999[_0xb392('0x11')][_0xb392('0x14')]);return _0x286502(_0x19a999[_0xb392('0x11')][_0xb392('0x14')]);}logger[_0xb392('0x11')](_0xb392('0x13'),_0x579b87,_0x19a999[_0xb392('0x11')]['message']);return _0x506c92(_0x19a999[_0xb392('0x11')][_0xb392('0x14')]);}else{logger[_0xb392('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x579b87,_0xb392('0xd'));_0x506c92(_0x19a999[_0xb392('0x15')][_0xb392('0x14')]);}})[_0xb392('0x16')](function(_0x57ed09){logger['error'](_0xb392('0x13'),_0x579b87,_0x57ed09);_0x286502(_0x57ed09);});});}