Built motion from commit d9028345.|2.5.43
[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 _0xac5c=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x230398,_0x56b6d9){var _0x1b11f0=function(_0x1e930a){while(--_0x1e930a){_0x230398['push'](_0x230398['shift']());}};_0x1b11f0(++_0x56b6d9);}(_0xac5c,0x1a0));var _0xcac5=function(_0x1ef3c1,_0x599eba){_0x1ef3c1=_0x1ef3c1-0x0;var _0x57bd6f=_0xac5c[_0x1ef3c1];return _0x57bd6f;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require(_0xcac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcac5('0x4'));var db=require(_0xcac5('0x5'))['db'];var utils=require(_0xcac5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcac5('0x7'));var jayson=require(_0xcac5('0x8'));var client=jayson[_0xcac5('0x9')][_0xcac5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d8756,_0x3d79db,_0x1d7164){return new BPromise(function(_0x238db0,_0x38af92){return client[_0xcac5('0xb')](_0x3d8756,_0x1d7164)['then'](function(_0x38b08b){logger[_0xcac5('0xc')](_0xcac5('0xd'),_0x3d79db,_0xcac5('0xe'));logger['debug'](_0xcac5('0xf'),_0x3d79db,_0xcac5('0xe'),JSON['stringify'](_0x38b08b));if(_0x38b08b['error']){if(_0x38b08b[_0xcac5('0x10')][_0xcac5('0x11')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x3d79db,_0x38b08b[_0xcac5('0x10')]['message']);return _0x38af92(_0x38b08b[_0xcac5('0x10')][_0xcac5('0x12')]);}logger[_0xcac5('0x10')](_0xcac5('0xd'),_0x3d79db,_0x38b08b[_0xcac5('0x10')][_0xcac5('0x12')]);return _0x238db0(_0x38b08b[_0xcac5('0x10')][_0xcac5('0x12')]);}else{logger['info'](_0xcac5('0xd'),_0x3d79db,_0xcac5('0xe'));_0x238db0(_0x38b08b[_0xcac5('0x13')][_0xcac5('0x12')]);}})[_0xcac5('0x14')](function(_0xcdd620){logger[_0xcac5('0x10')](_0xcac5('0xd'),_0x3d79db,_0xcdd620);_0x38af92(_0xcdd620);});});}