Thread: [Asterisk-java-users] Newbie to asterisk-java, connecting to asterisk manager exception
Brought to you by:
srt
From: Christopher M. <chr...@ol...> - 2005-10-05 13:24:58
|
Hi, I'm trying to port my CSTA implementation so that it works with asterisk. I'm just having some trouble connecting to asterisk with the sample code from the tutorial. There is no firewall set, asterisk is running and the manager is enabled as per the instructions. I get this from the stack trace though........ at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:124) at net.sf.asterisk.io.SocketConnectionFacadeImpl.<init>(SocketConnectionFacadeImpl.java:34) at net.sf.asterisk.manager.DefaultManagerConnection.createSocket(DefaultManagerConnection.java:343) at net.sf.asterisk.manager.DefaultManagerConnection.connect(DefaultManagerConnection.java:332) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:253) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:221) at csta.server.asterisk.BogusAsteriskConnection.run(BogusAsteriskConnection.java:128) at csta.server.asterisk.BogusAsteriskConnection.<init>(BogusAsteriskConnection.java:38) at csta.server.CSTAServer.<init>(CSTAServer.java:96) at start_CSTAServer.start_application(start_CSTAServer.java:33) at start_CSTAServer.main(start_CSTAServer.java:18) any ideas? thanks |
From: Jan E. <jan...@pl...> - 2005-10-06 05:57:52
|
On thing that bites me with new installations is that the restrictions in manager.conf are too hard. The defaults are at least here: [admin] secret = blabla deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 This only allows clients from localhost to connect, which for us isn't enough. I always add in another "permit" line for the local subnet to get my app to work, eg. permit=192.168.0.0/255.255.0.0 On Wednesday 05 October 2005 16:24, Christopher Mylonas wrote: > Hi, > I'm trying to port my CSTA implementation so that it works with asterisk. > I'm just having some trouble connecting to asterisk with the sample code > from the tutorial. > > There is no firewall set, asterisk is running and the manager is enabled as > per the instructions. I get this from the stack trace though........ > > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) > at java.net.Socket.connect(Socket.java:452) > at java.net.Socket.connect(Socket.java:402) > at java.net.Socket.<init>(Socket.java:309) > at java.net.Socket.<init>(Socket.java:124) > at > net.sf.asterisk.io.SocketConnectionFacadeImpl.<init>(SocketConnectionFacade >Impl.java:34) at > net.sf.asterisk.manager.DefaultManagerConnection.createSocket(DefaultManage >rConnection.java:343) at > net.sf.asterisk.manager.DefaultManagerConnection.connect(DefaultManagerConn >ection.java:332) at > net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnec >tion.java:253) at > net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnec >tion.java:221) at > csta.server.asterisk.BogusAsteriskConnection.run(BogusAsteriskConnection.ja >va:128) at > csta.server.asterisk.BogusAsteriskConnection.<init>(BogusAsteriskConnection >.java:38) at csta.server.CSTAServer.<init>(CSTAServer.java:96) > at start_CSTAServer.start_application(start_CSTAServer.java:33) > at start_CSTAServer.main(start_CSTAServer.java:18) > > > any ideas? > > thanks > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users -- Jan Ekholm jan...@pl... |
From: Stefan R. <sr...@re...> - 2005-10-13 00:44:21
|
Hi Christopher, > There is no firewall set, asterisk is running and the manager is enable= d > as > per the instructions. I get this from the stack trace though........ > > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:1= 71) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) > at java.net.Socket.connect(Socket.java:452) hmm you did not include the exception message, that makes things a little bit harder... I suppose what you got was a "Connection refused" exception that means you supplied a wrong hostname/ip address or port or the Asterisk server does not listen on the manager port (or there _is_ a firewall ;). Make sure your asterisk is configured properly (and restarted afterwards) and test the connection from the machine running Asterisk-Java via telnet (port 5038). =3DStefan |
From: Jan E. <jan...@pl...> - 2005-10-13 05:55:04
|
On Wednesday 05 October 2005 17:07, Stefan Reuter wrote: > Hi Christopher, > > > There is no firewall set, asterisk is running and the manager is enabled > > as > > per the instructions. I get this from the stack trace though........ > > > > at > > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at > > java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at > > java.net.Socket.connect(Socket.java:452) > > hmm you did not include the exception message, that makes things a little > bit harder... I suppose what you got was a "Connection refused" exception > that means you supplied a wrong hostname/ip address or port or the > Asterisk server does not listen on the manager port (or there _is_ a > firewall ;). > Make sure your asterisk is configured properly (and restarted afterwards) > and test the connection from the machine running Asterisk-Java via telnet > (port 5038). Also make sure Asterisk allows connects to the AMI from your system. On our 1.09 the file to check is /etc/asterisk/manager.conf and the setting "permit" and "deny" in [admin]. I wondered a while why I got "Connection refused" until I understood to check and change that setting (the default seems to be to only allow 127.0.0.1 to connect). -- Jan Ekholm jan...@pl... |