Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / services / agi / server.js
index 48c073b..51ed29d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed95=['./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listening','connection','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','close','exports','util','net','events','EventEmitter','./error'];(function(_0x34457b,_0x202cf1){var _0x1dd5d5=function(_0x7c009b){while(--_0x7c009b){_0x34457b['push'](_0x34457b['shift']());}};_0x1dd5d5(++_0x202cf1);}(_0xed95,0xb9));var _0x5ed9=function(_0x33edc4,_0x23fc0f){_0x33edc4=_0x33edc4-0x0;var _0xbf6543=_0xed95[_0x33edc4];return _0xbf6543;};'use strict';var util=require(_0x5ed9('0x0'));var net=require(_0x5ed9('0x1'));var EventEmitter=require(_0x5ed9('0x2'))[_0x5ed9('0x3')];var AGIError=require(_0x5ed9('0x4'));var AGIChannel=require(_0x5ed9('0x5'));var AGIServer=function(_0x453f85,_0x3e2272,_0x2a28e9){var _0x7b84d6=this,_0x453f85=_0x453f85||0x11dd,_0x3e2272=_0x3e2272||_0x5ed9('0x6'),_0x52a57d=null,_0x48efa8=0x0;EventEmitter[_0x5ed9('0x7')](_0x7b84d6);function _0x2fe2dd(){if(!_0x453f85){_0x7b84d6[_0x5ed9('0x8')](_0x5ed9('0x9'),new AGIError(_0x5ed9('0xa')));return![];}_0x52a57d=net['createServer']();_0x52a57d['listen'](_0x453f85,_0x3e2272);_0x52a57d['on'](_0x5ed9('0xb'),function(){_0x7b84d6[_0x5ed9('0x8')](_0x5ed9('0xb'));});_0x52a57d['on'](_0x5ed9('0xc'),function(_0x526924){_0x52a57d['getConnections'](function(_0x28e087,_0x144e86){if(_0x28e087){_0x7b84d6[_0x5ed9('0x8')](_0x5ed9('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x28e087));}else if(_0x2a28e9&&_0x2a28e9<0x0){_0x7b84d6[_0x5ed9('0x8')](_0x5ed9('0x9'),new AGIError(_0x5ed9('0xd')));_0x526924['destroy']();}else if(_0x2a28e9&&_0x2a28e9>0x0&&_0x2a28e9<_0x144e86){_0x48efa8+=0x1;_0x7b84d6['emit'](_0x5ed9('0x9'),new AGIError(_0x5ed9('0xe'),_0x48efa8));_0x526924['destroy']();}else{var _0x2cfd87=new AGIChannel(_0x526924);_0x2cfd87['on'](_0x5ed9('0xf'),function(){_0x7b84d6['emit']('connection',_0x2cfd87);});}});});_0x52a57d['on'](_0x5ed9('0x9'),function(_0x37dcf2){_0x7b84d6['emit'](_0x5ed9('0x9'),new AGIError(_0x5ed9('0x10'),_0x37dcf2['code']));});_0x52a57d['on'](_0x5ed9('0x11'),function(){_0x7b84d6[_0x5ed9('0x8')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x2fe2dd();});};util['inherits'](AGIServer,EventEmitter);module[_0x5ed9('0x12')]=function(_0x409a26,_0x3892d8,_0x44b8ca){return new AGIServer(_0x409a26,_0x3892d8,_0x44b8ca);};
\ No newline at end of file
+var _0xb7cf=['error','E_AGI_ARGUMENT_PORT','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','nextTick','exports','util','net','events','EventEmitter','./error','127.0.0.1','call','emit'];(function(_0x3f2797,_0x4155a9){var _0x1b710f=function(_0x31efbd){while(--_0x31efbd){_0x3f2797['push'](_0x3f2797['shift']());}};_0x1b710f(++_0x4155a9);}(_0xb7cf,0xca));var _0xfb7c=function(_0x14a791,_0xee32e9){_0x14a791=_0x14a791-0x0;var _0x2150f3=_0xb7cf[_0x14a791];return _0x2150f3;};'use strict';var util=require(_0xfb7c('0x0'));var net=require(_0xfb7c('0x1'));var EventEmitter=require(_0xfb7c('0x2'))[_0xfb7c('0x3')];var AGIError=require(_0xfb7c('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x228b05,_0xd5eb0f,_0xf6b92f){var _0xf47c1d=this,_0x228b05=_0x228b05||0x11dd,_0xd5eb0f=_0xd5eb0f||_0xfb7c('0x5'),_0x2e245c=null,_0x135394=0x0;EventEmitter[_0xfb7c('0x6')](_0xf47c1d);function _0x3c21f3(){if(!_0x228b05){_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0x8'),new AGIError(_0xfb7c('0x9')));return![];}_0x2e245c=net['createServer']();_0x2e245c[_0xfb7c('0xa')](_0x228b05,_0xd5eb0f);_0x2e245c['on'](_0xfb7c('0xb'),function(){_0xf47c1d[_0xfb7c('0x7')]('listening');});_0x2e245c['on'](_0xfb7c('0xc'),function(_0x5eef53){_0x2e245c['getConnections'](function(_0x17921f,_0x19824b){if(_0x17921f){_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0x8'),new AGIError(_0xfb7c('0xd'),_0x17921f));}else if(_0xf6b92f&&_0xf6b92f<0x0){_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0x8'),new AGIError(_0xfb7c('0xe')));_0x5eef53['destroy']();}else if(_0xf6b92f&&_0xf6b92f>0x0&&_0xf6b92f<_0x19824b){_0x135394+=0x1;_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x135394));_0x5eef53[_0xfb7c('0xf')]();}else{var _0x270660=new AGIChannel(_0x5eef53);_0x270660['on'](_0xfb7c('0x10'),function(){_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0xc'),_0x270660);});}});});_0x2e245c['on'](_0xfb7c('0x8'),function(_0x536122){_0xf47c1d['emit'](_0xfb7c('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x536122[_0xfb7c('0x11')]));});_0x2e245c['on'](_0xfb7c('0x12'),function(){_0xf47c1d[_0xfb7c('0x7')](_0xfb7c('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xfb7c('0x13')](function(){_0x3c21f3();});};util['inherits'](AGIServer,EventEmitter);module[_0xfb7c('0x14')]=function(_0x227410,_0x3b2298,_0x361017){return new AGIServer(_0x227410,_0x3b2298,_0x361017);};
\ No newline at end of file