powered by Jive Software

Asterisk-IM does not connect to asterisk

I have been trying to test this plugin but I couldn’'t get it to connect to asterisk. The exception I get begins with:

2005.08.03 18:18:10 org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phone _002dsettings_jsp.java:207) unable to get a manager connection : ManagerFactory has not been initialized!

java.lang.IllegalStateException: ManagerFactory has not been initialized!

at org.jivesoftware.phone.asterisk.ManagerConnectionPoolFactory.getManagerConnecti onPool(ManagerConnectionPoolFactory.java:50)

at org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phon e_002dsettings_jsp.java:202)

and then there’'s another one:

2005.08.03 18:18:10 org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phone _002dsettings_jsp.java:170)

java.lang.NullPointerException

at org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phon e_002dsettings_jsp.java:163)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)

Besides, the username setting always changes to “admin” every time I hit the “Save” button overwriting the username I entered.

I think this is a very cool plugin and I hope i can make it work soon

Best regards

Jorge

drencrom,

First ensure that you running on messenger 2.2, it won’'t work on ealier versions.

Also which database are you using?

You will want to make sure that the plugin installed the following tables:

phoneDevice

phoneUser

Next verify that you can connect to the asterisk manager from the server messenger is installed on:

telnet {asterisk server} 5038

type in the following:

action: Login

username: {manager user}

secret: {manager password

(2 carriage returns)

It should say:

Response: Success

Message: Authentication accepted

If this succeeds disconnect by doing the following:

action: Logoff

(2 carriage returns)

Next, ensure that the correct settings for username, password, and server are in the asterisk admin tool.

Also check to make sure the properties are stored in the jiveProperty table correctly:

select * from jiveProperty where name like ‘‘asterisk%’’;

You should see the correct values there too.

If everything looks correct, for good measure restart messenger.

Let me know how it comes out.

P.S.

On the “admin” in the username field isssue, I noticed that firefox was autofiling this field for me too, it doesn’'t happen on safari. I will see if I can make this go away, maybe change the html field name to something other than username.

It seems the problem was the software version, I was using version 2.2.0 beta 1.

I updated to the final release and now works fine, thank you

I am also having the same problem…

2005.08.10 18:01:11 org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phone _002dsettings_jsp.java:170)

java.lang.NullPointerException

at org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phon e_002dsettings_jsp.java:163)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)

  • and -

2005.08.10 18:01:11 org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phone _002dsettings_jsp.java:207) unable to get a manager connection : ManagerFactory has not been initialized!

java.lang.IllegalStateException: ManagerFactory has not been initialized!

at org.jivesoftware.phone.asterisk.ManagerConnectionPoolFactory.getManagerConnecti onPool(ManagerConnectionPoolFactory.java:50)

at org.jivesoftware.messenger.plugin.phone.phone_002dsettings_jsp._jspService(phon e_002dsettings_jsp.java:202)

I’'ve already tried using the telnet to connect to the manager and it works fine. Any ideas?

Thanks!

i’'ve also checked the mysql database and the ip, port, username & password are all correct.

hmmm … interesting … i ran ngrep on port 5038 and when I use telnet to connect to the manager, I get packets … but if I use the web admin … NOTHING!

Any ideas?

Besides being able to connect to the manager proxy via telnet, were you able to log in?

You are running on 2.2.0 final, not an earlier beta?

Try restarting the server and watch for error messages in the log files while the server is initializing, maybe there is another exception which will be more helpful.

thanks, i just tried restarting the plugin and it worked. lolz, should’'ve figured that one out.

cool, Let me know if you have any more problems.

I did all the config done. The Manager connected when I’'m using telnet, the MySQL DB is updated with the correct info. But the Asterisk-IM can not connect to the asterisk server. In the Log stated :

2005.10.21 09:06:39 Connecting to localhost port 5038

2005.10.21 09:06:41 Closing socket.

2005.10.21 09:06:41 IOException while reading from asterisk server, terminating reader thread: Socket closed

and in the asterisk CLI i see :

Connect attempt from ‘‘127.0.0.1’’ unable to authenticate

Please tell me what to do. The Asterisk-IM is greate plugin that I would like to use.

Thanks

Are you sure that your username and pasword match, as well as allowing all connections in your manager.conf?

How can I sure that plugin installed tables (phoneDevice, phoneUser)

