Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / agi / server.js
index bcc7b2f..3ab105d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);};
\ No newline at end of file