Built motion from commit 6362bb75.|2.6.13
[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 _0xdaf2=['then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xdaf2,0x137));var _0x2daf=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xdaf2[_0x424357];return _0x29c68e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2daf('0x0'));var BPromise=require(_0x2daf('0x1'));var rs=require(_0x2daf('0x2'));var fs=require('fs');var Redis=require(_0x2daf('0x3'));var db=require(_0x2daf('0x4'))['db'];var utils=require(_0x2daf('0x5'));var logger=require('../../config/logger')(_0x2daf('0x6'));var config=require('../../config/environment');var jayson=require(_0x2daf('0x7'));var client=jayson[_0x2daf('0x8')][_0x2daf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23a2c7,_0x374543,_0x39f4c0){return new BPromise(function(_0x22bf79,_0x7a378e){return client[_0x2daf('0xa')](_0x23a2c7,_0x39f4c0)[_0x2daf('0xb')](function(_0x5ca39a){logger[_0x2daf('0xc')](_0x2daf('0xd'),_0x374543,_0x2daf('0xe'));logger[_0x2daf('0xf')](_0x2daf('0x10'),_0x374543,_0x2daf('0xe'),JSON[_0x2daf('0x11')](_0x5ca39a));if(_0x5ca39a[_0x2daf('0x12')]){if(_0x5ca39a[_0x2daf('0x12')][_0x2daf('0x13')]===0x1f4){logger[_0x2daf('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x374543,_0x5ca39a['error'][_0x2daf('0x14')]);return _0x7a378e(_0x5ca39a['error'][_0x2daf('0x14')]);}logger[_0x2daf('0x12')](_0x2daf('0xd'),_0x374543,_0x5ca39a[_0x2daf('0x12')][_0x2daf('0x14')]);return _0x22bf79(_0x5ca39a[_0x2daf('0x12')][_0x2daf('0x14')]);}else{logger['info'](_0x2daf('0xd'),_0x374543,_0x2daf('0xe'));_0x22bf79(_0x5ca39a[_0x2daf('0x15')][_0x2daf('0x14')]);}})[_0x2daf('0x16')](function(_0x16ae20){logger[_0x2daf('0x12')](_0x2daf('0xd'),_0x374543,_0x16ae20);_0x7a378e(_0x16ae20);});});}