Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / services / agi / server.js
index a3b150f..7d4805a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87df=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','close','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87df,0x167));var _0xf87d=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0x87df[_0x2ace95];return _0x35ecfa;};'use strict';var util=require(_0xf87d('0x0'));var net=require(_0xf87d('0x1'));var EventEmitter=require(_0xf87d('0x2'))[_0xf87d('0x3')];var AGIError=require(_0xf87d('0x4'));var AGIChannel=require(_0xf87d('0x5'));var AGIServer=function(_0x541a39,_0xb0fb5a,_0x25290a){var _0x1d4ff6=this,_0x541a39=_0x541a39||0x11dd,_0xb0fb5a=_0xb0fb5a||'127.0.0.1',_0x38045e=null,_0x40a15b=0x0;EventEmitter[_0xf87d('0x6')](_0x1d4ff6);function _0x3870f8(){if(!_0x541a39){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError(_0xf87d('0x9')));return![];}_0x38045e=net[_0xf87d('0xa')]();_0x38045e[_0xf87d('0xb')](_0x541a39,_0xb0fb5a);_0x38045e['on'](_0xf87d('0xc'),function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0xc'));});_0x38045e['on'](_0xf87d('0xd'),function(_0x390e6a){_0x38045e[_0xf87d('0xe')](function(_0x12d013,_0x23a1fe){if(_0x12d013){_0x1d4ff6['emit'](_0xf87d('0x8'),new AGIError(_0xf87d('0xf'),_0x12d013));}else if(_0x25290a&&_0x25290a<0x0){_0x1d4ff6[_0xf87d('0x7')]('error',new AGIError(_0xf87d('0x10')));_0x390e6a[_0xf87d('0x11')]();}else if(_0x25290a&&_0x25290a>0x0&&_0x25290a<_0x23a1fe){_0x40a15b+=0x1;_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x40a15b));_0x390e6a[_0xf87d('0x11')]();}else{var _0x2487f0=new AGIChannel(_0x390e6a);_0x2487f0['on']('ready',function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0xd'),_0x2487f0);});}});});_0x38045e['on'](_0xf87d('0x8'),function(_0x368872){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x8'),new AGIError(_0xf87d('0xf'),_0x368872['code']));});_0x38045e['on'](_0xf87d('0x12'),function(){_0x1d4ff6[_0xf87d('0x7')](_0xf87d('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xf87d('0x13')](function(){_0x3870f8();});};util[_0xf87d('0x14')](AGIServer,EventEmitter);module[_0xf87d('0x15')]=function(_0x394d44,_0x26cd28,_0x350bee){return new AGIServer(_0x394d44,_0x26cd28,_0x350bee);};
\ No newline at end of file
+var _0xe489=['./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','inherits','exports','util','net','EventEmitter'];(function(_0x56a06f,_0x183813){var _0x3309ac=function(_0x562fb0){while(--_0x562fb0){_0x56a06f['push'](_0x56a06f['shift']());}};_0x3309ac(++_0x183813);}(_0xe489,0x9e));var _0x9e48=function(_0x4a2001,_0x3cce7b){_0x4a2001=_0x4a2001-0x0;var _0x50e70f=_0xe489[_0x4a2001];return _0x50e70f;};'use strict';var util=require(_0x9e48('0x0'));var net=require(_0x9e48('0x1'));var EventEmitter=require('events')[_0x9e48('0x2')];var AGIError=require(_0x9e48('0x3'));var AGIChannel=require(_0x9e48('0x4'));var AGIServer=function(_0x1e9e0b,_0x1c874c,_0x5f372b){var _0x5f02d6=this,_0x1e9e0b=_0x1e9e0b||0x11dd,_0x1c874c=_0x1c874c||_0x9e48('0x5'),_0x9b6c19=null,_0x42747f=0x0;EventEmitter[_0x9e48('0x6')](_0x5f02d6);function _0x4b9d5e(){if(!_0x1e9e0b){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0x8'),new AGIError(_0x9e48('0x9')));return![];}_0x9b6c19=net[_0x9e48('0xa')]();_0x9b6c19[_0x9e48('0xb')](_0x1e9e0b,_0x1c874c);_0x9b6c19['on']('listening',function(){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0xc'));});_0x9b6c19['on'](_0x9e48('0xd'),function(_0x2b617b){_0x9b6c19['getConnections'](function(_0x343a37,_0x397b82){if(_0x343a37){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0x8'),new AGIError(_0x9e48('0xe'),_0x343a37));}else if(_0x5f372b&&_0x5f372b<0x0){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0x8'),new AGIError(_0x9e48('0xf')));_0x2b617b[_0x9e48('0x10')]();}else if(_0x5f372b&&_0x5f372b>0x0&&_0x5f372b<_0x397b82){_0x42747f+=0x1;_0x5f02d6['emit']('error',new AGIError(_0x9e48('0x11'),_0x42747f));_0x2b617b[_0x9e48('0x10')]();}else{var _0x52bdba=new AGIChannel(_0x2b617b);_0x52bdba['on']('ready',function(){_0x5f02d6[_0x9e48('0x7')]('connection',_0x52bdba);});}});});_0x9b6c19['on'](_0x9e48('0x8'),function(_0x5ac1ef){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0x8'),new AGIError(_0x9e48('0xe'),_0x5ac1ef[_0x9e48('0x12')]));});_0x9b6c19['on']('close',function(){_0x5f02d6[_0x9e48('0x7')](_0x9e48('0x13'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x9e48('0x14')](function(){_0x4b9d5e();});};util[_0x9e48('0x15')](AGIServer,EventEmitter);module[_0x9e48('0x16')]=function(_0x49c3d3,_0x5f5360,_0x10a39a){return new AGIServer(_0x49c3d3,_0x5f5360,_0x10a39a);};
\ No newline at end of file