Gokul Blog — A conversation on VoIP, IMS, Cisco and Just about Anything

Deeper analysis of VoIP

Cracking JTAPI on Cisco Call Manager

Posted by tggokul on December 20, 2006

As my regular readers ( if there are any) might have noticed, the frequency of blogs I write have gone down. It is surely not because I have less to say ( my wife would be happy if that was the case 🙂 ). It is because I have been very busy at work.

Now what I have been upto? As my previous blogs suggest, I am very involved with the Cisco Call Manager and I am currently trying out different things with JTAPI so that we can write applications on top of the Cisco Call Manager and probably control Cisco based IPT ( IP Telephony) and IPCC ( IP Contact Centre) solutions.

I am familiar with Java and have been associated with open Telephony APIs like JAIN and Parlay and IPT/IPCC has been my area all these years ( more IPT than IPCC).  So it is not like JTAPI was something new, yet I thought it was quite interesting and a good learning curve.  Concept wise it is nothing different.  It is as simple as an API that supports telephony call control. It is championed by SUN  ( who else) and you can find more information and download the specification here.

So I decided to get my hands dirty and what better way to get a feel of the API than to write a sample application. Before that, these are the following steps that need to be done for writing a JTAPI application on top of the Cisco platform. Go to the call manager and in Applications->plugins->JTAPI, download the client JTAPI application that needs to be run on the machine from where you plan to execute your applications. Next, you need to create an application user with a password and make it part of the CTI-OS group. When the application first starts, it needs to connect to the CCM and it does so using the above mentioned username and password.

Once I was done with this, I took a look at the “Makecall.java” example that comes with the client package ( This will be installed when you download and run the JTAPI client). Basically, Makecall is a 3pcc (Third party call control) which lets two ip phones, connected to the Cisco Call Manager, call each other. Now that is a very good place to start with, but I was not happy. I wanted to write my own cool application. And when you talk cool applications, there is nothing more ‘relevant’ (ah, the pun) than iotum. So I decided to try out a simple relevance engine. Alex has nothing to worry about, I am sure not competition to iotum 🙂

So as part of it, I wrote a small application that checks whether a subscriber ( in this case an ip phone) can take a call at any given time and from whom he can take the call, who gets precedence, which calls get forwarded to other numbers ( or Voice Mail) etc etc. There is no ‘presence’ support as of now on CCM ( It is quite likely that I might not be aware of it even if it was there) and so I could not implement the presence part of it. Need to check that out. Also the communication between the CCM and the ip phones was SCCP ( Cisco’s proprietary signalling) and I want to try it out with SIP ( it should not matter, because my application is protocol agnostic but I need to make sure that Cisco has implemented the JTAPI interfaces for both SCCP and SIP).

I am kind of stuck now on call-forwarding. There are no clear call-forward APIs and I am doing this in a very skewed and round-about way. Am not too happy about it ( You would know I am a performance freak if you had read my previous blogs). So these are some of the open issues I hope to address before we close shop for the holidays.

Overall it has been great and if you guys get a chance, take a look at the JTAPI specification and if you guys are developing a SIP Switch or an endpoint make sure to give a JTAPI interface out. Trust me, it would help your business. You can sell your black boxes and sleep well knowing that there are smart application developers who would write innovative applications on top of your solution. And the good part is that it is not too time consuming either. Make sure to plan for JTAPI in your roadmap.

Advertisements

66 Responses to “Cracking JTAPI on Cisco Call Manager”

  1. […] I have closed one of the open items I was discussing in my blog yesterday. There is a simpler way to do call-forwarding like I had guessed. […]

    • Katia said

      Hi Gokul,

      First of all, let me thank you for this forum! It is so informative!
      I’m new at jtapi applications and I have the same problems as Gajendra and Zoltan.
      I can’t make an external call using makecall.java . But I can make calls between the phones that my user controls. What should I do? Is the problem in the code or in the confirmation of the user?
      Furthermore, I want to implement an application that will give on the phone’s and on the PC’s screen the caller’s name and address.

      Any help will be appreciated.
      Thanks in advance,
      Katia

    • manish said

      Hi ,
      Can you give me code for call conferencing .. It will help me alot.. Thanx in advance..

  2. […] on January 11th, 2007 I am almost done playing with JTAPI and the different events it throws ( see here and here for my other blogs on JTAPI) and have written a sample application that will act as a […]

  3. Torben Bang said

    Hi,

    I am also working on a project that involves jtapi and Call Manager. I have looked around for information/samples, but there is not much around, besides the official Cisco documentation.(MakeCall)

    Do you know any good sources of information to get started with jtapi/Call Manager.

    Thank you

    Torben

  4. tggokul said

    Hi Torben,

    It is always a pleasure to meet a fellow developer working in the same area. And yes, we had the similar issues like yours ( just having MakeCall has a reference). We have gone ahead and implemented other features like Call Hold/Retrieve/Transfer/Forward/Conferencing. We did not have any other sample, we just went through the JTAPI/Cisco APIs and figured it out ( trust me it was not that easy). Are you looking for these kind of examples? If so, I would atleast be able to send you a mail on the different APIs we used. Is that what you are looking for?

    Gokul

    • manish said

      Hi Gokul,
      I have no idea about JTAPI nor I have worked in java before but was given task to make an app for call conferencing. If you can give me the code for the same it will be of great help. I have installed plugins & also tested make call which comes with it..

  5. Torben Bang said

    Hi Gokul,

    Like you I have the sample MakeCall app working. But I also want to make my own stuff. I am totally new to JTAPI, so at the moment I am just trying to grasp the basic. This has turned out to be quite a task, as documentation/samples are very difficult to find.

    I have made my own simplified version of MakeCall, in order to understand what’s going on. It working, but I am kind of stuck as much of my coding right now is on a trial and error basis. I will explain what I am trying to accomplish.

    In the company I am working for our messaging/groupware platform is Notes/Domino. And as Notes/Domino supports Java, JTAPI was the natural way to go to integrate with Call Mangager/IP Phone. I have already made a call solution via Webdialer web service. But this is very limitid in functionality, so I turned to JTAPI.

    Some of the things I am trying to solve is: When a call has been placed between user a and user b, I want to retrieve the phone number of the calling party. After that I will create a contact document containing the phone number.

    I also want to be able to transfer a call.

    I appreciate your help.

    Thank you

    Torben Bang

  6. tggokul said

    Hi Torben,

    What you are looking for (namely calling party phone number and how to transfer call) can be done.

    Let me briefly put it here.

    As you probably are aware ( after looking at the makeCall example) most of the logic is in the metaEvent function. ( all events are captured here). This would be the code to get the calledAddress and callingAddress.

    protected void metaEvent ( CallEv [] eventList ) {
    CallEv curEv = eventList[i];
    CallControlCall ccc = (CallControlCall)curEv.getCall();
    String callingName = ccc.getCallingAddress().getName();
    String calledName = ccc.getCalledAddress().getName();
    }

    So for any given “call” this would be the right way to get the caller and the callee in that call. Hope that answers the first part of your question.

    Now for transfer. I have written a function transferCall() which will take as parameters the current CallEvent and the string notation of the actual number to whom the call has to be transferred ( this is an example for blind transfer)

    public static void transferCall(CallEv curEv, String transferee) {
    /* Example code to transfer a call. Call needs to be connected for this to happen */
    TerminalConnection tc = null;
    CallControlCall ccc = (CallControlCall)curEv.getCall();
    if(transferee != null) {
    try {
    /* Terminal connections are obtained differently if the terminal that is being monitored is the caller or the callee. So I wrote a function called checkIfCaller() to see whether the event that has come in is for the caller or the callee). */
    if(checkIfCaller(curEv)) {
    tc = ((CallCtlConnEstablishedEv)curEv).getCallingTerminal().getTerminalConnections()[0] ;
    } else {
    tc = ((CallCtlConnEstablishedEv)curEv).getConnection().getTerminalConnections()[0];
    }
    ccc.setTransferController(tc);
    System.out.println(“Transferror is ” + ccc.getTransferController());
    ccc.transfer(transferee);
    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }

    I hope this helps. Let me know whether this works for you 🙂 Hope to enjoy my blog and find it informative.

  7. Torben Bang said

    Hi Gokul,

    Thank you for answer, it helps a lot. However, I have an additional question.

    Lets say that the call between user a and user b was established manually. User a dials user b. How would I get a handle to this call from JTAPI? Is it possible?

    Thank you

    Torben

  8. tggokul said

    Hi Torben,

    Handle to any call will be available if you monitor that extension. ( I am assuming User A and User B are Cisco IP phones). For JTAPI events to be captured, you would need to monitor that terminal. So say if you are monitoring User A, the handle to the call from User B ( manual call) will be passed to your application.

    If you take a look at makecall example, you will see that the terminals are first monitored. ( by initializing Actor).

    Does that answer your question?

    Gokul

  9. Torben Bang said

    Hi Gokul,

    Yes, I will try that.

    Thank you

    Torben

  10. Torben Bang said

    Hi Gokul,

    I have got the first part of my question solved, thank you for that. I am currently trying to figure out the second part.

    Let’s say I have a call which is already in place, and I want to transfer the call. When I look at your transferCall function, it takes the current CallEvent as parameter.

    I know that I can get that from the metaEvent handler. But how and from where should I call transferCall. I guess it is not possible from the metaEvent handler.

    Thank you

    Torben

  11. tggokul said

    Hi Torben,

    Glad to hear that the first part works. Now for transferCall, this is what I did. When the first call gets established, the event CallCtlConnEstablishedEv will be got,correct? I store this as curEv in my main class. Now when I press the transfer button (we have the controls/buttons in our main class), I call transferCall from the main class passing the event stored before.

    But the problem with this is, irrespective whether the caller/callee is monitored, when the first call gets connected CallCtlConnEstablishedEv is thrown. TerminalConnections have to be got in a different way depending on whether it is the caller/callee doing the transfer. That is why I have the check for whether it is the caller in transferCall() function.

    Hope that answers your query.

    Gokul

  12. Torben Bang said

    Hi Gokul,

    Just wanted to let you know, that I also got the second part working. 🙂 Thank you very much for your help, I really appreciate it.

    Torben

  13. tggokul said

    Hi Torben,

    Great news. And not a problem at all. Glad that it worked.

    So when you are transferring a call, will you be sending application data ( I saw some getApplicationData() and setApplicationdata() in CallCenterCall ). If so, it might be a little more trickier. I haven’t got around to that yet. if you try it and it works fine, let me know.

  14. Thiyagu said

    Hi Gokul,

    Is there any possiblity event or way that trigger when a call comes from PSTN to Cisco IP phone (this Ip phone has a call forward to another Ip phone or to PSTN ).

    Thanks
    Thiyagu

  15. tggokul said

    Thiyagu,

    Yes you can do it. There is no difference whether the call is from PSTN or not, because all you are controlling is the ip phone. So you can forward the call just like you would forward from an ip phone.

    Are you familiar with normal call forwarding using JTAPI? If so, you can use the same.

    Hope that answers your question.

    Gokul

  16. Thiyagu said

    Gokul,

    Thanks for your response, let us assume the scenario as follow
    Three Ip phone—A, B and C are in CCM cluster.
    assume Observers is added for B and C, not for A.
    IP phone B is set call forwarded to C by user or at CCM,
    Hence a call comes from A to B is automatically fwd to C, and there is no events triggerd regarding this.
    I want any events or way that trace the call forwarding from B to C.
    How can my application know that a call from A to B is forwarded to C?
    becaz CallCtlConnEstablishedEv will return the Callingnumber as A and Called Number as C. JTAPI doesn’t provide the events for this.

    can you help me for the above …….

    note: If possible can you help me by assuming A is a PSTN

    Thanks,
    Thiyagu.

  17. nachodcc said

    Hi there… I’m developing with JTAPI and Cisco too…
    I was wondering if you have an idea of how to intercept a call between 2 phones.
    I’m getting the events, but I’ like to authorize the call…
    Don’t know if I make myself clear…
    I’ like somthing like this…
    T1 calls T2
    myapp sees the call and authorizes it
    T2 starts ringing

    Currently i have
    t1 calls t2
    (simultaneusly) u get the call event and t2 starts ringing

    so currently, if I want to discard the call… i can.. but t2 rings for a short period of time

  18. tggokul said

    Hi,

    What you are asking is very interesting. I don’t think it is possible. Because your application is actually ‘monitoring’ the phone and not exactly controlling it. So if you see for example even a call forwarding application, sometimes the phone would ring before the call gets forwarded. This is basically because of race conditions where the SCCP messages reach the phone before your application can control the course of the call.

    That is my take. I could be wrong but I think logically it makes a lot of sense.

    Gokul

  19. nachodcc said

    yes, you ´re right…
    i’ve seen that if you use MediaControlTerminals there is something like AutoAccept calls.
    SO if it is false, you can reject the connection before the ring.
    I don’t know if thats possible with common terminals..
    Any ideas?
    Another question…
    Are you familiar with calling spaces?
    I need to control an account (address) once it has reached a certain amount of money spended…

  20. Thiyagu said

    Hi Gokul,

    can you help me for the below………….

    1.let us assume the Call Forwarding Scenario as follow…….

    Three Ip phone—A, B and C are in CCM cluster.
    assume Observers is added for B and C, not for A.
    IP phone B is set call forwarded to C by user or at CCM,
    Hence a call comes from A to B is automatically fwd to C, and there is no events triggerd regarding this.
    I want any events or way that trace the call forwarding from B to C, when A call B.
    so that my Apps can control/Monitor that Call forwarding.
    How can my application know that a call from A to B is forwarded to C?
    becaz CallCtlConnEstablishedEv will return the Callingnumber as A and Called Number as B. JTAPI doesn’t provide any events for this.

    note: If possible can you help me by assuming A is a PSTN

    2. help me for this Hunt Pilot scenario also……

    Is there any events occur when a call is routed to hunt group.

    let us have a scenario…
    (i). CTI 5000 is a route point
    (ii). 2345 is a Hunt pilot number.
    (iii).1000,2000 and 3000 where the hunt group number associated for 2345.
    when call is comes to 5000 is routed to Hunt pilot 2345 and it can reach any available hunt group numbers(i.e 1000/2000/3000).
    Is there any events occurs at the time of routing call from 5000 to hunt group numbers(i.e 1000/2000/3000).
    so that my Apps can able to control/Monitor this happening.

    Thanks,
    Thiyagu.

  21. Sushant said

    Dear Gokul,
    I didn’t find anywhere i could ask this question..So I put up this question in ur “about” page.But I think this is the right place to ask u this question.I think u will be able to help me out.I am new to jtapi aand we tried running the makecall.java program available using CCM.I went through this blog where i found u have used this.I am getting the following error :
    Caught exception com.cisco.jtapi.PlatformExceptionImpl: Unable to create provider — Timed Out while waiting for ProverOpenCompletedEvent.What is this event? Do u hav any idea,
    Could u please advice me where the problem lies.Sorry for posting the same question in ur “about” page.Your help would be greatly appriciated
    Regards,
    Sushant

  22. tggokul said

    Sushant,

    What version of CCM are you using? And I assume you are using the jtapi.jar that you downloaded from the corresponding Call Manager?

    Provider in this sense means the CCM. From my understanding of your error it looks like your application is not able to connect to the Call Manager. It could be because your machine running your application is not able to reach the CCM ( try a ping) or it is possible the CTI Service that is supposed to be running on the CallManager is not.

    Hope that helps.

    Gokul

  23. Sushant said

    Thanks for a prompt response Gokul.Though I havn’t been prompt enough to reply u back in time.I am using CCM 1.4 and the jtapi.jar is also downloaded from it.Yeah u r right when u say my application is not able to connect to the Call Manager.I will get back to u as and when I have my application running siting the reason behind the failure.I am a frequent visitor to ur blogs as I enjoy reading them and also find them helpful.
    Thanks again.
    Regards,
    Sushant

  24. Sushant said

    Gokul I was just going through ur blog I saw that I had wrongly spelt CCM 4.2 as CCm 1.4(eeks! sorry for that).And thanks again I have got my program makecall running now.Well u were right,I was actually using the wrong jtapi.jar file.I used the one with 709 kb.I don’t know from where i got in my system.Where as the CCM had the file with 769 kb.I went pulling my hair for all three days with this.Thanks again and sorry for worrying u with this silly mistake

  25. RaymondLeaf said

    Dear Gokul,

    I am totally new in JTAPI and acutally I have a CCM 5.0.4 (linux based) cluster now, also I have a well configured Cisco Voice Gateway 2811 with 2 FXO ports and communicate with CCM via mgcp.

    As if I want to develop the following applications:
    1. IVR based call control (Caller from PSTN received a greeting message, then enter extension number to forward the call to proper user in CCM)
    2. voicemail system
    3. email to voicemail (text to speech service)

    Can JTAPI intergate with CCM can achieve all goals?

    Or anything I need to get as well?

    Thank you very much in advanced.

  26. Marcelo said

    Dear Tggokul:
    Thank you for your posts. I’m just ready to begin to program in JTAPI.
    My first question is:
    What IDE do you suggest?. I have some experience in Eclipse 3.1.

    The second question is:
    Do you know the CUAE (Cisco Unified Application Environment) product?. Has it similar capabilities of JTAPI?

    Finally,
    A JTAPI Application can run out of the Cisco Call Manager and still act as a first party application, for example to monitor calls?

    Thank you in advance.
    marcelo

  27. Zoltan said

    Hi Gokul,

    Do you have any experience setting up call manager to initiate call to an external number (ie: not an extension)?
    I am trying to call an external number and makecall’s response is: InvalidArgumentException: Address 00703178881 is not in provider’s domain.

    Do I have to set up the port to be able to connect to an external number?

    Thanks,
    Zoltan

  28. tggokul said

    Hi Zoltan,

    Let me get some clarity on what you are trying to do. You are trying to make a call “from” 00703178881 to some other number? Then you would get the error you have specified since Call Manager has no reference to this number.

    But if you are trying to make a call “to” the number 00703178881, then you would need to sieze one of the extensions that are associated with your application user and make a call to this number from the extension you have siezed.

    Does that make sense? Your makecall will be “from” one of Call Manager’s extension and the destination can be anything as long as the route pattern is correctly defined.

    Gokul

  29. Zoltan said

    Hi Gokul,

    Thank you for your quick answer.

    I am calling 00703178881 from an extension defined in directory, so the error is coming from the call object’s connect method.

    My process is basicaly:
    1. Create a JtapiPeer from JtapiPeerFactory
    2. Create a Provider with JtapiPeer:getProvider()
    3. Create Address Object with Provider:getAddress() from the originating number
    4. Create a Terminal from Provider:getTerminal() from the originating number
    5. Add callObserver to terminal
    6. Create Call object from Provider:createCall() method.
    7. Create Connection[] with Call:connect(Terminal, Address,String) to destination number

    Regards,
    Zoltan

  30. tggokul said

    Hi Zoltan,

    Is the extension “controlled” by the application user with which you are connecting to the Provider ( i.e the Call manager)?

    Gokul

  31. Zoltan said

    Hi Gokul,

    I think yes. I can make a call between two DN-s. Only outgoing calls make the exception. The route pattern can be the problem, you mentioned. I am just checking it with CCM guys, because I cannot login to the admin console.

    Also could you please advise if I have a single controlling application with multiple users/ports/terminals, how the JTAPI-CCM connection would scale in terms of TCP connections?

    Thanks,
    Zoltan

  32. VOIPMonkey said

    Hi Gokul,
    Do you have any idea if there is a way of getting the current device state from JTAPI?
    i have a need to provide a busy lamp fialed in IPCCX i have writen some apps to apear in the integrated browser which work well but a busy lamp and click to transfer feature would be nice?
    Thanks in advance
    VOIP Monkey

  33. Gajendra said

    Hi Gokul,

    I have also start working on jtapi and Call Manager. I searched around for samples, but there is not much to start with.
    Do you know any good sources of information to get started with jtapi/Call Manager.

    Thanks in advance,
    Gajendra

  34. tggokul said

    Hi VoIP Monkey,

    I know this can be done, I have seen a similar question asked and answered in the Cisco forums. Can you check it out there?

    Gokul

  35. tggokul said

    Hi Gajendra,

    I guess the sample programs that come with the jtapi client might be a good place to start. I learnt JTAPI from that.

    Gokul

  36. Gajendra said

    Hi Gokul,

    I have run the basic makecall.java that comes with the JTAPI client. Its running fine after some configurations.
    Now I want to get all the things related to a directory number. for ex. if i am giving the directory no of CISCO IP Phone then it should return all the information about the directory Number like address,state or events.

    I dont know whether u r getting or not but any help will be appreciated.

  37. tggokul said

    Hi Gajendra,

    What you are asking for his possible. The MonitorEvent Class will give you the details and this is unique for each of the “phones” you are monitoring. So the details of the phone event can be got from this.

    Does that answer your question?

    Gokul

  38. Gajendra said

    Hi Gokul,

    I have some queries:

    1. I am getting some events for an IP Phone but when i am holding the call, i want some event like “CAUSE_UNHOLD” which is for resuming from hold.

    2. where could i get MonitorEvent Class?????

    3. What i have to do when i have to interact with multiple clusters???????

    Regards,
    Gajendra

  39. VOIPMonkey said

    Thanks Guys
    will keep looking
    VOIPMonkey

  40. aldrin said

    Hello Guys,

    I’m a web developer at a call center and I want to create a web application that automatically makes call using Cisco Call Manager. I have no idea on how to do this. I use ASP.net and Javascript in my application. Any suggestions? It would be very grateful for your help.

    Yours,
    Aldrin

  41. Gajendra said

    Hi Aldrin,
    You should use Sun’s JTAPI for making a call in a call center invironment.
    It allows you to make calls, trace calls, call waiting, call forwarding etc etc….

    I suggest u to go through JTAPI specifications on sun’s site…it would be helpful for you.

    Thanks,
    Gajendra

  42. SKT said

    Hi,
    We are interested in finding out statistics of CCM, viz. How many calls got dropped due to congestion, how many calls were made in last x hrs etc. Can anybody suggest how to do that.
    Thanks
    Sandeep

  43. mouna said

    Hello,
    i see your discussion and it seems very interesting so i decide to participate in order to have same answers for my problem .
    i want to initiate an observer when i get a call in order to see his state and i execute cab terminate this calls or rejected him from the CallID(fax softphone …)or his state (responder , not ready , busy …)if it’s ok i forward him for an another terminal ?
    So how can i do this …
    thanks

  44. mouna said

    I saw a tutorial about CallControl package of JTAPI and it seems be interesting in order to make a filtering Call (show the response of an CallObserver and execute Action related to this response …)
    Can you give me an idea (I am little beginner in JTAPI)

  45. Jörg Wesely said

    Hello,
    I want to write a simple application that just monitors a phone, independant on the extensions configured on it.
    It should show if the phone is idle, in use or ringing.
    I was thinking that it would be sufficient to add a CiscoTerminalObserver to the phone, but this seems to be not enough. I get I CiscoTermOutOfServiceEv and CiscoTermInServiceEv events, but nothing like a CiscoTermDeviceStateActiveEv event.
    Has anyone a clue for me? I’m using the JTAPI jar downloaded from CCM4.2.

  46. Kiran said

    Hi,
    I am getting the following Exception while transfering the call,
    ‘IPCC Error [13059]Your request to make a consult call failed’
    Please tell me the root cause for this exception.

  47. John Callahan said

    Jörg –

    Most of the terminal events are disabled by default, but you can create a filter and enable (or disable) events and apply it to the terminal prior to adding an observer – look at the methods for CiscoTermEvFilter – or look at the following example:

    // ciscoTerminal is a CiscoTerminal object
    CiscoTermEvFilter filter = ct.getFilter();
    filter.setDeviceStateActiveEvFilter(true);
    ct.setFilter(filter);
    ct.addObserver(observerClass);

  48. tggokul said

    Hi Kiran,

    Have you associated MTPs. Do a simple test. Instead of transferring from IPCC/Agent desktop see whether you can do a consultative transfer from your phones. If that works, atleast your telephony layer is working.

    Gokul

  49. David said

    I have an application that monitors a group of terminals. One of the terminals makes a call to a terminal resident on another CallManager. When a disconnect happens, how does one determine whether the disconnect was made on the originating terminal or the destination terminal? The sequence of events and cause codes look identical, and there don’t seem to be any useful methods in the events or the CiscoCall object associated with the events to retrieve the side that hung up.
    Thanks,
    David

  50. David said

    What I have observed is this:

    1) The sequence of events when a call is disconnected follows. There is no difference whether the disconnect happens at origin or at destination.

    callChangedEvent Event = (P1-CallerConnect1) 19072/1 ConnDisconnectedEv 9546532528: [#33] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 CallCtlConnDisconnectedEv 9546532528: [#34] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 TermConnDroppedEv SEP001380ADFC19 [#35] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 CallCtlTermConnDroppedEv SEP001380ADFC19 [#36] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 ConnDisconnectedEv 8105: [#37] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 CallCtlConnDisconnectedEv 8105: [#38] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 CallInvalidEv [#39] Cause:100 CallCtlCause:0 CiscoCause:16 CiscoFeatureReason:12
    callChangedEvent Event = (P1-CallerConnect1) 19072/1 CallObservationEndedEv [#40] Cause:100 CallCtlCause:0 CiscoCause:0 CiscoFeatureReason:12

    2) One thing that experimentation has shown is that the system seems to be consistent about this: for a disconnect at the origination, the ConnDisconnecteEv, which is always for the called side first, calling the method callingTerminal.getTerminalConnections() will return at least one TerminalConnection (for itself). For a call disconnected by the destination, the ConnDisconnectEv has already deleted the connection from the calling terminal.

    3) So far, the following code seems to work:

    ConnDisconnectedEv x = (ConnDisconnectedEv) arg0[i];
    CiscoCall ciscoCall = (CiscoCall) x.getCall();
    String callid = ciscoCall.getCallID().toString();

    CallEntry callEntry = (CallEntry)callTable.get(callid);

    Terminal callingTerminal = ciscoCall.getCallingTerminal();
    if (callingTerminal == null) {
    System.out.println (“Null callingTerminal”);
    } else {
    if (callEntry.getState() == CallEntry.CALLSTATE_ACTIVE) {
    TerminalConnection[] connections = callingTerminal.getTerminalConnections();
    if (connections == null) {
    System.out.println (“Null callingTerminal.getTerminalConnections()”);
    callEntry.setState(CallEntry.CALLSTATE_DISC_FAR);
    sendState(“CALLDISCONNECT_FAR”, “”, “”, callid);
    } else {
    for (int idx = 0; idx < connections.length; idx++) {
    String name = connections[idx].getTerminal().getName();
    int state = connections[idx].getState();
    System.out.println (“\tCalling Terminal connection [”
    + idx
    + “]; name = [” + name
    + “]; state = [” + state
    + “]”);
    }
    callEntry.setState(CallEntry.CALLSTATE_DISC_NEAR);
    sendState(“CALLDISCONNECT_NEAR”, “”, “”, callid);
    }
    }
    }

    The question is: have my experiments just by coincidence shown this behavior, or can this behavior be relied on to distinguish disconnects at the origination from disconnects at the destination?

    Thanks,
    David

  51. Flimon said

    Hello,
    I want to write a simple application to let callmanager initiate a call for group of phones, is this possible, what is the method i can use for that?
    hint: i’m using callmanager 4.2

  52. Patricio said

    Hello,

    I working on a project that should involve jtapi and Cisco Call Manager 4.2(3). The application has to look in to the speed dial number directory and compare they with arriving calls. If possible, the name should be displayed instead of the number. (or a popup window)

    Im not so fit on JTAPI and Java is not my prefert language, but this project is for graduation on a university.

    If you have any ideas or informations about tutorials (JTAPI) and how I can solve this, please let me know 🙂

    Regards
    Patricio

  53. Onam Diaz said

    Hi

    I need how to login agent in CCM from jtapi client libraruÂży of java.
    Please Help Me

    sorry my english.

  54. Adrian Marshall said

    You should really consider the Cisco Unified Application Environment. I realise this sounds a lot like hardsell, but its made my life 12321432 times easier. Awesome stuff.

    • tggokul said

      Hi Adrian,

      That is not a hard sell. That is pure sell 🙂 I have used CUAE as well and have blogged about that as well.

      Btw, are you from Cisco?

      Gokul

  55. Daniel said

    Hi,

    I’m a newbie in using JTAPI / call manager. I like to know if is possible to detect the number to be called from an ip phone. I am using CiscoTermButtonPressedEv to catch one by one the numbers and then I saved to an array. Finally, I show the number in the TermConnRingingEv event. When the application is used by multiple users, it take a lot of time to display the number. is that correct? There is a better way?

  56. Sherry said

    Hello Sir,

    I wanna do my MCA project n I have decided to do a project on desktop Telephone Answering Machine…but I have no clue how to start..but I literally wanna do this.

    I have seen the JTAPI 1.4 specification and tried running the sample Incomming Call program but it fails with an error

    Can’t get Provider: javax.telephony.JtapiPeerUnavailableException: JtapiPeer: DefaultJtapiPeer could not be instantiated.

    Please can you explain me the steps I should go through for the completion of this project..

    Sherrry

  57. Katia said

    Hi Gokul,

    First of all, let me thank you for this forum! It is so informative!
    I’m new at jtapi applications and I have the same problems as Gajendra and Zoltan.
    I can’t make an external call using makecall.java . But I can make calls between the phones that my user controls. What should I do? Is the problem in the code or in the confirmation of the user?
    Furthermore, I want to implement an application that will give on the phone’s and on the PC’s screen the caller’s name and address.

    Any help will be appreciated.
    Thanks in advance,
    Katia

  58. Arun said

    Hi,
    I am new to cisco callmanager and JTAPI, i am familiar with java, my requirement is when ever a call comes into the CCM it has to notify a thirdparty application about the caller details and called details. how do i achieve this by using JTAPI. is it possible if i write an observer which get notified when the call comes into the ccm.

    regrds
    ARN

  59. Priyank said

    Hi, I am using JTAPI to connect to AVAYA CTI server. now i am facing one problem. we need to support two lines but i am not sure how to do it. I want that my softphone should be able to provide two lines to agent. so that if one line is busy, agent can see call on second line. please suggest if you have come across this scenario.

  60. Simon said

    Hi,

    I’m just starting off with Jtapi on CCM 8.6 and I’m trying to get makecall to work.

    So far I think I have followed the instructions correctly, but makecall is still failing. I ger an error :-

    Caught exception com.cisco.jtapi.PlatformExceptionImpl: Unable to create provider — connect timed out

    I can ping the CCM ok and the CTI service is running on the CCM, so I just need some pointers to help me get to the bottom of this.

    Thanks

    Simon

  61. safa said

    hi , Gokul plz hel me,
    I’m new to JTAPI so , first of all , i want to run the example of makecall , my goal is to make a call between 2 softphones from an application in eclipse so i want to see the connecxion between an application in eclipse and the cisco callmanager , help me by givin the code to test making call

  62. manish said

    Hi Gokul,
    I have to make an app for call conferencing can you give me a sample code for the same??? I am new to JTAPI & trying to learn it.. I have tested sample code which comes with the SDK.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: