Asterisk-IM 1.4.0 on Openfire 3.4.3 busted?

Any change in status with this issue?

With OPenfire 3.4.4 out now I’m wondering if anyone has validated that asterisk-im plugin works well with it?

For me it works well.

Ah, that’s great to hear. I have to test it out again, but if all is well I’m upgrading our corporate IM server to this latest version.

I’m having the same issue with openfire 3.4.4 and asterisk-im 1.4.0 now. The plugin page won’t load in the console, just sits there trying to load the page forever. Nothing works for the plugin at all. Basically, it’s the same as before with openfire 3.4.3.

I’m running on debian, and tried with sun jre 1.5 and 1.6.

This is what I get in the error.log:

2008.01.28 16:01:07 org.jivesoftware.phone.PhonePlugin.isEnabled(PhonePlugin.java:277) Error starting or stoping Asterisk-IM

java.lang.InterruptedException

at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterrupti bly(Unknown Source)

at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibl y(Unknown Source)

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

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

at org.jivesoftware.phone.PhonePlugin.isEnabled(PhonePlugin.java:274)

at org.jivesoftware.phone.jsp.phone_002dsettings_jsp._jspService(org.jivesoftware. phone.jsp.phone_002dsettings_jsp:142)

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

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

at org.jivesoftware.openfire.container.PluginServlet.handleJSP(PluginServlet.java: 228)

at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:86 )

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

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1093)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:11 8)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:65)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingF ilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:69)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:98)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1084)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollect ion.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

at org.mortbay.jetty.Server.handle(Server.java:324)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.j ava:828)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

2008.01.28 16:01:07 org.jivesoftware.phone.PhonePlugin.destroy(PhonePlugin.java:144) Error unregistering component

java.lang.NullPointerException

at org.jivesoftware.phone.PhonePlugin.destroy(PhonePlugin.java:141)

at org.jivesoftware.phone.PhonePlugin.destroyPlugin(PhonePlugin.java:131)

at org.jivesoftware.openfire.container.PluginManager.shutdown(PluginManager.java:1 10)

at org.jivesoftware.openfire.XMPPServer.shutdownServer(XMPPServer.java:921)

at org.jivesoftware.openfire.XMPPServer.access$600(XMPPServer.java:92)

at org.jivesoftware.openfire.XMPPServer$ShutdownHookThread.run(XMPPServer.java:867 )

2008.01.28 16:01:07 org.jivesoftware.openfire.container.PluginManager.shutdown(PluginManager.java:11 3)

java.lang.NullPointerException

at org.jivesoftware.phone.PhonePlugin.destroy(PhonePlugin.java:147)

at org.jivesoftware.phone.PhonePlugin.destroyPlugin(PhonePlugin.java:131)

at org.jivesoftware.openfire.container.PluginManager.shutdown(PluginManager.java:1 10)

at org.jivesoftware.openfire.XMPPServer.shutdownServer(XMPPServer.java:921)

at org.jivesoftware.openfire.XMPPServer.access$600(XMPPServer.java:92)

at org.jivesoftware.openfire.XMPPServer$ShutdownHookThread.run(XMPPServer.java:867 )

Hmm maybe this is not really the root cause. Could you enable full logging (including debug logs), clean the logs, start Openfire and send the complete zipped logs - maybe this gives me a point to start.

=Stefan

P.S. If you don’t want to post the logs in public you can also send them directly to me.

I’m seeing the same thing. I started with 3.4.2 that was in the Trixbox repo and now I’ve gone to 3.4.4 from the downloads here. The Asterisk-IM will activate and I see success authenticating at the PBX (same physical box) but I can’t get back to the tab, it just hangs. The server is then showing java and asterisk daemons eating the CPU until it finally becomes almost unrepsonsive. I have to remove the plugin or restart Openfire. I tried a few times in different ways but the same thing happens. What I’m hoping is that I can show presence of asterisk extensions in Spark even if the user is on a deskphone (at the extension I’ll map in the plugin)

Yes, this is exactly the same symptons I am encountering in my test environment.

I’m using openfire 3.4.4 on my production server now, but I have not installed the asterisk-im plugin.

I am really puzzled by this one. The logs do not reveal any useful hints, I am unable to reproduce it in my environments…

Any suggestions?

Yeah, the asterisk logs show sucess. But someting is then loading the server(s) perhaps a loop?

In my case the server is small (1.6MHz, 512M) and is running both asterisk and openfire. However normally the load is minimal as we’re rather small and performance is never a problem until I try to start the plugin.

Could you run ngrep on the box to see what Asterisk and Openfire are talking about?

http://blogs.reucon.com/asterisk-java/2006/08/23/1156297380000.html

Odd but I get no output using ngrep other than:

