Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / services / agi / server.js
index fbb516f..bcc7b2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9936=['createServer','listen','listening','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','connection','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','nextTick','inherits','util','net','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x1ad1c6,_0x2b8663){var _0x4fb7d3=function(_0x538440){while(--_0x538440){_0x1ad1c6['push'](_0x1ad1c6['shift']());}};_0x4fb7d3(++_0x2b8663);}(_0x9936,0x16d));var _0x6993=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x9936[_0x5bfa44];return _0x43815f;};'use strict';var util=require(_0x6993('0x0'));var net=require(_0x6993('0x1'));var EventEmitter=require('events')[_0x6993('0x2')];var AGIError=require(_0x6993('0x3'));var AGIChannel=require(_0x6993('0x4'));var AGIServer=function(_0x1130d2,_0x26274f,_0x32ee9a){var _0x5b9933=this,_0x1130d2=_0x1130d2||0x11dd,_0x26274f=_0x26274f||_0x6993('0x5'),_0x308079=null,_0x2c7931=0x0;EventEmitter['call'](_0x5b9933);function _0x53897e(){if(!_0x1130d2){_0x5b9933[_0x6993('0x6')](_0x6993('0x7'),new AGIError(_0x6993('0x8')));return![];}_0x308079=net[_0x6993('0x9')]();_0x308079[_0x6993('0xa')](_0x1130d2,_0x26274f);_0x308079['on'](_0x6993('0xb'),function(){_0x5b9933[_0x6993('0x6')](_0x6993('0xb'));});_0x308079['on']('connection',function(_0x388366){_0x308079[_0x6993('0xc')](function(_0x565bce,_0x46f413){if(_0x565bce){_0x5b9933['emit'](_0x6993('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x565bce));}else if(_0x32ee9a&&_0x32ee9a<0x0){_0x5b9933[_0x6993('0x6')](_0x6993('0x7'),new AGIError(_0x6993('0xd')));_0x388366[_0x6993('0xe')]();}else if(_0x32ee9a&&_0x32ee9a>0x0&&_0x32ee9a<_0x46f413){_0x2c7931+=0x1;_0x5b9933[_0x6993('0x6')](_0x6993('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x2c7931));_0x388366[_0x6993('0xe')]();}else{var _0x430e26=new AGIChannel(_0x388366);_0x430e26['on'](_0x6993('0xf'),function(){_0x5b9933['emit'](_0x6993('0x10'),_0x430e26);});}});});_0x308079['on'](_0x6993('0x7'),function(_0x334e2c){_0x5b9933[_0x6993('0x6')]('error',new AGIError(_0x6993('0x11'),_0x334e2c['code']));});_0x308079['on'](_0x6993('0x12'),function(){_0x5b9933[_0x6993('0x6')](_0x6993('0x12'),new AGIError(_0x6993('0x13')));});}process[_0x6993('0x14')](function(){_0x53897e();});};util[_0x6993('0x15')](AGIServer,EventEmitter);module['exports']=function(_0x37d7a6,_0x2d6d5d,_0x157905){return new AGIServer(_0x37d7a6,_0x2d6d5d,_0x157905);};
\ No newline at end of file
+var _0x632f=['127.0.0.1','call','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','EventEmitter','./error','./channel'];(function(_0x2f1123,_0x4204a0){var _0x4f98e0=function(_0x24b63d){while(--_0x24b63d){_0x2f1123['push'](_0x2f1123['shift']());}};_0x4f98e0(++_0x4204a0);}(_0x632f,0x1f4));var _0xf632=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x632f[_0x16d10f];return _0x50c823;};'use strict';var util=require(_0xf632('0x0'));var net=require(_0xf632('0x1'));var EventEmitter=require(_0xf632('0x2'))[_0xf632('0x3')];var AGIError=require(_0xf632('0x4'));var AGIChannel=require(_0xf632('0x5'));var AGIServer=function(_0x345043,_0x19b712,_0x175286){var _0x437e4d=this,_0x345043=_0x345043||0x11dd,_0x19b712=_0x19b712||_0xf632('0x6'),_0xfdf18d=null,_0x266159=0x0;EventEmitter[_0xf632('0x7')](_0x437e4d);function _0x4e9ba7(){if(!_0x345043){_0x437e4d['emit']('error',new AGIError(_0xf632('0x8')));return![];}_0xfdf18d=net[_0xf632('0x9')]();_0xfdf18d[_0xf632('0xa')](_0x345043,_0x19b712);_0xfdf18d['on'](_0xf632('0xb'),function(){_0x437e4d[_0xf632('0xc')](_0xf632('0xb'));});_0xfdf18d['on'](_0xf632('0xd'),function(_0x55684e){_0xfdf18d[_0xf632('0xe')](function(_0xbf92c7,_0x45dd49){if(_0xbf92c7){_0x437e4d['emit'](_0xf632('0xf'),new AGIError(_0xf632('0x10'),_0xbf92c7));}else if(_0x175286&&_0x175286<0x0){_0x437e4d[_0xf632('0xc')](_0xf632('0xf'),new AGIError(_0xf632('0x11')));_0x55684e['destroy']();}else if(_0x175286&&_0x175286>0x0&&_0x175286<_0x45dd49){_0x266159+=0x1;_0x437e4d[_0xf632('0xc')](_0xf632('0xf'),new AGIError(_0xf632('0x12'),_0x266159));_0x55684e['destroy']();}else{var _0x3eb75b=new AGIChannel(_0x55684e);_0x3eb75b['on']('ready',function(){_0x437e4d[_0xf632('0xc')]('connection',_0x3eb75b);});}});});_0xfdf18d['on']('error',function(_0x5a2d62){_0x437e4d['emit'](_0xf632('0xf'),new AGIError(_0xf632('0x10'),_0x5a2d62[_0xf632('0x13')]));});_0xfdf18d['on'](_0xf632('0x14'),function(){_0x437e4d[_0xf632('0xc')](_0xf632('0x14'),new AGIError(_0xf632('0x15')));});}process['nextTick'](function(){_0x4e9ba7();});};util['inherits'](AGIServer,EventEmitter);module[_0xf632('0x16')]=function(_0x253e03,_0x26aa78,_0x358864){return new AGIServer(_0x253e03,_0x26aa78,_0x358864);};
\ No newline at end of file