Built motion from commit (unavailable).|2.0.80
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0xad39=['error','code','info','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','socket.io-emitter','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4951db,_0x392e26){var _0x2ade73=function(_0x49e0f0){while(--_0x49e0f0){_0x4951db['push'](_0x4951db['shift']());}};_0x2ade73(++_0x392e26);}(_0xad39,0x1b5));var _0x9ad3=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xad39[_0x3452a8];return _0x233814;};'use strict';var _=require('lodash');var util=require(_0x9ad3('0x0'));var moment=require('moment');var BPromise=require(_0x9ad3('0x1'));var rs=require(_0x9ad3('0x2'));var fs=require('fs');var db=require(_0x9ad3('0x3'))['db'];var utils=require(_0x9ad3('0x4'));var logger=require(_0x9ad3('0x5'))('rpc');var config=require(_0x9ad3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9ad3('0x7')][_0x9ad3('0x8')]({'port':0x232a});var socket=require(_0x9ad3('0x9'))({'host':_0x9ad3('0xa'),'port':0x18eb});require(_0x9ad3('0xb'))[_0x9ad3('0xc')](socket);function respondWithRpcPromise(_0x2bc8ad,_0x5ded89,_0x1d97cd){return new BPromise(function(_0x1be7de,_0x1431bc){return client[_0x9ad3('0xd')](_0x2bc8ad,_0x1d97cd)[_0x9ad3('0xe')](function(_0x2cf71e){logger['info'](_0x9ad3('0xf'),_0x5ded89,'request\x20sent');logger['debug'](_0x9ad3('0x10'),_0x5ded89,_0x9ad3('0x11'),JSON[_0x9ad3('0x12')](_0x2cf71e));if(_0x2cf71e[_0x9ad3('0x13')]){if(_0x2cf71e[_0x9ad3('0x13')][_0x9ad3('0x14')]===0x1f4){logger[_0x9ad3('0x13')](_0x9ad3('0xf'),_0x5ded89,_0x2cf71e['error']['message']);return _0x1431bc(_0x2cf71e[_0x9ad3('0x13')]['message']);}logger[_0x9ad3('0x13')](_0x9ad3('0xf'),_0x5ded89,_0x2cf71e[_0x9ad3('0x13')]['message']);return _0x1be7de(_0x2cf71e[_0x9ad3('0x13')]['message']);}else{logger[_0x9ad3('0x15')](_0x9ad3('0xf'),_0x5ded89,_0x9ad3('0x11'));_0x1be7de(_0x2cf71e['result'][_0x9ad3('0x16')]);}})[_0x9ad3('0x17')](function(_0x376827){logger['error'](_0x9ad3('0xf'),_0x5ded89,_0x376827);_0x1431bc(_0x376827);});});}