ngrep -s 1500 port 5038 -T

interface: eth0 (192.168.20.0/255.255.255.0)

filter: (ip) and ( port 5038 )

The * full log will give me this:

logger.c: == Parsing ‘/etc/asterisk/manager.conf’: VERBOSE[9177] logger.c: Found

logger.c: == Parsing ‘/etc/asterisk/manager_additional.conf’: VERBOSE[9177] logger.c: Found

logger.c: == Parsing ‘/etc/asterisk/manager_custom.conf’: VERBOSE[9177] logger.c: Found

logger.c: == Manager ‘openfire’ logged on from 127.0.0.1

Besides the section of manager.conf I have a:

(openfire)

secret = <secret>

deny=0.0.0.0/0.0.0.0

permit=127.0.0.1/255.255.255.0

read = system,call

But as soon as it authenticates I get a runaway java process that quickly overwhelms the server. I have to stop openfire and from the database I have to set a config field to false before I can restart it or it go wonkers again.

Thanks for the help.

If you connect to asterisk on the loopback interface your ngrep command should look like this:

ngrep -d lo -s 1500 port 5038 -T

P.S. To make your logs/code readable in the forum use bla (without the spaces of course)\

Thanks

=Stefan

Well don’t I feel like the newbie tonight…

As soon as I enabled the plugin the ngrep went nuts. I got authenticated but ngrep gave me endless records like this:

T +0.000013 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  Message: Permission denied....
##
T +0.001718 127.0.0.1:34839 -&gt; 127.0.0.1:5038 [AP]
  action: Command..actionid: 8522252_6780#..command: show version files pbx.c....
#
T +0.000335 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  Response: Error..
#
T +0.000041 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  ActionID: 8522252_6780#..
#
T +0.000037 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  Message: Permission denied....
##
T +0.001600 127.0.0.1:34839 -&gt; 127.0.0.1:5038 [AP]
  action: Command..actionid: 8522252_6781#..command: show version files pbx.c....
#
T +0.000354 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  Response: Error..
#
T +0.000043 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  ActionID: 8522252_6781#..
#
T +0.000013 127.0.0.1:5038 -&gt; 127.0.0.1:34839 [AP]
  Message: Permission denied....

This looks like the permissions are a bit too tight.

Can you grant the openfire user full permissions on Asterisk?

Like

[openfire]
...
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

Oh my. That worked! I even get presence active in Spark. Very interesting. Should I keep the privs that high? A little scary that it can run away like that but by raising them higher it actually works, I get a green light and it gives me an accurate drop down list on the mappings.

Brilliant. thanks again.

One more thing, I don’t suppose I could get it to link to other devices like an FXS device? Most of my users are on a legacy device that I’m feeding via FXS but I might run them through asterisk sometime but for now it works great.

It’s probably possible to lower them a bit but that needs further testing. So for now I would keep it the way they are.

You can actually use any channel type with Asterisk-IM, it’s just that IAX/xxx and SIP/xxx are in the dropdown list because Asterisk allows to retrieve the details for SIP and IAX peers. There is a text field where you can manually enter the channel name for other channel types.

This looks like my issue too exactly.

I get the permission denied messages while watching via ngrep.

T +0.060958 12.12.12.12:45318 -> 34.34.34.34:5038

action: Command…actionid: 30035636_2#…command: show version files pbx.c…

T +0.000042 34.34.34.34:5038 -> 12.12.12.12:45318

Response: Error…

T +0.000008 34.34.34.34:5038 -> 12.12.12.12:45318

ActionID: 30035636_2#…

T +0.108143 34.34.34.34:5038 -> 12.12.12.12:45318

Message: Permission denied…

I have “read = call,command,agent,user” and “write =” which used to work fine with asterisk-im 1.3

Apparently something has changed. For security reasons I only allow the openfire server to read phone presence info, i don’t want any more information exposed, and especially any write ability.

Any way I can change this to work as the 1.3 version did?

For 1.4.0 I’ve upgraded the underlying Java library that handles the connection to Asterisk.

It uses the “show version files pbx.c” to determine which version of Asterisk it connects to. If you disallow this command this will fail.

It seems the newer version of that library stays in an infinite loop trying to rerun the command. This is certainly bad. I’ll think of a solution for the next version.

I’ve created PHONE-73 to track this.

Thank you for looking into this. At least for now it is working and it tickles me to see the state change.

Since this is specific to asterisk I’ll likely not be able to detect presence from a GXW FXS device that doesn’t talk directly to * since the ports go directly to a legacy PBX, I could feed it from an * trunk but for now it doesn’t. Perhaps the presence on the extensions that are on my * box will prompt a migration away from the lego system…

Thanks again and I’ll keep an eye out for updates.