Cisco JTAPI lib......PLEASE!

Could someone please help me with using the Cisco JTAPI library with the asterisk-im JTAPI implementation? I have Cisco CallManager and would love to be able to integrate it with Wildfire. I’‘m not a Java developer, but we have plenty on staff. I’'ve learned a lot obsessing over this and would like to see it work.

Thank you so much for any responses. PS, if I get this working I will fully document it and post it for others to benefit.

-Greg

OK, I’‘ve made some headway on this. It doesn’‘t quite work yet, but at least it appears to be communicating with the CallManager. Here’‘s what I’'ve done to make it work so far:

  • Get the source for asterisk-im and wildfire. I had some issues compiling asterisk-im, but fixed it by copying some folders from the wildfire source to the asterisk folder. Perhaps I didn’'t follow the instructions correctly.

  • Install Cisco JTAPI on your devel machine. Copy the cisco jtapi.jar file to the asterisk-im/server/build/lib folder of the source code.

  • Modify build.xml in the build folder to include the Cisco jtapi.jar file.

  • Compile and copy the asterisk-im/server/target/jtapi/asterisk-im.jar plugin to the plugins folder on your server.

  • Go to the plugin configuration page configure the following:

Peer: com.cisco.jtapi.CiscoJtapiPeerImpl

Provider: 10.22.40.2

Parameters: login=

At this point, I wasn’‘t sure what to do, because I’‘m sure Asterisk’‘s implementation of JTAPI is a little different from Cisco’‘s. Since the Provider filed contains the CallManager server IP, I don’'t understand the need to configure a server, but I did anyway. Use 2748 for the port.

I tried setting up some phone mappings and making some calls from Asterisk, but I get the error:

com.cisco.jtapi.InvalidStateExceptionImpl: Address is out of service

I’'ve spent a lot of time on this already and I was gracious enough to post my half solution, so it would be a grand Christmas present if someone could jump in and help me from this point on.

-Greg

Hi Greg!

Do you have a stacktrace for the exception?

Best,

Jens

Jens,

I figured it out. Initially what I did was replace the jtapi-1.3.1.jar with the cisco jtapi.jar. The cisco jtapi.jar is missing some of the methods that the 1.3.1 jar contains, specifically the addCallListener method of the class Terminal. This method is called during initialization of the plugin. To avoid changing the cisco libraries, I changed the “addCallListener” method in JtapiPhoneManager to t.addObserver. This wasn’'t enough. To place a call, Cisco jtapi needs to know status of the address, so I added code to add address listeners along with the terminal listeners. Placing calls works like a charm now.

I’'m working on receiving events now and pushing status to the clients.

Like I said before, I’‘m no Java developer but I’‘m learning very quickly. So far, the only sources I’'ve changed are:

build.xml (to include the cisco jar and exclude the 1.3.1 jar)

JtapiPlugin.java

JtapiPhoneManager.java

JtapiEvents.java

Once I get it completely working, I’'ll try to clean it up cuz it kind of a mess right now.

-Greg

Greg,

How the plug-in coming? I’‘ve been wanting to integrate with CallManager for a while now, but haven’‘t had time to hack on the code. Let me know how it’‘s going and if you need some help testing anything. We’'re running CM 4.1.x here. Thanks

Cameron

Cameron,

I was beginning to wonder if anyone was interested in this integration. I figured with all the views it was a hot topic. To answer your question, I’‘ve got something working that’‘s pretty sweet. I started out knowing nothing about Java and with the help of one of our in-house developers, I’‘ve seen the light. Anyway, here’‘s what I’'ve got:

Tell you what…I’'ll just post my change log:

Asterisk-IM Change Log

This is the list of changes made to Asterisk-IM to make it interoperate with Cisco CM 4.0 which comes with JTAPI 1.2. If an upgrade to later releases of CM are made that include JTAPI 1.3, more changes will need to be made. Specifically, 1.3 uses object “listeners” as opposed to “observers”.

Feature Changes

  • Removed terminal observers and added address and call observers (per address). The idea here is that we’'re more interested in addresses than we are in terminals.

  • Changed the logic to get userfromphone and phonefromuser information ldap via vcard information. This code could eventually support local database users also. Basically, when a user logs in, the code checks if they have an extension configured in their vcard information. If they do, the software will attempt to add address and call listeners for that address. In addition, when a user attempts to call another user, the code looks up their extension via vcard.

Change Log

  • Removed jtapi-1.3.1.jar from build/lib, added Cisco’'s jtapi.jar and modified build.xml to reflect the changes.

  • Replaced “return null” in JtapiPlugin.getJtapiOptions to “return GetOptions()”.

  • Modified JtapiPhoneManager to register Address and Call Observers and removed Terminal Observer.

  • Modified JtapiEvents to implement CallObserver and AddressObserver per previous modification.

  • Added SessionListener private class to JtapiPhoneManager to change the logic of observer creation and removal. With these changes, observers are created when a user with a valid extension (“telephoneNumber” property in LDAP) logs in. When they log out, the observers get destroyed.

  • Changed BasePhoneManager.originate to use vcard to get callerid instead of db. One of the main ideas of this implementation was to get rid of the server side “phone user” db. Why keep track of information that already stored.

