This is my fourth blog article about the Avaya Collaboration Environment (CE). My previous articles were fairly high level in nature and explained what you can do with CE, but didn’t go into a lot of detail about how to make the magic work. In this article, I am going to take you much deeper and introduce you to the process of developing a CE application.
While knowing how to write Java code is certainly helpful in understanding the nitty-gritty aspects of creating CE applications, I will do my best to hold your hand through those parts. Don’t get scared away just yet.
Are you ready? Great, let’s get started.
A word to the wise. You will gain a deeper understanding of this material if you first read through these related articles:
The Avaya Collaboration Environment
An Introduction to Avaya Collaboration Environment 3.0
First, CE applications are written in Java. Period. If you are a C# programmer, you need to find yourself a good book on Java and get busy learning it. This is because the CE run-time environment is WebSphere Application Server (WAS) and WAS only hosts Java applications. Of course, since Java is the greatest language ever written, this requirement should not be a problem for real programmers.
That last comment was meant to be a joke…mostly.
The development environment for CE applications consists of Eclipse For Java EE Developers and Maven. Both are available as free downloads and are fairly simple to install. Grab the latest tested releases and you will be fine.
Note that Avaya SDK requires that you set a number of Environment Variables for Eclipse and Maven. Please refer to the installation manuals or videos for details on which ones need to be created.
Eclipse is the IDE (Integrated Development Environment) in which you will write all your Java code. For nearly every Java programmer that I know, this should not come as a great surprise. Eclipse has been around for a long time and is a very popular development tool. I started using it over ten years ago and it’s still my IDE of choice.
Maven is used to package and build your CE application. I will admit that this is my first experience with Maven, but I found it easy enough to figure out and far less complicated than old-fashioned Make files. Better yet, there is a plug-in for Eclipse that hides nearly all the Maven plumbing and allows you to concentrate on writing code. Maven does the heavy lifting of building the deliverable that gets loaded onto a CE server.
Of course, since you are writing java code, you must install a Java Software Development Kit (SDK). I use the glassfish4 release, but that’s certainly not a requirement.
You also need to obtain the CE SDK. This can be downloaded from the Avaya DevConnect site. You will also find a number of excellent videos up there that walk you through the installation and configuration process. I found them to be invaluable to my success.
Avaya created a Maven archetype that makes it extremely easy to write your applications. With just a few key strokes and mouse clicks, I was able to create the skeleton of a Call Intercept application that looks something like this.
public class MyCallListener extends CallListenerAbstract {
private static Logger logger = Logger.getLogger(MyCallListener.class);
public MyCallListener()
{
}
public final void callIntercepted(final Call call)
{
logger.fine(“Entered callIntercepted.”);
call.allow();
}
}
If you are not a Java programmer (and I applaud the uninitiated that are still reading this article), please allow me to explain what you are looking at.
MyCallListener is the container for the code that processes an incoming or outgoing call. This means that it will be executed on every single call that comes in on a trunk or is sent out through a trunk. Of most importance is the method callIntercepted. This is where you put the code that tells CE what to do with a call. By default, callIntercepted allows a call to proceed uninhibited.
Of course, allowing a call to proceed as if nothing happened isn’t all that exciting. To remedy that, you add code to callIntercepted that tells CE to do interesting things with the call.
Those things might include stopping it dead in its tracks (e.g. block list). It might also include sending it to a destination different than the number the caller dialed (e.g. Find-Me-Follow-Me). Even more exciting, you may want to create a conference from this call and invite other people to join in. We can take it even further by having this call launch emails, text messages, video conferences, or anything else your heart might desire (or your business requires).
Once you have latched onto an in-progress call, CE allows you to write an application that manipulates it in a million different ways.
Key to this manipulation is the call object. If you look at the skeleton code you will see the statement call.allow(). This tells CE to send the call on its merry way. The call object allows you to do so much more than that, though.
Here are a few examples:
call.allow() | Send the call on to the next hop |
call.divert | Send the call to a new destination |
call.drop | Release the call |
call.getCalledParty() | Get information about the called party |
call.isCallingParty() | Get information about the calling party |
call.initiate() | Create a new outgoing call |
Using the above, redirecting an incoming call to an operator could be as simple as this:
call.divertTo(“0”);
Adding the text “Important:” to the caller’s name display could be accomplished with the following lines of code:
Participant callingParty = call.getCallingParty();
String newInfo = “Important: ” + callingParty.getDisplayName();
callingParty.setPresentedDisplayName(newInfo);
I could go on and on, but the point is that once you have the call, what occurs next is up to you. You can dip into a database, call out to external service via web services, change the caller’s displayed number, invoke another CE application, or anything else you code into your application. You are only limited by your imagination.
It’s important to know that even though the application is processing a SIP call, there is no need for the programmer to know the first thing about SIP. The SIP URI, headers, header parameters, and message body are all hidden from the application. That’s not to say that you can’t get to them if you really want to, but for most applications, that’s not required. Telling a call to drop can be accomplished without knowing that this will generate an 6xx response or a BYE message.
Now, I wasn’t quite accurate when I said “every single call that comes in on a trunk or is sent out through a trunk.” CE allows you to define exactly which calls you want your application to process. It does this by assigning endpoints and telephone numbers to an application. For instance, you might want to assign everyone in the sales group to one CE application and everyone in accounts receivable to a different CE application. You might want your CE application to only run on the behalf of your contact center agents. You get to decide all that when you install and configure the application.
In addition to simply manipulating telephone calls, CE has connectors to email, SMS text, and video systems. It also provides a media interface that allows you to play prompts and collect responses.
Writing an application that intercepts an incoming call, plays a message to the caller, collects his or her touch-tone responses, deflects the call to a new destination, and sends a text message back to the caller is straightforward and simple.
Building the Application
Once you’ve figure out what you want your application to do, you must invoke Maven to build and create the deliverable. The deliverable is in the form of an svar (Structural VAR) file that is then loaded onto the CE server. The loading and subsequent configuration is done using the Avaya Aura System Manager.
Once an application is loaded and users have been assigned to it, it’s ready to run. It’s that simple.
One more thing. Make note of the logger variable in the skeleton code. This allows your application to write to a system console at execution time — think System.out.println(). This can be invaluable during the development phase.
That’s All For Now
I was pleasantly surprised to see how easy the entire process was. The longest part was setting up Eclipse, Maven, and the Java SDK, but I would have to do that for any Java development project. Once everything was installed and configured, using the CE SDK is a piece of cake. It’s extremely well documented with an organized and well-structured Javadoc. Additionally, Maven greatly simplifies the application development process. It’s almost as if the code writes itself.
I intend to continue documenting my findings as I dig deeper into the SDK and write more complicated applications. I am just starting to play with the data APIs and I have yet to do anything with the media interface.
So much to explore and so little time…