Help save the Asterisk-IM plugin :-)

It looks like the Asterisk-IM plugin might be on the chopping block. It hasn’t been updated or maintained in a very long time. Now, it appears that its causing issues with the latest version of openfire. I think this is an important plugin, and one worth saving. Unfortunately, I’m not a coder so my help in this is limited.

If you know of anyone that has the ability/experience to help, please reach out to them! It would be greatly appreciated!

Thanks

4 Likes

So I recompiled using smack 3.4.1 and updated asterisk-java to the last known release 1.00 snapshot, and jtapi1.4 thanks to Carlos. Anyone dare to try? Its working for me, but my testing is very limited.
asteriskim test.rar (648987 Bytes)

2 Likes

Thank you, it looks like it work. Openfire 3.10.2 OpenBSD 5.5 amd64

Yes, thank you so very much… it looks like it’s working w/ Openfire 3.10.2 on CentOS 6.6 (x64).

Question though:

I put asterisk-im.jar into Openfire plugins, and I put asterisk-im-client.jar into Spark plugins on client workstation… is this correct, or should I put both .jar’s into Openfire plugins? (has only been one jar file in the past, is why I ask… like I said, it is working w/ phone status updates!!! )

Updated:

‘Dial Number’ via Spark doesn’t work, but this is by no means a major issue…

asterisk-im.jar is used for openfire, and asterisk-im-client.jar goes into the spark/lib folder. I’m not sure if the client.jar needed to be updated or not, but I went ahead and included it.

Hi Speedy - I really appreciate what you are doing here!

I am running Openfire 3.10.2 in Elastix on a self hosted PBX running on a Linux server.

I just installed the plugin and here is where I am at:

  • Server side - works as advertised. I have registered my Asterisk Server and the Asterisk-IM is able to communicate with it (I see the green light indicator against the entry and I also see the drop down device selection when creating a client phone mapping).

I have copied the new asterisk-im-client.jar into a few of my test clients.

I have restarted all services (ie Elastix/Asterisk, Asterisk-IM, Openfire and client Sparks).

The problem I am having is, when on a phone call, my status does not change to “On the Phone” in Spark.

Any ideas?

hmm…honestly, I have no idea. do the logs in openfire show anything, like “access denied” Here are a few troubleshooting steps I would take. I’m sure you have already tried this though.

  1. give the account used by asterisk-im full admin (read/write) to AMI

  2. check your username to device/ext mapping. (device should look like sip/1001 or whatever your device is)

  3. double check that the username matches what openfire/spark uses.

Thanks Speedy

Yes we have checked all those. One area that is a bit suspect is the Openfire account. I set that up to pick up users from our Active Directory using LDAP - and it does it quite well. However, the way we structure our AD users name is [space] (eg “John Smith”). I have noticed that Spark doesn’t seem to like this is some circumstances and replaces the literal space with its hex equivalent in the form “\20” (eg “John\20Smith”). So I’ll experiment with that.

One other issue is I have read the readme that comes with the Asterisk-IM plugin and it talks about Current Phone Events and their respective classes and mentions a path: “org.jivesoftware.phone.client” - I don’t seem to have that path in my plugin. I have attached a screen shot of my Asterisk-IM Directory Structure - would you mind comparing it to yours and let me know if it is complete?

Cheers

.Astrisk-IM_Dir_Struct.png

org.jivesoftware.phone.client i believe is in the asterisk-im-client jar, that goes with spark.

Ive attached the version that Im using. There isn’t much difference, other than the asteriskjava is version 2.0.0 -snapshot

You may want to create a couple of test users that don’t have spaces in the username to see if that works. If so, that might be part of the issue. Also since you are using ldap, with the username mapping, only use the username, and not full jid.

Sorry I can’t be more helpful!
asterisk-im.rar (679939 Bytes)

1 Like

Speedy

Really appreciate any help you can give - what you have provided is much appreciated.

No luck so far.

I discovered that you cannot map a bogus username in the Phone Mappings because when you save the record the plugin validates the name against the Openfire username - see screen shot below:

I also noticed some weird stuff going in the Openfire logs:

2015.08.15 11:15:40 org.asteriskjava.live.internal.ChannelManager - Adding channel SIP/iinetout-000001b3(1439601339.467)

2015.08.15 11:15:40 org.jivesoftware.util.Log - OnPhoneTask: Could not find device/jid mapping for device SIP/iinetout returning

2015.08.15 11:15:40 org.asteriskjava.live.internal.ChannelManager - Adding channel SIP/410-000001b4(1439601339.468)

