c90bc9c5f05ebadc38e4871fd58cf38046c9abe9
[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 _0x55f6=['../../config/environment','client','http','request','then','info','CmContactHasPhone,\x20%s,\x20%s','CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x411a46,_0x319c8a){var _0x49e792=function(_0xf74567){while(--_0xf74567){_0x411a46['push'](_0x411a46['shift']());}};_0x49e792(++_0x319c8a);}(_0x55f6,0xc2));var _0x655f=function(_0x4e707e,_0x208eb5){_0x4e707e=_0x4e707e-0x0;var _0x3d346e=_0x55f6[_0x4e707e];return _0x3d346e;};'use strict';var _=require(_0x655f('0x0'));var util=require(_0x655f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x655f('0x2'));var fs=require('fs');var Redis=require(_0x655f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x655f('0x4'));var logger=require(_0x655f('0x5'))('rpc');var config=require(_0x655f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x655f('0x7')][_0x655f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x71f9c1,_0x586c32,_0x5dc01e){return new BPromise(function(_0x5e3ee6,_0x2c6c9f){return client[_0x655f('0x9')](_0x71f9c1,_0x5dc01e)[_0x655f('0xa')](function(_0x4dca43){logger[_0x655f('0xb')](_0x655f('0xc'),_0x586c32,'request\x20sent');logger['debug'](_0x655f('0xd'),_0x586c32,_0x655f('0xe'),JSON['stringify'](_0x4dca43));if(_0x4dca43[_0x655f('0xf')]){if(_0x4dca43[_0x655f('0xf')][_0x655f('0x10')]===0x1f4){logger[_0x655f('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x586c32,_0x4dca43['error'][_0x655f('0x11')]);return _0x2c6c9f(_0x4dca43['error'][_0x655f('0x11')]);}logger[_0x655f('0xf')](_0x655f('0xc'),_0x586c32,_0x4dca43[_0x655f('0xf')][_0x655f('0x11')]);return _0x5e3ee6(_0x4dca43[_0x655f('0xf')][_0x655f('0x11')]);}else{logger[_0x655f('0xb')](_0x655f('0xc'),_0x586c32,_0x655f('0xe'));_0x5e3ee6(_0x4dca43[_0x655f('0x12')][_0x655f('0x11')]);}})[_0x655f('0x13')](function(_0x2ac84e){logger[_0x655f('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x586c32,_0x2ac84e);_0x2c6c9f(_0x2ac84e);});});}