Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / agi / server.js
index e496ab1..e2e7a31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6f9=['./channel','127.0.0.1','emit','error','listen','listening','connection','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb6f9,0x146));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9b6f('0x0'));var net=require(_0x9b6f('0x1'));var EventEmitter=require(_0x9b6f('0x2'))[_0x9b6f('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x9b6f('0x4'));var AGIServer=function(_0x118104,_0x4bb50c,_0x49dc7c){var _0x1a6937=this,_0x118104=_0x118104||0x11dd,_0x4bb50c=_0x4bb50c||_0x9b6f('0x5'),_0x4f5c81=null,_0x1740ca=0x0;EventEmitter['call'](_0x1a6937);function _0x1cbc43(){if(!_0x118104){_0x1a6937[_0x9b6f('0x6')](_0x9b6f('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4f5c81=net['createServer']();_0x4f5c81[_0x9b6f('0x8')](_0x118104,_0x4bb50c);_0x4f5c81['on'](_0x9b6f('0x9'),function(){_0x1a6937[_0x9b6f('0x6')](_0x9b6f('0x9'));});_0x4f5c81['on'](_0x9b6f('0xa'),function(_0x49c4b9){_0x4f5c81[_0x9b6f('0xb')](function(_0x6b69f4,_0x5080cd){if(_0x6b69f4){_0x1a6937[_0x9b6f('0x6')](_0x9b6f('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x6b69f4));}else if(_0x49dc7c&&_0x49dc7c<0x0){_0x1a6937[_0x9b6f('0x6')](_0x9b6f('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x49c4b9[_0x9b6f('0xc')]();}else if(_0x49dc7c&&_0x49dc7c>0x0&&_0x49dc7c<_0x5080cd){_0x1740ca+=0x1;_0x1a6937[_0x9b6f('0x6')]('error',new AGIError(_0x9b6f('0xd'),_0x1740ca));_0x49c4b9['destroy']();}else{var _0x3044cb=new AGIChannel(_0x49c4b9);_0x3044cb['on'](_0x9b6f('0xe'),function(){_0x1a6937[_0x9b6f('0x6')]('connection',_0x3044cb);});}});});_0x4f5c81['on'](_0x9b6f('0x7'),function(_0x5ca67f){_0x1a6937[_0x9b6f('0x6')](_0x9b6f('0x7'),new AGIError(_0x9b6f('0xf'),_0x5ca67f[_0x9b6f('0x10')]));});_0x4f5c81['on'](_0x9b6f('0x11'),function(){_0x1a6937[_0x9b6f('0x6')]('close',new AGIError(_0x9b6f('0x12')));});}process[_0x9b6f('0x13')](function(){_0x1cbc43();});};util[_0x9b6f('0x14')](AGIServer,EventEmitter);module[_0x9b6f('0x15')]=function(_0x277fad,_0xd1d558,_0x1288a2){return new AGIServer(_0x277fad,_0xd1d558,_0x1288a2);};
\ No newline at end of file
+var _0x907e=['EventEmitter','./error','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','listening','connection','getConnections','E_AGI_SERVER_ERROR','error','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports'];(function(_0x447749,_0x3bd8fc){var _0x3a6268=function(_0x3c8b8f){while(--_0x3c8b8f){_0x447749['push'](_0x447749['shift']());}};_0x3a6268(++_0x3bd8fc);}(_0x907e,0xc8));var _0xe907=function(_0x3e2489,_0x41d9dd){_0x3e2489=_0x3e2489-0x0;var _0x2254ce=_0x907e[_0x3e2489];return _0x2254ce;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require('events')[_0xe907('0x0')];var AGIError=require(_0xe907('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x17d3ed,_0x207e3b,_0x1ff60a){var _0x301b5e=this,_0x17d3ed=_0x17d3ed||0x11dd,_0x207e3b=_0x207e3b||_0xe907('0x2'),_0x45a93f=null,_0x1824de=0x0;EventEmitter[_0xe907('0x3')](_0x301b5e);function _0x8d762f(){if(!_0x17d3ed){_0x301b5e[_0xe907('0x4')]('error',new AGIError(_0xe907('0x5')));return![];}_0x45a93f=net['createServer']();_0x45a93f['listen'](_0x17d3ed,_0x207e3b);_0x45a93f['on'](_0xe907('0x6'),function(){_0x301b5e[_0xe907('0x4')](_0xe907('0x6'));});_0x45a93f['on'](_0xe907('0x7'),function(_0x15899f){_0x45a93f[_0xe907('0x8')](function(_0x36007d,_0x51a181){if(_0x36007d){_0x301b5e[_0xe907('0x4')]('error',new AGIError(_0xe907('0x9'),_0x36007d));}else if(_0x1ff60a&&_0x1ff60a<0x0){_0x301b5e[_0xe907('0x4')](_0xe907('0xa'),new AGIError(_0xe907('0xb')));_0x15899f['destroy']();}else if(_0x1ff60a&&_0x1ff60a>0x0&&_0x1ff60a<_0x51a181){_0x1824de+=0x1;_0x301b5e[_0xe907('0x4')](_0xe907('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x1824de));_0x15899f[_0xe907('0xc')]();}else{var _0x2dfa3e=new AGIChannel(_0x15899f);_0x2dfa3e['on'](_0xe907('0xd'),function(){_0x301b5e['emit']('connection',_0x2dfa3e);});}});});_0x45a93f['on'](_0xe907('0xa'),function(_0x396594){_0x301b5e[_0xe907('0x4')](_0xe907('0xa'),new AGIError(_0xe907('0x9'),_0x396594[_0xe907('0xe')]));});_0x45a93f['on'](_0xe907('0xf'),function(){_0x301b5e['emit'](_0xe907('0xf'),new AGIError(_0xe907('0x10')));});}process[_0xe907('0x11')](function(){_0x8d762f();});};util[_0xe907('0x12')](AGIServer,EventEmitter);module[_0xe907('0x13')]=function(_0x31d995,_0x54588e,_0x5bafec){return new AGIServer(_0x31d995,_0x54588e,_0x5bafec);};
\ No newline at end of file