Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / services / agi / server.js
index 75f881b..6e501d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfcc=['./error','./channel','call','emit','error','createServer','listening','connection','getConnections','destroy','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events'];(function(_0x2cc7ad,_0x32c01a){var _0x2de1d7=function(_0x215a29){while(--_0x215a29){_0x2cc7ad['push'](_0x2cc7ad['shift']());}};_0x2de1d7(++_0x32c01a);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x2feb53,_0x264ef7){_0x2feb53=_0x2feb53-0x0;var _0x5700ee=_0xdfcc[_0x2feb53];return _0x5700ee;};'use strict';var util=require(_0xcdfc('0x0'));var net=require(_0xcdfc('0x1'));var EventEmitter=require(_0xcdfc('0x2'))['EventEmitter'];var AGIError=require(_0xcdfc('0x3'));var AGIChannel=require(_0xcdfc('0x4'));var AGIServer=function(_0x54bd16,_0x4aef49,_0x468275){var _0x4e9e63=this,_0x54bd16=_0x54bd16||0x11dd,_0x4aef49=_0x4aef49||'127.0.0.1',_0xa928f6=null,_0x155d4c=0x0;EventEmitter[_0xcdfc('0x5')](_0x4e9e63);function _0x35a524(){if(!_0x54bd16){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0xa928f6=net[_0xcdfc('0x8')]();_0xa928f6['listen'](_0x54bd16,_0x4aef49);_0xa928f6['on'](_0xcdfc('0x9'),function(){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x9'));});_0xa928f6['on'](_0xcdfc('0xa'),function(_0x4537b6){_0xa928f6[_0xcdfc('0xb')](function(_0x5575e5,_0x5f1d46){if(_0x5575e5){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5575e5));}else if(_0x468275&&_0x468275<0x0){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4537b6[_0xcdfc('0xc')]();}else if(_0x468275&&_0x468275>0x0&&_0x468275<_0x5f1d46){_0x155d4c+=0x1;_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x155d4c));_0x4537b6[_0xcdfc('0xc')]();}else{var _0xb5a56a=new AGIChannel(_0x4537b6);_0xb5a56a['on']('ready',function(){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0xa'),_0xb5a56a);});}});});_0xa928f6['on'](_0xcdfc('0x7'),function(_0x5189bd){_0x4e9e63[_0xcdfc('0x6')](_0xcdfc('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x5189bd[_0xcdfc('0xd')]));});_0xa928f6['on'](_0xcdfc('0xe'),function(){_0x4e9e63['emit'](_0xcdfc('0xe'),new AGIError(_0xcdfc('0xf')));});}process[_0xcdfc('0x10')](function(){_0x35a524();});};util['inherits'](AGIServer,EventEmitter);module[_0xcdfc('0x11')]=function(_0x8daa88,_0x5ad601,_0x3e1707){return new AGIServer(_0x8daa88,_0x5ad601,_0x3e1707);};
\ No newline at end of file
+var _0x9f3e=['createServer','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x13ff4f,_0x4defc2){var _0xd04dee=function(_0x516beb){while(--_0x516beb){_0x13ff4f['push'](_0x13ff4f['shift']());}};_0xd04dee(++_0x4defc2);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x117f4b,_0x56b75f){_0x117f4b=_0x117f4b-0x0;var _0x5903ec=_0x9f3e[_0x117f4b];return _0x5903ec;};'use strict';var util=require(_0xe9f3('0x0'));var net=require(_0xe9f3('0x1'));var EventEmitter=require(_0xe9f3('0x2'))[_0xe9f3('0x3')];var AGIError=require(_0xe9f3('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x597538,_0x4c3a39,_0x1ea33c){var _0x4bc414=this,_0x597538=_0x597538||0x11dd,_0x4c3a39=_0x4c3a39||_0xe9f3('0x5'),_0x46f926=null,_0x3693ef=0x0;EventEmitter[_0xe9f3('0x6')](_0x4bc414);function _0x407123(){if(!_0x597538){_0x4bc414[_0xe9f3('0x7')](_0xe9f3('0x8'),new AGIError(_0xe9f3('0x9')));return![];}_0x46f926=net[_0xe9f3('0xa')]();_0x46f926[_0xe9f3('0xb')](_0x597538,_0x4c3a39);_0x46f926['on'](_0xe9f3('0xc'),function(){_0x4bc414['emit'](_0xe9f3('0xc'));});_0x46f926['on'](_0xe9f3('0xd'),function(_0x250599){_0x46f926[_0xe9f3('0xe')](function(_0x22ed98,_0x48ae22){if(_0x22ed98){_0x4bc414[_0xe9f3('0x7')](_0xe9f3('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x22ed98));}else if(_0x1ea33c&&_0x1ea33c<0x0){_0x4bc414[_0xe9f3('0x7')]('error',new AGIError(_0xe9f3('0xf')));_0x250599[_0xe9f3('0x10')]();}else if(_0x1ea33c&&_0x1ea33c>0x0&&_0x1ea33c<_0x48ae22){_0x3693ef+=0x1;_0x4bc414[_0xe9f3('0x7')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x3693ef));_0x250599[_0xe9f3('0x10')]();}else{var _0x158f4c=new AGIChannel(_0x250599);_0x158f4c['on']('ready',function(){_0x4bc414[_0xe9f3('0x7')](_0xe9f3('0xd'),_0x158f4c);});}});});_0x46f926['on'](_0xe9f3('0x8'),function(_0x25abdc){_0x4bc414[_0xe9f3('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x25abdc[_0xe9f3('0x11')]));});_0x46f926['on'](_0xe9f3('0x12'),function(){_0x4bc414[_0xe9f3('0x7')](_0xe9f3('0x12'),new AGIError(_0xe9f3('0x13')));});}process['nextTick'](function(){_0x407123();});};util[_0xe9f3('0x14')](AGIServer,EventEmitter);module[_0xe9f3('0x15')]=function(_0x570dc0,_0x2b21b9,_0x679a80){return new AGIServer(_0x570dc0,_0x2b21b9,_0x679a80);};
\ No newline at end of file