I installed plugin, but when I started jive errors occure like this:

26 µ.¤. 2548 15:45:33 org.jivesoftware.phone.database.HibernateUtil updateDB

INFO: Updating phone plugin database

26 µ.¤. 2548 15:45:35 net.sf.asterisk.util.impl.JavaLoggingLog info

INFO: Connecting to iwing port 5038

26 µ.¤. 2548 15:45:38 org.jivesoftware.phone.asterisk.DefaultManagerConnectionPool getConnection

SEVERE: Connection refused: connect

java.net.ConnectException: Connection refused: connect

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(Unknown Source)

at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

at java.net.PlainSocketImpl.connect(Unknown Source)

at java.net.SocksSocketImpl.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.connect(Unknown Source)

at java.net.Socket.(SocketConnectionFacadeImpl.java:34)

at net.sf.asterisk.manager.DefaultManagerConnection.createSocket(DefaultManagerCon nection.java:484)

at net.sf.asterisk.manager.DefaultManagerConnection.connect(DefaultManagerConnecti on.java:473)

at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection .java:393)

at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection .java:352)

at org.jivesoftware.phone.asterisk.DefaultManagerConnectionPool$ManagerObjectPoolF actory.makeObject(DefaultManagerConnectionPool.java:44)

at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.j ava:771)

at org.jivesoftware.phone.asterisk.DefaultManagerConnectionPool.getConnection(Defa ultManagerConnectionPool.java:78)

at org.jivesoftware.phone.asterisk.AsteriskPlugin.initAsteriskManager(AsteriskPlug in.java:288)

at org.jivesoftware.phone.asterisk.AsteriskPlugin.init(AsteriskPlugin.java:117)

at org.jivesoftware.phone.asterisk.AsteriskPlugin.initializePlugin(AsteriskPlugin. java:85)

at org.jivesoftware.messenger.container.PluginManager.loadPlugin(PluginManager.jav a:273)

at org.jivesoftware.messenger.container.PluginManager.access$200(PluginManager.jav a:49)

at org.jivesoftware.messenger.container.PluginManager$PluginMonitor.run(PluginMana ger.java:636)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)

at java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101 (Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodi c(Unknown Source)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknow n Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

what should I do?

plz help

Best regards

Poy

It looks like asterisk-im isn’'t even able to connect to the manager port on your asterisk server.

please try the following from your the server where jive messenger is installed

telnet {asterisk server} 5038[/code]

If this doesn’'t succeed, manager is not enabled or there is a firewall issue. Check your firewall setting and the configuration in manager.conf. If it succeeds do the following:

action: login

username: {manager user}

secret: {manager password}

{two carriage returns}

/code

If this doesn’'t succeed then your username and secret are incorrect in your manager conf.

If both succeed provide me your exact asterisk version, messenger version, asterisk-im version, jvm version, and operating system information. I will have to try to reproduce it.

So, does this imply that running 2.3.0 beta 1 (Linux) will not correctly work with the Asterisk-IM plugin? Sorry if this was specified in big fat letters somewhere; I’‘ve found my way into the docs kind of backwards, and it wasn’‘t in the FAQ. It would seem that 2.3.0 would have the 2.2.0 featureset elements in it, but that doesn’'t seem to be the case.

(Note: I have backed out to 2.2.0 and that does seem to show the correct connections for Asterisk-IM plugin)

In any case, with 2.3.0 here’‘s the debugging: I’‘m able to connect to the Asterisk manager socket on 5038 and also manually correctly log in. I’‘m specifying “127.0.0.1” as the host (though I’‘ve also used the IP on a public ethernet with similar debugging and results) and there are no connection attempts showing up on a packet trace on “lo”. It appears that it’'s not even trying to connect.

The last elements in my “Info” log are:

2005.10.27 22:44:34 Initializing Asterisk-IM Plugin

2005.10.27 22:44:34 Initializing Hibernate for Asterisk-IM

2005.10.27 22:44:46 Checking to see if Asterisk-IM database schema is present

2005.10.27 22:44:46 Ensuring Asterisk-IM schema is up to date

2005.10.27 22:44:46 Updating phone plugin database

2005.10.27 22:44:49 Initializing Asterisk-IM thread Pool

Hi,

Ignore this – I had a typo in my configuration, it’'s working fine now.

Message was edited by:

djalden