Question

I have been tasked with writing an application that lets users place calls to Cisco Unified Callmanager 8.6. The contact list will not be provided by the UCM. It will be provided elsewhere.

I find both the documentation and examples provided by Cisco to be lacking and undesirable. I also find the lack of working examples from third parties to be lacking.

My hope is that someone else has done something similar to this before me.

The application gets the numbers to call from a database, it then lets the user click on the contact he or she wants to call. The number of the destination should then be sent to the phone. Basically, in stead of having to dial a number, the application sends the destination to the phone or UCM and the user takes over at this point.

Looking at Cisco's makecall.java, and using it, it seems to be simple to actually place a call using this API.

I have started out by using the example found at http://blog.nominet.org.uk/tech/2008/01/25/experiments-with-jtapi-part-1-making-a-call/ but I believe this piece of code to be insufficient to place a call. I may however be wrong.

Could anyone point me in the right direction here, as I believe my specifications are simple and should be easy to implement. If more information is needed, I will be happy to provide it.

Was it helpful?

Solution 2

I used this code in my project, works correctly:

            final Condition inService = new Condition();
            provider.addObserver(new ProviderObserver() {
                public void providerChangedEvent(ProvEv[] eventList) {
                    if (eventList == null) {
                        return;
                    }
                    for (int i = 0; i < eventList.length; ++i) {
                        if (eventList[i] instanceof ProvInServiceEv) {
                            inService.set();
                        }
                    }
                }
            });
            inService.waitTrue();
            Address srcAddr = provider.getAddress(src);
            co = new CallObserver() {
                public void callChangedEvent(CallEv[] eventList) {    
                }
            };
            srcAddr.addCallObserver(co);
            call = provider.createCall();
            call.connect(srcAddr.getTerminals()[0], srcAddr, dst);

  • src - phone which you are calling from
  • dest - phone which you are calling to

OTHER TIPS

This is months ago, but it still might help you somewhat. I was able to create a test scenario:

protected CiscoJtapiPeer peer;
protected CiscoProvider provider;
// ...

peer = (CiscoJtapiPeer) JtapiPeerFactory.getJtapiPeer(null);
provider = (CiscoProvider) peer.getProvider(cucmURL);

/* cucmURL has the format:
    "192.168.0.20;login=myuser;passwd=mypasswd"
whereas the username is an Application User in Cisco Unified Communications
Manager. On my system, it has the following permissions. I don't know whether all
of them are required:

Standard AXL Users
Standard Audit Users
Standard CCM End Users
Standard CCM Phone Administration
Standard CCM Phone and Users Administration
Standard CCM Read Only
Standard CCM Super Users
Standard CTI Allow Call Monitoring
Standard CTI Allow Call Park Monitoring
Standard CTI Allow Control of All Devices
Standard CTI Allow Control of Phone supporting Connected Xfer and...
Standard CTI Enabled
Standard CTI Secure Connection
Standard RealtimeAndTraceCollection
Standard TabSyncUser

You then add an observer to the provider in order to know when the provider 
object is read for further interaction. You'll receive a "ProvInServiceEv" Event in the event list.
*/

provider.addObserver(providerObserver);
/* Wait until the event has come up */
// Create a sample call:
CiscoTerminal term = provider.createTerminal("your_sep_id_here");
Call call = provider.createCall();
call.connect(term, term.getAddresses()[0], "your_phone_number_to_call");

term is used as "source" from which the call is started. term.getAddresses()[0] just gets the first phone number associated with the "source" phone. "your_phone_number_to_call" is then called.

Another info: It does not work the other way round: You cannot call provider.getAddress("phonenumber") first, because somehow the phone numbers aren't loaded by the provider class before any terminal is connected to it.

This was tested on a CUCM 8.6.2 and Java 7.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top