Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.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 _0xb0d8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xb0d8,0x181));var _0x8b0d=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0xb0d8[_0x7dbd65];return _0x33d551;};'use strict';var _=require(_0x8b0d('0x0'));var util=require(_0x8b0d('0x1'));var moment=require(_0x8b0d('0x2'));var BPromise=require(_0x8b0d('0x3'));var rs=require(_0x8b0d('0x4'));var fs=require('fs');var Redis=require(_0x8b0d('0x5'));var db=require(_0x8b0d('0x6'))['db'];var utils=require(_0x8b0d('0x7'));var logger=require(_0x8b0d('0x8'))(_0x8b0d('0x9'));var config=require(_0x8b0d('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x398570,_0xa10c53,_0x26a2fb){return new BPromise(function(_0x1d44cc,_0x28ddf1){return client[_0x8b0d('0xc')](_0x398570,_0x26a2fb)[_0x8b0d('0xd')](function(_0x3b5f30){logger[_0x8b0d('0xe')](_0x8b0d('0xf'),_0xa10c53,_0x8b0d('0x10'));logger['debug'](_0x8b0d('0x11'),_0xa10c53,_0x8b0d('0x10'),JSON[_0x8b0d('0x12')](_0x3b5f30));if(_0x3b5f30[_0x8b0d('0x13')]){if(_0x3b5f30[_0x8b0d('0x13')]['code']===0x1f4){logger[_0x8b0d('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0xa10c53,_0x3b5f30['error'][_0x8b0d('0x14')]);return _0x28ddf1(_0x3b5f30[_0x8b0d('0x13')][_0x8b0d('0x14')]);}logger[_0x8b0d('0x13')](_0x8b0d('0xf'),_0xa10c53,_0x3b5f30[_0x8b0d('0x13')][_0x8b0d('0x14')]);return _0x1d44cc(_0x3b5f30[_0x8b0d('0x13')][_0x8b0d('0x14')]);}else{logger[_0x8b0d('0xe')](_0x8b0d('0xf'),_0xa10c53,_0x8b0d('0x10'));_0x1d44cc(_0x3b5f30[_0x8b0d('0x15')][_0x8b0d('0x14')]);}})[_0x8b0d('0x16')](function(_0x3883bf){logger['error'](_0x8b0d('0xf'),_0xa10c53,_0x3883bf);_0x28ddf1(_0x3883bf);});});}