Built motion from commit df3e9871f6bcc3432fec345b2f4facbd4dba8b5c. Version 3.0.0...
[motion-next.git] / server / api / webbar / webbar.controller.js
index 26e1105..e3b397d 100644 (file)
@@ -1 +1 @@
-const a780_0x39f1=['hold','json','hangup','body','sessionId','request','User','callNumber\x20is\x20required','length','name','UserId','result','webbar:conference','info','filter','../../config/logger','calls\x20fired:','userId\x20is\x20required','code','findOne','string','transferNumber\x20is\x20required','error','conference\x20executed!','callNumber','sessionId\x20is\x20required','VoiceChannels','answer','client','util','user:%s','callbackUrl','lodash','callerId','calls','rows','transfer\x20executed!','webbarapi','transferNumber','catch','stack','webbar:hangup','send','entityFound:','message','webbar:unhold','answer\x20fired:','status','webbar:originate','originate\x20executed!','../../mysqldb','number','transfer','webbar:hold','stringify','agent','validate','log','unhold\x20fired:','conference','answer\x20executed!','transfer\x20fired:','then','conference\x20fired:','userId','NotFound','../../rediscache','format','unhold\x20executed!','http'];(function(_0x30f2ae,_0x39f16a){const _0x2e7e67=function(_0x3ecb4f){while(--_0x3ecb4f){_0x30f2ae['push'](_0x30f2ae['shift']());}};_0x2e7e67(++_0x39f16a);}(a780_0x39f1,0x15c));const a780_0x2e7e=function(_0x30f2ae,_0x39f16a){_0x30f2ae=_0x30f2ae-0x0;let _0x2e7e67=a780_0x39f1[_0x30f2ae];return _0x2e7e67;};const _0xa7f55f=a780_0x2e7e;'use strict';const _=require(_0xa7f55f('0x22')),db=require(_0xa7f55f('0x34'))['db'],util=require(_0xa7f55f('0x1f')),jayson=require('jayson/promise'),amiClient=jayson[_0xa7f55f('0x1e')][_0xa7f55f('0x1')]({'port':0x232a}),logger=require(_0xa7f55f('0x11'))(_0xa7f55f('0x27')),{getSocket}=require(_0xa7f55f('0x44')),io=getSocket(),Schema=require(_0xa7f55f('0x3a')),originateValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xa7f55f('0x9')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xa7f55f('0x16')}}),hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa7f55f('0x16'),'required':![]}}),answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}}),transferValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],_0xa7f55f('0x13')]},'sessionId':{'type':_0xa7f55f('0x16'),'required':[!![],_0xa7f55f('0x1b')]},'transferNumber':{'type':'string','required':[!![],_0xa7f55f('0x17')]}}),holdValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa7f55f('0x16'),'required':![]}}),unholdValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}}),callsValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],_0xa7f55f('0x13')]}}),conferenceValidation=new Schema({'userId':{'type':_0xa7f55f('0x35'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x3ecb4f,_0x2dc3a2,_0x13b4b4){const _0x1d9b72=_0xa7f55f;logger[_0x1d9b72('0xf')](_0x3ecb4f,_0x2dc3a2,JSON[_0x1d9b72('0x38')](_0x13b4b4)),io['to'](_0x3ecb4f)['emit'](_0x2dc3a2,_0x13b4b4);}function handleError(_0x4583b9){return function(_0x4b7d78){const _0x387c70=a780_0x2e7e;console[_0x387c70('0x3b')]('handleError:',_0x4b7d78,_0x4b7d78 instanceof RangeError),logger['error'](_0x4b7d78[_0x387c70('0x2a')]),_0x4b7d78 instanceof RangeError?(_0x4b7d78['name']&&delete _0x4b7d78[_0x387c70('0xb')],_0x4583b9[_0x387c70('0x31')](0x194)[_0x387c70('0x2c')](_0x4b7d78)):(_0x4b7d78[_0x387c70('0xb')]&&delete _0x4b7d78[_0x387c70('0xb')],_0x4583b9['status'](0x1f4)[_0x387c70('0x2c')](_0x4b7d78));};}function checkError(){return function(_0x2f74e8){const _0x10cf9e=a780_0x2e7e;if(!_0x2f74e8)throw new RangeError(_0x10cf9e('0x43'));return _0x2f74e8;};}function respondWithRpcPromise(_0x5070ae,_0x470fd3){return new Promise(function(_0x4aec64,_0x18931d){const _0x2686a8=a780_0x2e7e,_0x3955e9=amiClient;return _0x3955e9[_0x2686a8('0x7')](_0x5070ae,_0x470fd3)[_0x2686a8('0x40')](function(_0x904eb2){const _0x1b843a=_0x2686a8;if(_0x904eb2[_0x1b843a('0x18')]){if(_0x904eb2[_0x1b843a('0x18')][_0x1b843a('0x14')]===0x1f4)return _0x18931d(_0x904eb2['error'][_0x1b843a('0x2e')]);return _0x4aec64(_0x904eb2[_0x1b843a('0x18')][_0x1b843a('0x2e')]);}else _0x4aec64(_0x904eb2[_0x1b843a('0xd')]);})[_0x2686a8('0x29')](function(_0x3bdead){_0x18931d(_0x3bdead);});});}function getAgent(_0x9cc3f7){const _0x2e8cdf=_0xa7f55f;return db[_0x2e8cdf('0x8')][_0x2e8cdf('0x15')]({'where':{'id':_0x9cc3f7,'role':_0x2e8cdf('0x39')}})[_0x2e8cdf('0x40')](checkError());}exports['originate']=function(_0x56766a,_0x59d371){const _0x1e0ab1=_0xa7f55f;logger[_0x1e0ab1('0xf')]('originate\x20fired:',_0x56766a[_0x1e0ab1('0x5')]);const _0x2f7575=originateValidation[_0x1e0ab1('0x3a')](_0x56766a[_0x1e0ab1('0x5')]);if(_0x2f7575[_0x1e0ab1('0xa')]>0x0)return _0x59d371[_0x1e0ab1('0x31')](0x190)['json'](_0x2f7575);const _0x3d1dfd=_0x56766a['body'][_0x1e0ab1('0x42')],_0x5a3983=_0x56766a[_0x1e0ab1('0x5')][_0x1e0ab1('0x1a')],_0x4c99dd=_0x56766a[_0x1e0ab1('0x5')][_0x1e0ab1('0x23')],_0x9022f7=_0x56766a[_0x1e0ab1('0x5')][_0x1e0ab1('0x21')];return getAgent(_0x3d1dfd)[_0x1e0ab1('0x40')](function(_0x1a5d62){const _0x1b8db3=_0x1e0ab1;return logger[_0x1b8db3('0xf')]('entityFound:',_0x1a5d62[_0x1b8db3('0xb')]),emit(util['format'](_0x1b8db3('0x20'),_0x1a5d62[_0x1b8db3('0xb')]),_0x1b8db3('0x32'),{'callNumber':_0x5a3983,'callerId':_0x4c99dd,'callbackUrl':_0x9022f7}),_0x59d371[_0x1b8db3('0x31')](0xc8)[_0x1b8db3('0x3')]({'error':![],'message':_0x1b8db3('0x33')});})[_0x1e0ab1('0x29')](handleError(_0x59d371));},exports[_0xa7f55f('0x4')]=function(_0x595e7f,_0x4ee30a){const _0x36dc45=_0xa7f55f;logger[_0x36dc45('0xf')]('hangup\x20fired:',_0x595e7f['body']);const _0x239764=hangupValidation[_0x36dc45('0x3a')](_0x595e7f[_0x36dc45('0x5')]);if(_0x239764[_0x36dc45('0xa')]>0x0)return _0x4ee30a[_0x36dc45('0x31')](0x190)[_0x36dc45('0x3')](_0x239764);const _0x354d27=_0x595e7f[_0x36dc45('0x5')][_0x36dc45('0x42')],_0x22e42f=_0x595e7f[_0x36dc45('0x5')]['sessionId'];return getAgent(_0x354d27)[_0x36dc45('0x40')](function(_0x503f99){const _0x107fcc=_0x36dc45;return logger[_0x107fcc('0xf')](_0x107fcc('0x2d'),_0x503f99[_0x107fcc('0xb')]),emit(util[_0x107fcc('0x45')](_0x107fcc('0x20'),_0x503f99[_0x107fcc('0xb')]),_0x107fcc('0x2b'),{'sessionId':_0x22e42f}),_0x4ee30a[_0x107fcc('0x31')](0xc8)[_0x107fcc('0x3')]({'error':![],'message':'hangup\x20executed!'});})[_0x36dc45('0x29')](handleError(_0x4ee30a));},exports[_0xa7f55f('0x1d')]=function(_0x1721b4,_0x46c51d){const _0x3be90c=_0xa7f55f;logger['info'](_0x3be90c('0x30'),_0x1721b4[_0x3be90c('0x5')]);const _0xeec3aa=answerValidation[_0x3be90c('0x3a')](_0x1721b4[_0x3be90c('0x5')]);if(_0xeec3aa[_0x3be90c('0xa')]>0x0)return _0x46c51d['status'](0x190)[_0x3be90c('0x3')](_0xeec3aa);const _0x518bef=_0x1721b4['body'][_0x3be90c('0x42')],_0x394113=_0x1721b4['body']['sessionId'];return getAgent(_0x518bef)[_0x3be90c('0x40')](function(_0x1619c3){const _0x8892ba=_0x3be90c;return logger[_0x8892ba('0xf')](_0x8892ba('0x2d'),_0x1619c3[_0x8892ba('0xb')]),emit(util['format'](_0x8892ba('0x20'),_0x1619c3[_0x8892ba('0xb')]),'webbar:answer',{'sessionId':_0x394113}),_0x46c51d[_0x8892ba('0x31')](0xc8)[_0x8892ba('0x3')]({'error':![],'message':_0x8892ba('0x3e')});})[_0x3be90c('0x29')](handleError(_0x46c51d));},exports[_0xa7f55f('0x2')]=function(_0x59402c,_0x5e2b43){const _0x331dd6=_0xa7f55f;logger['info']('hold\x20fired:',_0x59402c[_0x331dd6('0x5')]);const _0x1245d6=holdValidation[_0x331dd6('0x3a')](_0x59402c[_0x331dd6('0x5')]);if(_0x1245d6['length']>0x0)return _0x5e2b43['status'](0x190)[_0x331dd6('0x3')](_0x1245d6);const _0x4ed1bd=_0x59402c[_0x331dd6('0x5')][_0x331dd6('0x42')],_0x84f1a9=_0x59402c[_0x331dd6('0x5')][_0x331dd6('0x6')];return getAgent(_0x4ed1bd)['then'](function(_0x5b2151){const _0x305ba2=_0x331dd6;return logger[_0x305ba2('0xf')](_0x305ba2('0x2d'),_0x5b2151['name']),emit(util[_0x305ba2('0x45')](_0x305ba2('0x20'),_0x5b2151[_0x305ba2('0xb')]),_0x305ba2('0x37'),{'sessionId':_0x84f1a9}),_0x5e2b43['status'](0xc8)[_0x305ba2('0x3')]({'error':![],'message':'hold\x20executed!'});})[_0x331dd6('0x29')](handleError(_0x5e2b43));},exports['unhold']=function(_0x11d2d6,_0x28bbd9){const _0x4e45d0=_0xa7f55f;logger[_0x4e45d0('0xf')](_0x4e45d0('0x3c'),_0x11d2d6[_0x4e45d0('0x5')]);const _0x23ae7f=unholdValidation[_0x4e45d0('0x3a')](_0x11d2d6[_0x4e45d0('0x5')]);if(_0x23ae7f['length']>0x0)return _0x28bbd9[_0x4e45d0('0x31')](0x190)[_0x4e45d0('0x3')](_0x23ae7f);const _0x2aa300=_0x11d2d6['body']['userId'],_0x51298a=_0x11d2d6[_0x4e45d0('0x5')][_0x4e45d0('0x6')];return getAgent(_0x2aa300)[_0x4e45d0('0x40')](function(_0x120c7e){const _0x41c3a9=_0x4e45d0;return logger[_0x41c3a9('0xf')](_0x41c3a9('0x2d'),_0x120c7e[_0x41c3a9('0xb')]),emit(util['format'](_0x41c3a9('0x20'),_0x120c7e['name']),_0x41c3a9('0x2f'),{'sessionId':_0x51298a}),_0x28bbd9[_0x41c3a9('0x31')](0xc8)['json']({'error':![],'message':_0x41c3a9('0x0')});})[_0x4e45d0('0x29')](handleError(_0x28bbd9));},exports[_0xa7f55f('0x24')]=function(_0x43b9d4,_0x355118){const _0x1efb41=_0xa7f55f;logger[_0x1efb41('0xf')](_0x1efb41('0x12'),_0x355118[_0x1efb41('0x5')]);const _0x5119aa=callsValidation[_0x1efb41('0x3a')](_0x43b9d4[_0x1efb41('0x5')]);if(_0x5119aa[_0x1efb41('0xa')]>0x0)return _0x355118[_0x1efb41('0x31')](0x190)[_0x1efb41('0x3')](_0x5119aa);const _0x46a099=_0x43b9d4[_0x1efb41('0x5')][_0x1efb41('0x42')],_0x1cd563=respondWithRpcPromise(_0x1efb41('0x1c')),_0x42c4d9=getAgent(_0x46a099);return Promise['all']([_0x1cd563,_0x42c4d9])[_0x1efb41('0x40')](function(_0x13fae8){const _0x42edd3=_0x1efb41,_0xe980c=_0x13fae8[0x0],_0x4cba35=_0x13fae8[0x1],_0x34c22d=_[_0x42edd3('0x10')](_0xe980c[_0x42edd3('0x25')],function(_0x3893c3){const _0x29eedf=_0x42edd3;return _0x3893c3[_0x29eedf('0xc')]==_0x4cba35['id'];});return _0x355118[_0x42edd3('0x31')](0xc8)[_0x42edd3('0x3')]({'count':_0x34c22d['length'],'rows':_0x34c22d});})['catch'](handleError(_0x355118));},exports[_0xa7f55f('0x3d')]=function(_0x57f590,_0x338a45){const _0x570c27=_0xa7f55f;logger[_0x570c27('0xf')](_0x570c27('0x41'),_0x57f590['body']);const _0xc5dd77=conferenceValidation[_0x570c27('0x3a')](_0x57f590[_0x570c27('0x5')]);if(_0xc5dd77[_0x570c27('0xa')]>0x0)return _0x338a45[_0x570c27('0x31')](0x190)[_0x570c27('0x3')](_0xc5dd77);const _0x56b73f=_0x57f590[_0x570c27('0x5')][_0x570c27('0x42')];return getAgent(_0x56b73f)[_0x570c27('0x40')](function(_0x1f087f){const _0x4e70da=_0x570c27;return logger['info'](_0x4e70da('0x2d'),_0x1f087f[_0x4e70da('0xb')]),emit(util['format'](_0x4e70da('0x20'),_0x1f087f[_0x4e70da('0xb')]),_0x4e70da('0xe')),_0x338a45[_0x4e70da('0x31')](0xc8)[_0x4e70da('0x3')]({'error':![],'message':_0x4e70da('0x19')});})['catch'](handleError(_0x338a45));},exports[_0xa7f55f('0x36')]=function(_0x577433,_0x4d617f){const _0x361546=_0xa7f55f;logger[_0x361546('0xf')](_0x361546('0x3f'),_0x577433[_0x361546('0x5')]);const _0x4eb080=transferValidation['validate'](_0x577433[_0x361546('0x5')]);if(_0x4eb080[_0x361546('0xa')]>0x0)return _0x4d617f[_0x361546('0x31')](0x190)['json'](_0x4eb080);const _0x278bf9=_0x577433[_0x361546('0x5')][_0x361546('0x42')],_0x28a380=_0x577433[_0x361546('0x5')][_0x361546('0x6')],_0x4b5dfc=_0x577433['body'][_0x361546('0x28')];return getAgent(_0x278bf9)[_0x361546('0x40')](function(_0x4e3b88){const _0x51eaa6=_0x361546;return logger[_0x51eaa6('0xf')]('entityFound:',_0x4e3b88[_0x51eaa6('0xb')]),emit(util[_0x51eaa6('0x45')](_0x51eaa6('0x20'),_0x4e3b88['name']),'webbar:transfer',{'sessionId':_0x28a380,'transferNumber':_0x4b5dfc}),_0x4d617f[_0x51eaa6('0x31')](0xc8)[_0x51eaa6('0x3')]({'error':![],'message':_0x51eaa6('0x26')});})[_0x361546('0x29')](handleError(_0x4d617f));};
\ No newline at end of file
+const a780_0x42e5=['stringify','hangup','webbar:unhold','UserId','originate','code','../../config/logger','rows','then','http','name','message','filter','emit','User','hold','userId\x20is\x20required','webbarapi','json','all','unhold','findOne','user:%s','unhold\x20fired:','transfer\x20executed!','unhold\x20executed!','util','status','number','handleError:','hangup\x20fired:','callNumber','request','webbar:originate','info','string','send','calls','VoiceChannels','result','catch','entityFound:','../../rediscache','body','transfer\x20fired:','webbar:conference','error','format','client','length','userId','transferNumber\x20is\x20required','answer\x20executed!','webbar:transfer','webbar:hold','callbackUrl','hold\x20fired:','validate','transferNumber','lodash','stack','calls\x20fired:','conference\x20fired:','sessionId','jayson/promise'];(function(_0x826b88,_0x42e57e){const _0x42d1b8=function(_0x406799){while(--_0x406799){_0x826b88['push'](_0x826b88['shift']());}};_0x42d1b8(++_0x42e57e);}(a780_0x42e5,0xfa));const a780_0x42d1=function(_0x826b88,_0x42e57e){_0x826b88=_0x826b88-0x0;let _0x42d1b8=a780_0x42e5[_0x826b88];return _0x42d1b8;};const _0x47a3=a780_0x42d1;'use strict';const _=require(_0x47a3('0x4')),db=require('../../mysqldb')['db'],util=require(_0x47a3('0x24')),jayson=require(_0x47a3('0x9')),amiClient=jayson[_0x47a3('0x3a')][_0x47a3('0x13')]({'port':0x232a}),logger=require(_0x47a3('0x10'))(_0x47a3('0x1b')),{getSocket}=require(_0x47a3('0x34')),io=getSocket(),Schema=require('validate'),originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x47a3('0x2d'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0x47a3('0x2d')}}),hangupValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],_0x47a3('0x1a')]},'sessionId':{'type':_0x47a3('0x2d'),'required':![]}}),answerValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],_0x47a3('0x1a')]},'sessionId':{'type':_0x47a3('0x2d'),'required':![]}}),transferValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],_0x47a3('0x1a')]},'sessionId':{'type':_0x47a3('0x2d'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x47a3('0x3d')]}}),holdValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],_0x47a3('0x1a')]},'sessionId':{'type':'string','required':![]}}),unholdValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],_0x47a3('0x1a')]},'sessionId':{'type':_0x47a3('0x2d'),'required':![]}}),callsValidation=new Schema({'userId':{'type':_0x47a3('0x26'),'required':[!![],'userId\x20is\x20required']}}),conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x47a3('0x1a')]}});function emit(_0x406799,_0x57628a,_0x2f02cb){const _0x39c72e=_0x47a3;logger[_0x39c72e('0x2c')](_0x406799,_0x57628a,JSON[_0x39c72e('0xa')](_0x2f02cb)),io['to'](_0x406799)[_0x39c72e('0x17')](_0x57628a,_0x2f02cb);}function handleError(_0x2e3822){return function(_0x1380b7){const _0x1ad209=a780_0x42d1;console['log'](_0x1ad209('0x27'),_0x1380b7,_0x1380b7 instanceof RangeError),logger[_0x1ad209('0x38')](_0x1380b7[_0x1ad209('0x5')]),_0x1380b7 instanceof RangeError?(_0x1380b7[_0x1ad209('0x14')]&&delete _0x1380b7['name'],_0x2e3822[_0x1ad209('0x25')](0x194)[_0x1ad209('0x2e')](_0x1380b7)):(_0x1380b7['name']&&delete _0x1380b7[_0x1ad209('0x14')],_0x2e3822[_0x1ad209('0x25')](0x1f4)[_0x1ad209('0x2e')](_0x1380b7));};}function checkError(){return function(_0x47db6a){if(!_0x47db6a)throw new RangeError('NotFound');return _0x47db6a;};}function respondWithRpcPromise(_0x33b5c4,_0x5f32b0){return new Promise(function(_0x263859,_0x2dc226){const _0x20ec05=a780_0x42d1,_0x3aedc4=amiClient;return _0x3aedc4[_0x20ec05('0x2a')](_0x33b5c4,_0x5f32b0)[_0x20ec05('0x12')](function(_0x5df1d6){const _0x146926=_0x20ec05;if(_0x5df1d6[_0x146926('0x38')]){if(_0x5df1d6[_0x146926('0x38')][_0x146926('0xf')]===0x1f4)return _0x2dc226(_0x5df1d6['error'][_0x146926('0x15')]);return _0x263859(_0x5df1d6[_0x146926('0x38')][_0x146926('0x15')]);}else _0x263859(_0x5df1d6[_0x146926('0x31')]);})[_0x20ec05('0x32')](function(_0x435b33){_0x2dc226(_0x435b33);});});}function getAgent(_0x2c52af){const _0x4e2d1a=_0x47a3;return db[_0x4e2d1a('0x18')][_0x4e2d1a('0x1f')]({'where':{'id':_0x2c52af,'role':'agent'}})[_0x4e2d1a('0x12')](checkError());}exports[_0x47a3('0xe')]=function(_0x2910a7,_0xc084e3){const _0x5ba55f=_0x47a3;logger[_0x5ba55f('0x2c')]('originate\x20fired:',_0x2910a7[_0x5ba55f('0x35')]);const _0x429427=originateValidation['validate'](_0x2910a7[_0x5ba55f('0x35')]);if(_0x429427[_0x5ba55f('0x3b')]>0x0)return _0xc084e3[_0x5ba55f('0x25')](0x190)[_0x5ba55f('0x1c')](_0x429427);const _0x55960c=_0x2910a7[_0x5ba55f('0x35')][_0x5ba55f('0x3c')],_0x3eb4e9=_0x2910a7[_0x5ba55f('0x35')][_0x5ba55f('0x29')],_0x33be26=_0x2910a7[_0x5ba55f('0x35')]['callerId'],_0x39c256=_0x2910a7[_0x5ba55f('0x35')][_0x5ba55f('0x0')];return getAgent(_0x55960c)[_0x5ba55f('0x12')](function(_0x1e1a6c){const _0x257b9b=_0x5ba55f;return logger[_0x257b9b('0x2c')](_0x257b9b('0x33'),_0x1e1a6c[_0x257b9b('0x14')]),emit(util[_0x257b9b('0x39')](_0x257b9b('0x20'),_0x1e1a6c[_0x257b9b('0x14')]),_0x257b9b('0x2b'),{'callNumber':_0x3eb4e9,'callerId':_0x33be26,'callbackUrl':_0x39c256}),_0xc084e3[_0x257b9b('0x25')](0xc8)[_0x257b9b('0x1c')]({'error':![],'message':'originate\x20executed!'});})[_0x5ba55f('0x32')](handleError(_0xc084e3));},exports[_0x47a3('0xb')]=function(_0xf596bb,_0x41cb2a){const _0x3394cb=_0x47a3;logger[_0x3394cb('0x2c')](_0x3394cb('0x28'),_0xf596bb[_0x3394cb('0x35')]);const _0x49fbd7=hangupValidation[_0x3394cb('0x2')](_0xf596bb['body']);if(_0x49fbd7[_0x3394cb('0x3b')]>0x0)return _0x41cb2a[_0x3394cb('0x25')](0x190)[_0x3394cb('0x1c')](_0x49fbd7);const _0xafc31=_0xf596bb[_0x3394cb('0x35')]['userId'],_0x40b6ff=_0xf596bb[_0x3394cb('0x35')]['sessionId'];return getAgent(_0xafc31)[_0x3394cb('0x12')](function(_0x497d8f){const _0x3f0446=_0x3394cb;return logger['info'](_0x3f0446('0x33'),_0x497d8f[_0x3f0446('0x14')]),emit(util[_0x3f0446('0x39')]('user:%s',_0x497d8f[_0x3f0446('0x14')]),'webbar:hangup',{'sessionId':_0x40b6ff}),_0x41cb2a[_0x3f0446('0x25')](0xc8)[_0x3f0446('0x1c')]({'error':![],'message':'hangup\x20executed!'});})[_0x3394cb('0x32')](handleError(_0x41cb2a));},exports['answer']=function(_0x586c99,_0xc3f826){const _0x403755=_0x47a3;logger[_0x403755('0x2c')]('answer\x20fired:',_0x586c99[_0x403755('0x35')]);const _0x1f53d8=answerValidation[_0x403755('0x2')](_0x586c99[_0x403755('0x35')]);if(_0x1f53d8[_0x403755('0x3b')]>0x0)return _0xc3f826[_0x403755('0x25')](0x190)[_0x403755('0x1c')](_0x1f53d8);const _0x4baa02=_0x586c99[_0x403755('0x35')]['userId'],_0x2784cd=_0x586c99[_0x403755('0x35')][_0x403755('0x8')];return getAgent(_0x4baa02)[_0x403755('0x12')](function(_0xf6d535){const _0x6f3eff=_0x403755;return logger[_0x6f3eff('0x2c')](_0x6f3eff('0x33'),_0xf6d535['name']),emit(util[_0x6f3eff('0x39')](_0x6f3eff('0x20'),_0xf6d535[_0x6f3eff('0x14')]),'webbar:answer',{'sessionId':_0x2784cd}),_0xc3f826['status'](0xc8)[_0x6f3eff('0x1c')]({'error':![],'message':_0x6f3eff('0x3e')});})['catch'](handleError(_0xc3f826));},exports[_0x47a3('0x19')]=function(_0x31a035,_0x17a79c){const _0x206d13=_0x47a3;logger['info'](_0x206d13('0x1'),_0x31a035[_0x206d13('0x35')]);const _0x3d000f=holdValidation[_0x206d13('0x2')](_0x31a035[_0x206d13('0x35')]);if(_0x3d000f[_0x206d13('0x3b')]>0x0)return _0x17a79c[_0x206d13('0x25')](0x190)[_0x206d13('0x1c')](_0x3d000f);const _0x3d9fa5=_0x31a035[_0x206d13('0x35')][_0x206d13('0x3c')],_0x551675=_0x31a035[_0x206d13('0x35')][_0x206d13('0x8')];return getAgent(_0x3d9fa5)['then'](function(_0x255207){const _0x172459=_0x206d13;return logger['info'](_0x172459('0x33'),_0x255207[_0x172459('0x14')]),emit(util[_0x172459('0x39')](_0x172459('0x20'),_0x255207[_0x172459('0x14')]),_0x172459('0x40'),{'sessionId':_0x551675}),_0x17a79c[_0x172459('0x25')](0xc8)[_0x172459('0x1c')]({'error':![],'message':'hold\x20executed!'});})[_0x206d13('0x32')](handleError(_0x17a79c));},exports[_0x47a3('0x1e')]=function(_0x25f820,_0x53f62f){const _0x44dfba=_0x47a3;logger[_0x44dfba('0x2c')](_0x44dfba('0x21'),_0x25f820[_0x44dfba('0x35')]);const _0x3e03c9=unholdValidation[_0x44dfba('0x2')](_0x25f820[_0x44dfba('0x35')]);if(_0x3e03c9[_0x44dfba('0x3b')]>0x0)return _0x53f62f['status'](0x190)[_0x44dfba('0x1c')](_0x3e03c9);const _0x1a87f1=_0x25f820[_0x44dfba('0x35')][_0x44dfba('0x3c')],_0x1d89f3=_0x25f820[_0x44dfba('0x35')]['sessionId'];return getAgent(_0x1a87f1)[_0x44dfba('0x12')](function(_0x2162b2){const _0x3a4116=_0x44dfba;return logger[_0x3a4116('0x2c')]('entityFound:',_0x2162b2[_0x3a4116('0x14')]),emit(util[_0x3a4116('0x39')](_0x3a4116('0x20'),_0x2162b2['name']),_0x3a4116('0xc'),{'sessionId':_0x1d89f3}),_0x53f62f['status'](0xc8)[_0x3a4116('0x1c')]({'error':![],'message':_0x3a4116('0x23')});})[_0x44dfba('0x32')](handleError(_0x53f62f));},exports[_0x47a3('0x2f')]=function(_0x2a19ee,_0x220911){const _0x1f2742=_0x47a3;logger[_0x1f2742('0x2c')](_0x1f2742('0x6'),_0x220911[_0x1f2742('0x35')]);const _0x9580e4=callsValidation['validate'](_0x2a19ee[_0x1f2742('0x35')]);if(_0x9580e4[_0x1f2742('0x3b')]>0x0)return _0x220911[_0x1f2742('0x25')](0x190)[_0x1f2742('0x1c')](_0x9580e4);const _0x374160=_0x2a19ee[_0x1f2742('0x35')][_0x1f2742('0x3c')],_0x58d99=respondWithRpcPromise(_0x1f2742('0x30')),_0x2843aa=getAgent(_0x374160);return Promise[_0x1f2742('0x1d')]([_0x58d99,_0x2843aa])[_0x1f2742('0x12')](function(_0x4e5031){const _0x4fd5f4=_0x1f2742,_0xbd24ab=_0x4e5031[0x0],_0x16e128=_0x4e5031[0x1],_0xee645c=_[_0x4fd5f4('0x16')](_0xbd24ab[_0x4fd5f4('0x11')],function(_0x437486){const _0x1c6ceb=_0x4fd5f4;return _0x437486[_0x1c6ceb('0xd')]==_0x16e128['id'];});return _0x220911[_0x4fd5f4('0x25')](0xc8)[_0x4fd5f4('0x1c')]({'count':_0xee645c[_0x4fd5f4('0x3b')],'rows':_0xee645c});})[_0x1f2742('0x32')](handleError(_0x220911));},exports['conference']=function(_0x477e67,_0x2d2007){const _0x11a7ea=_0x47a3;logger[_0x11a7ea('0x2c')](_0x11a7ea('0x7'),_0x477e67[_0x11a7ea('0x35')]);const _0x536710=conferenceValidation[_0x11a7ea('0x2')](_0x477e67[_0x11a7ea('0x35')]);if(_0x536710[_0x11a7ea('0x3b')]>0x0)return _0x2d2007[_0x11a7ea('0x25')](0x190)[_0x11a7ea('0x1c')](_0x536710);const _0x25b070=_0x477e67[_0x11a7ea('0x35')][_0x11a7ea('0x3c')];return getAgent(_0x25b070)['then'](function(_0x5dfd5d){const _0x4e06bc=_0x11a7ea;return logger[_0x4e06bc('0x2c')]('entityFound:',_0x5dfd5d['name']),emit(util[_0x4e06bc('0x39')]('user:%s',_0x5dfd5d[_0x4e06bc('0x14')]),_0x4e06bc('0x37')),_0x2d2007['status'](0xc8)[_0x4e06bc('0x1c')]({'error':![],'message':'conference\x20executed!'});})[_0x11a7ea('0x32')](handleError(_0x2d2007));},exports['transfer']=function(_0x363a5a,_0x4d94ef){const _0x337fa3=_0x47a3;logger[_0x337fa3('0x2c')](_0x337fa3('0x36'),_0x363a5a[_0x337fa3('0x35')]);const _0x2780c4=transferValidation['validate'](_0x363a5a[_0x337fa3('0x35')]);if(_0x2780c4[_0x337fa3('0x3b')]>0x0)return _0x4d94ef[_0x337fa3('0x25')](0x190)['json'](_0x2780c4);const _0x15944f=_0x363a5a[_0x337fa3('0x35')][_0x337fa3('0x3c')],_0x2cb817=_0x363a5a[_0x337fa3('0x35')][_0x337fa3('0x8')],_0x71fcd7=_0x363a5a[_0x337fa3('0x35')][_0x337fa3('0x3')];return getAgent(_0x15944f)[_0x337fa3('0x12')](function(_0x4b257f){const _0x219377=_0x337fa3;return logger[_0x219377('0x2c')]('entityFound:',_0x4b257f['name']),emit(util[_0x219377('0x39')](_0x219377('0x20'),_0x4b257f[_0x219377('0x14')]),_0x219377('0x3f'),{'sessionId':_0x2cb817,'transferNumber':_0x71fcd7}),_0x4d94ef['status'](0xc8)[_0x219377('0x1c')]({'error':![],'message':_0x219377('0x22')});})[_0x337fa3('0x32')](handleError(_0x4d94ef));};
\ No newline at end of file