Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.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 _0x43e4=['jayson/promise','client','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x43e4,0x15a));var _0x443e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x43e4[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x443e('0x0'));var util=require(_0x443e('0x1'));var moment=require(_0x443e('0x2'));var BPromise=require(_0x443e('0x3'));var rs=require(_0x443e('0x4'));var fs=require('fs');var Redis=require(_0x443e('0x5'));var db=require(_0x443e('0x6'))['db'];var utils=require(_0x443e('0x7'));var logger=require(_0x443e('0x8'))(_0x443e('0x9'));var config=require(_0x443e('0xa'));var jayson=require(_0x443e('0xb'));var client=jayson[_0x443e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d942e,_0x6a99bf,_0x23780a){return new BPromise(function(_0x50fa75,_0x1d4ef6){return client['request'](_0x1d942e,_0x23780a)[_0x443e('0xd')](function(_0x5560be){logger['info'](_0x443e('0xe'),_0x6a99bf,_0x443e('0xf'));logger[_0x443e('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x6a99bf,'request\x20sent',JSON[_0x443e('0x11')](_0x5560be));if(_0x5560be[_0x443e('0x12')]){if(_0x5560be[_0x443e('0x12')]['code']===0x1f4){logger['error'](_0x443e('0xe'),_0x6a99bf,_0x5560be['error'][_0x443e('0x13')]);return _0x1d4ef6(_0x5560be['error']['message']);}logger[_0x443e('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x6a99bf,_0x5560be[_0x443e('0x12')][_0x443e('0x13')]);return _0x50fa75(_0x5560be[_0x443e('0x12')]['message']);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x6a99bf,_0x443e('0xf'));_0x50fa75(_0x5560be['result'][_0x443e('0x13')]);}})[_0x443e('0x14')](function(_0x16137b){logger[_0x443e('0x12')](_0x443e('0xe'),_0x6a99bf,_0x16137b);_0x1d4ef6(_0x16137b);});});}