Built motion from commit (unavailable).|2.5.15
[motion2.git] / server / api / voiceMail / voiceMail.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 _0x49e9=['bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x34e770,_0x366fc1){var _0x133a4f=function(_0x41a7ca){while(--_0x41a7ca){_0x34e770['push'](_0x34e770['shift']());}};_0x133a4f(++_0x366fc1);}(_0x49e9,0x9e));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x949e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x949e('0x5'));var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')][_0x949e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4feac0,_0x58474b,_0x56682c){return new BPromise(function(_0x3afb81,_0x21d32c){return client[_0x949e('0xa')](_0x4feac0,_0x56682c)[_0x949e('0xb')](function(_0xb6a1bd){logger['info'](_0x949e('0xc'),_0x58474b,_0x949e('0xd'));logger[_0x949e('0xe')](_0x949e('0xf'),_0x58474b,_0x949e('0xd'),JSON[_0x949e('0x10')](_0xb6a1bd));if(_0xb6a1bd[_0x949e('0x11')]){if(_0xb6a1bd['error']['code']===0x1f4){logger['error'](_0x949e('0xc'),_0x58474b,_0xb6a1bd[_0x949e('0x11')][_0x949e('0x12')]);return _0x21d32c(_0xb6a1bd[_0x949e('0x11')][_0x949e('0x12')]);}logger[_0x949e('0x11')]('VoiceMail,\x20%s,\x20%s',_0x58474b,_0xb6a1bd[_0x949e('0x11')][_0x949e('0x12')]);return _0x3afb81(_0xb6a1bd[_0x949e('0x11')][_0x949e('0x12')]);}else{logger['info'](_0x949e('0xc'),_0x58474b,_0x949e('0xd'));_0x3afb81(_0xb6a1bd['result']['message']);}})[_0x949e('0x13')](function(_0xbac5a){logger['error']('VoiceMail,\x20%s,\x20%s',_0x58474b,_0xbac5a);_0x21d32c(_0xbac5a);});});}