Setup specifics

  • Since phone users are extracted from the userprovider, the ability to get username from ext is needed. This is achieved by setting search fields in the wildfire serversettings/profilesettings to “Username/sAMAccountName,Name/cn,Email/mail,Phone/telephoneNumber”.

At this point in time, the only things I’'m missing are:

  1. The removal of the Phone mapping page and all the unnecessary fields on the plugin page. I only use a user specified string for JTAPI provider. Everything else is pretty much automatic.

  2. For some reason the callerid on the toast pop-up on the user is not working. It’‘s supposed to show the name of the caller, but most of the time it shows nothing. The chat window however shows the user’'s name every time.

I’‘d be more than happy to share my code, if anyone’‘s interested. It’'s just not perfectly clean or complete at this time.

-Greg

I for one would love to test this out. What specific version of Call Manager are you running?

We are currently running 4.1(3) and what you have sounds awesome.

Hi All,

Jive has been working on a Asterisk like plugin for Avaya, check out Greg’‘s post here. So you might to contact them to see what they’'re up to.

Cheers,

Ryan

I’‘m not sure how or if we can send private messages on here, but if there’'s a way you are comfortable supplying me with your email address, I can zip up my source for you.

What version of JTAPI does CM 4.1.3 use? If it’‘s 1.2, you should be OK. Otherwise you’'ll have to modify a little.

CM 4.1 users JTAPI 1.2, so we’'re good there.

I’‘ll PM you with my email address. I’‘d be more than happy to test it out. No promises that I’‘ll be any help though, since I’'m not a Java developer either.

Hi gterkanian,

Jive is definitely interested in finding out more about your plugin. Feel free to email or IM me at “greg at jivesoftware dot com” to chat about it.

Thanks,

Greg

gterkanian, I sent you a PM. I’‘d like to help out any way I can. I’'d love to take a look at your source to see what I can figure out. Thanks!

gterkanian,

i have sent you a PM as well. this has been a goal of mine for quite some time, but i just havent had the time to invest in implementing.

thanks,

avidan

Could you post your source code or email it too me. I am really wanting to get this working.

Thanks

I’'d definitely like to be in the loop on source and general updates for this.

atlauren at uci dot edu

Thanks!

Hi,

We are just now throwing Openfire into our existing Cisco setup and I would be very interested in your plugin code. If it is possible, that would be great. Otherwise, well… I guess we will wait a few years for Cisco to release their own stuff…

– Daniel

Hi All,

My name is Sushant.I stay in India.I hav been working in JTAPI for the past few days and was looking for a code that would be sucessful in Cisco IP phones.But most of the time I found out that most people were struck at the same placeie: provider couldn’t be be connected to the CCM.It shows “operation timed out”. Could anyone pls guide me on this

Regards and Thanks,

Sushant

Hi Greg ,

My name is Sushant.I stay in India.I hav been working in JTAPI for the past few days and was looking for a code that would be sucessful in Cisco IP phones.But most of the time I found out that most people were struck at the same placeie: provider couldn’t be be connected to the CCM.It shows "operation timed out"I was just google-ing when I found your post which I found very interesting.Could you please help me with your code.I think it would be of great help to me.You could post me a reply on my mail id mentioned in my profile

Regards and Thanks,

Sushant

Hello!

This is really a hell of a topic.

Integration into phone systems is the way to go IMHO.

I would like to see a hookup to Alcatel systems as their My Teamwork application is simply nothing compared to yours.

However almost all Phone manufacturers try to be compatible somehow to MS OCS so maybe we could emulate an OCS so that these systems are able to connect to OF instead of MS stuff…

Bye

Starry

Hi

To really have it working with Cisco CallManager you really need to do a lot of changes.

We built a year ago a CCM-IM plugin for customer. At the begining, it was based on the asterisk-im plugin, but there a some basic concept that are radically different between Asterisk and CCM (like Extension Mobility and the underlying authorization system)

Yes, JTAPI is 1.2 but you need a provider connection for each user if the Extension Mobility is in use, for instance. If the CCM is 4 or later, there should be queries via AXL for getting some info, etc.

In fact, we built a far more complex plugin (from the basic phone handling: dialing, hanging up, forwarding, redirecting, capturing calls to handle emergency situations like publisher (master) failure or throwling the AXL requests to the CCM to avoid congestions,plus the usual caller/callee identification and rule-based handling (like blacklisting some annoying callers) or realtime statistics )

Openfire is working just fine (on a virtual machine). There’re 1600 users/phones with more than a million messages a day and 10000 daily calls.

At the end, they have something like the OCS+CUPS. Now we’re planning to drop our OCS and put the OpenFire plus a modified version of this CCM-IM plugin (we need to add the outlook presence info: meetings and such).

The Cisco JTAPI libs are always on the Administrator page of your Cisco installation, and on the Cisco CUCM SDKs.

Next is to work with Alcatel…

We can’t provide yet the code. Maybe later…

But if you need info on how to do it, we may help.

C U

Jordi