2015.08.15 11:15:40 org.jivesoftware.util.Log - OnPhoneTask called for user PhoneUser{id=32, username=‘Dave Muscat’}

2015.08.15 11:15:40 org.jivesoftware.util.Log - no sessions

2015.08.15 11:15:40 org.asteriskjava.live.internal.ChannelManager - SIP/iinetout-000001b3 dialed SIP/410-000001b4

2015.08.15 11:15:55 org.asteriskjava.live.internal.ChannelManager - Removing channel SIP/410-000001b4 due to hangup (NORMAL)

2015.08.15 11:15:55 org.asteriskjava.live.internal.ChannelManager - handleDialEvent: Ignored DialEvent for unknown dst channel null with unique_id null

2015.08.15 11:16:48 org.asteriskjava.live.internal.ChannelManager - Removing channel SIP/iinetout-000001b3 due to hangup (NORMAL)

This line worries me a bit:

2015.08.15 11:15:40 org.jivesoftware.util.Log - no sessions

I’ll have to continue experimenting…

Its a workaround, but I just tested this and it worked. it looks like when there is a space in the username, openfire creates the resource as something like test\20pilot@domain.com/Spark 2.7.1

I’m sure there is a reason…anyway

The asterisk plug in looks for the username as typed, so if entered “test pilot”. it tries to use it. Now, if you type the user “test\20pilot” it seems to work as it should.

I have no idea how to fix this, as I’m not a dev. Hopefully someone will help. @Leon Roy has expressed some interested, so maybe he’ll be able to help when his available.

If you know any developers, please let them know about us, Perhaps they will show and interest in our community!

Hi Speedy,

Yes - I have seen this behaviour in my testing. I am really regretting allowing spaces in user names but that is water under bridge now for Active Directory.

So far I have tested (with no luck):

john smith

john\20smith

john\20smith@domain.com

I am almost tempted to ditch the AD (LDAP) use in Openfire and create users with no spaces in the names. The disadvantage though is that my users then have yet another user name and password to use/remember.

I’ll try it when I get the chance and post the results.

Cheers.

Dave Muscat:

The disadvantage though is that my users then have yet another user name and password to use/remember.

Set Spark to remember the password and they won’t have to remember anything.

Well after some persistence I think I have it working.

I went back to the Asterisk-IM server settings - I originally had my server designated as loop back (127.0.0.1). I found a thread that advised the XMPP protocol prefers domain names as opposed to IP addresses so I changed the server address to the Openfire domain name and it now seems to be working!

I’ll continue testing when I get the chance…

btw…if you go down the road of changing usernames, its easy enough, and will have min impact on users. AD uses SIDS for everything, so user accounts and profiles will continue to work if you changed the AD username. You might have a few one off situations that will need to be fixed (like service accounts, scripts, schedule task. folder redirections, etc).

Glad you got it working!

Thanks for that Speedy and thanks for your help and encouragement,

Thanks @speedy! I finally had time to install the plugins and after restarting Spark, BOOM - Asterisk support was working with all my original settings! If I run into trouble I’ll post what I find.

Openfire 3.10.2, Asterisk 11, CentOS 6.4

Java 1.7.0_76

Dell PE 2650 12GB RAM

1 Like

Worked for me here, too. Thanks @speedy!

Hello,

I seek some help please.

I have Asterisk 13.10, and openfire 4.0.4

Loaded the plugins as described in this forum, the connection setup to my asterisk is green.

The Configure Phone Manager is untouched.

In phone mapping, the select drop down does not give any option. I went ahead and set it as sip/myextension number.

When I try to dial it does not work and in the openfire logs I have warnings

a sample below :

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘report0lsr’ to ‘3179886821’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘pt’ to ‘201(RR)’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘language’ to ‘en’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘report0sourcessrc’ to ‘0x3c87dc30’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘report0dlsr’ to ‘65503.6850’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘from’ to ‘127.0.0.1:0’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

2016.12.05 22:35:30 org.asteriskjava.manager.internal.EventBuilderImpl - Unable to set property ‘uniqueid’ to ‘1480932355.22’ on org.asteriskjava.manager.event.RtcpSentEvent: no setter. Please report at https://github.com/asterisk-java/asterisk-java/issues

Please assist in resolving this issue.

Thank you in advance

There any updates to this project or any changes?

I’m using this “updated” Asterisk-IM plugin on my openfire server & asterisk servers. Works… However, appears to be a visual issue with “On the phone”. Spark will hang onto the user being “on the phone” When the PBX shows the user is no longer on. Any ideas?

Asterisk Manager (AMI) has full read/write privileges for all features, and the user to connect Asterisk Server to Asterisk-IM is also an admin…