Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / agi / server.js
index a423632..d928b8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ebf=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','util','net','events','./error','./channel','127.0.0.1','call','error','createServer','listening','emit','getConnections'];(function(_0x5cfa6a,_0xef2a43){var _0x199c01=function(_0x489a91){while(--_0x489a91){_0x5cfa6a['push'](_0x5cfa6a['shift']());}};_0x199c01(++_0xef2a43);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x4c2f30,_0xa91340){_0x4c2f30=_0x4c2f30-0x0;var _0xb8854d=_0x8ebf[_0x4c2f30];return _0xb8854d;};'use strict';var util=require(_0xf8eb('0x0'));var net=require(_0xf8eb('0x1'));var EventEmitter=require(_0xf8eb('0x2'))['EventEmitter'];var AGIError=require(_0xf8eb('0x3'));var AGIChannel=require(_0xf8eb('0x4'));var AGIServer=function(_0x50d234,_0x311ae9,_0x59d6a7){var _0x41e20b=this,_0x50d234=_0x50d234||0x11dd,_0x311ae9=_0x311ae9||_0xf8eb('0x5'),_0x36fde3=null,_0x4cbeaa=0x0;EventEmitter[_0xf8eb('0x6')](_0x41e20b);function _0x2a1fb6(){if(!_0x50d234){_0x41e20b['emit'](_0xf8eb('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x36fde3=net[_0xf8eb('0x8')]();_0x36fde3['listen'](_0x50d234,_0x311ae9);_0x36fde3['on'](_0xf8eb('0x9'),function(){_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0x9'));});_0x36fde3['on']('connection',function(_0x3c602f){_0x36fde3[_0xf8eb('0xb')](function(_0x21191d,_0x2a87ab){if(_0x21191d){_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0x7'),new AGIError(_0xf8eb('0xc'),_0x21191d));}else if(_0x59d6a7&&_0x59d6a7<0x0){_0x41e20b[_0xf8eb('0xa')]('error',new AGIError(_0xf8eb('0xd')));_0x3c602f[_0xf8eb('0xe')]();}else if(_0x59d6a7&&_0x59d6a7>0x0&&_0x59d6a7<_0x2a87ab){_0x4cbeaa+=0x1;_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4cbeaa));_0x3c602f['destroy']();}else{var _0x5f24bc=new AGIChannel(_0x3c602f);_0x5f24bc['on']('ready',function(){_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0xf'),_0x5f24bc);});}});});_0x36fde3['on']('error',function(_0x24277e){_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x24277e[_0xf8eb('0x10')]));});_0x36fde3['on'](_0xf8eb('0x11'),function(){_0x41e20b[_0xf8eb('0xa')](_0xf8eb('0x11'),new AGIError(_0xf8eb('0x12')));});}process[_0xf8eb('0x13')](function(){_0x2a1fb6();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x1d3719,_0x1d4e17,_0xce86f9){return new AGIServer(_0x1d3719,_0x1d4e17,_0xce86f9);};
\ No newline at end of file
+var _0xe94a=['net','events','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe94a,0x1c7));var _0xae94=function(_0x1f9503,_0x8e450b){_0x1f9503=_0x1f9503-0x0;var _0xaab94f=_0xe94a[_0x1f9503];return _0xaab94f;};'use strict';var util=require(_0xae94('0x0'));var net=require(_0xae94('0x1'));var EventEmitter=require(_0xae94('0x2'))['EventEmitter'];var AGIError=require(_0xae94('0x3'));var AGIChannel=require(_0xae94('0x4'));var AGIServer=function(_0x10487b,_0x46e549,_0x3bf666){var _0xf48ae1=this,_0x10487b=_0x10487b||0x11dd,_0x46e549=_0x46e549||_0xae94('0x5'),_0x1f836b=null,_0x1f587d=0x0;EventEmitter[_0xae94('0x6')](_0xf48ae1);function _0x4aee97(){if(!_0x10487b){_0xf48ae1['emit'](_0xae94('0x7'),new AGIError(_0xae94('0x8')));return![];}_0x1f836b=net['createServer']();_0x1f836b[_0xae94('0x9')](_0x10487b,_0x46e549);_0x1f836b['on'](_0xae94('0xa'),function(){_0xf48ae1[_0xae94('0xb')](_0xae94('0xa'));});_0x1f836b['on'](_0xae94('0xc'),function(_0x3fdafe){_0x1f836b[_0xae94('0xd')](function(_0x3e24c6,_0x4cb724){if(_0x3e24c6){_0xf48ae1['emit'](_0xae94('0x7'),new AGIError(_0xae94('0xe'),_0x3e24c6));}else if(_0x3bf666&&_0x3bf666<0x0){_0xf48ae1['emit'](_0xae94('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x3fdafe[_0xae94('0xf')]();}else if(_0x3bf666&&_0x3bf666>0x0&&_0x3bf666<_0x4cb724){_0x1f587d+=0x1;_0xf48ae1[_0xae94('0xb')](_0xae94('0x7'),new AGIError(_0xae94('0x10'),_0x1f587d));_0x3fdafe[_0xae94('0xf')]();}else{var _0x48bf46=new AGIChannel(_0x3fdafe);_0x48bf46['on'](_0xae94('0x11'),function(){_0xf48ae1[_0xae94('0xb')](_0xae94('0xc'),_0x48bf46);});}});});_0x1f836b['on']('error',function(_0x274fb3){_0xf48ae1['emit'](_0xae94('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x274fb3[_0xae94('0x12')]));});_0x1f836b['on'](_0xae94('0x13'),function(){_0xf48ae1['emit']('close',new AGIError(_0xae94('0x14')));});}process[_0xae94('0x15')](function(){_0x4aee97();});};util[_0xae94('0x16')](AGIServer,EventEmitter);module[_0xae94('0x17')]=function(_0x5d4379,_0x282e6f,_0x4467cc){return new AGIServer(_0x5d4379,_0x282e6f,_0x4467cc);};
\ No newline at end of file