简体   繁体   English

Cisco JTAPI到CUCM

[英]Cisco JTAPI to CUCM

I have been tasked with writing an application that lets users place calls to Cisco Unified Callmanager 8.6. 我的任务是编写一个允许用户拨打Cisco Unified Callmanager 8.6的应用程序。 The contact list will not be provided by the UCM. 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. 基本上,应用程序不必拨打号码,而是将目的地发送到电话或UCM,此时用户接管。

Looking at Cisco's makecall.java, and using it, it seems to be simple to actually place a call using this API. 查看思科的makecall.java并使用它,实际使用此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. 我已经开始使用http://blog.nominet.org.uk/tech/2008/01/25/experiments-with-jtapi-part-1-making-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. 如果需要更多信息,我将很乐意提供。

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用作启动呼叫的“源”。 term.getAddresses()[0] just gets the first phone number associated with the "source" phone. term.getAddresses()[0]只获得与“源”手机关联的第一个电话号码。 "your_phone_number_to_call" is then called. 然后调用"your_phone_number_to_call"

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. 另一个信息:它不起作用:你不能首先调用provider.getAddress("phonenumber") ,因为在任何终端连接到它之前,提供者类不会以某种方式加载电话号码。

This was tested on a CUCM 8.6.2 and Java 7. 这是在CUCM 8.6.2和Java 7上测试的。

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 src - 你打来的电话
  • dest - phone which you are calling to 你正打电话给你的电话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM