410ef91f5722e9ec9f2f71c4ed411f6d4c112781
[motion2.git] / server / api / cmContactHasPhone / cmContactHasPhone.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 _0x2bc5=['CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmContactHasPhone,\x20%s,\x20%s','debug'];(function(_0x56aec7,_0x24f439){var _0x3076d4=function(_0xc1c3ce){while(--_0xc1c3ce){_0x56aec7['push'](_0x56aec7['shift']());}};_0x3076d4(++_0x24f439);}(_0x2bc5,0x1ab));var _0x52bc=function(_0x5dc7bb,_0x3c2edc){_0x5dc7bb=_0x5dc7bb-0x0;var _0x3569c3=_0x2bc5[_0x5dc7bb];return _0x3569c3;};'use strict';var _=require(_0x52bc('0x0'));var util=require(_0x52bc('0x1'));var moment=require(_0x52bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x52bc('0x3'));var db=require(_0x52bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x52bc('0x5'))(_0x52bc('0x6'));var config=require(_0x52bc('0x7'));var jayson=require(_0x52bc('0x8'));var client=jayson[_0x52bc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fa975,_0x3761ea,_0x3a3a91){return new BPromise(function(_0x653b89,_0x53ad3e){return client[_0x52bc('0xa')](_0x3fa975,_0x3a3a91)['then'](function(_0x5665da){logger[_0x52bc('0xb')](_0x52bc('0xc'),_0x3761ea,'request\x20sent');logger[_0x52bc('0xd')](_0x52bc('0xe'),_0x3761ea,_0x52bc('0xf'),JSON[_0x52bc('0x10')](_0x5665da));if(_0x5665da['error']){if(_0x5665da['error']['code']===0x1f4){logger[_0x52bc('0x11')](_0x52bc('0xc'),_0x3761ea,_0x5665da[_0x52bc('0x11')][_0x52bc('0x12')]);return _0x53ad3e(_0x5665da[_0x52bc('0x11')]['message']);}logger[_0x52bc('0x11')](_0x52bc('0xc'),_0x3761ea,_0x5665da[_0x52bc('0x11')][_0x52bc('0x12')]);return _0x653b89(_0x5665da[_0x52bc('0x11')][_0x52bc('0x12')]);}else{logger[_0x52bc('0xb')](_0x52bc('0xc'),_0x3761ea,_0x52bc('0xf'));_0x653b89(_0x5665da[_0x52bc('0x13')][_0x52bc('0x12')]);}})[_0x52bc('0x14')](function(_0x125643){logger['error']('CmContactHasPhone,\x20%s,\x20%s',_0x3761ea,_0x125643);_0x53ad3e(_0x125643);});});}