Saturday, May 1, 2010

CTS Manager - Understanding EWS Integration

Starting CTS Manager version 1.6, Cisco CTS-Man Integrated with Exchange 2007 is supported with WebDAV and EWS.

Exchange Web Services (EWS) provides the functionality to enable client applications to communicate with the Exchange server. EWS provides access to much of the same data that is made available through Microsoft Office Outlook. EWS clients can integrate Outlook data into Line-of-Business (LOB) applications. SOAP provides the messaging framework for messages sent between the client application and the Exchange server. The SOAP messages are sent by HTTP.
EWS is described by three files:
  • Services.wsdl   Describes the contract between client and server.
  • Messages.xsd   Defines the request and response SOAP messages.
  • Types.xsd   Defines the elements used in the SOAP messages.
These schema files are located in the IIS virtual directory that hosts Exchange Web Services of the computer that is running Microsoft Exchange Server that has the Client Access server role installed.
Exchange Web Services Features

For more information refer to:

  • CTS-Man and EWS

Note: Please refer to this document for CTS-Man configuration:
http://www.cisco.com/en/US/docs/telepresence/cts_manager/1_6/admin/ctm_instalMS.html#wp1082366


To understand the process CTS-Man is designed to integrate with EWS please read the following:

1. CTS-Man will obtain CTS system information from CUCM RIS Database via discovery process, discovery method involves AXL/SOAP and CTI protocols. AXL queries will retrieve room information for both CTS system and IP Phone, and CTI process  will help us to determine registration status of room.


Here is one of the queries executed by CTS-Man to retrieve TelePresence rooms


30 Apr 2010 14:12:43,696 [DM-WebappController] ccm.CCMClientAdapter - Query is: select pkid, name, description, tkmodel, fkdevicepool, sshuserid, sshpassword, xml from device where tkmodel=375 or  tkmodel=478 or  tkmodel=479 or  tkmodel=480 or  tkmodel=481 or  tkmodel=505 or  tkmodel=520 or  tkmodel=557 or  tkmodel=558
30 Apr 2010 14:12:43,728 [DM-WebappController] discovery.DiscoveryMgmtImpl - Initial Discovery on startup.: END


CTI/JTAPI will inform us about CTS device registration status


30 Apr 2010 15:22:57,610 [ObserverThread(TermObs_142.43.4.7)] cti.CTITerminalObserver - CTI Event for Terminal SEP001DA238F6C3 value:Registered
30 Apr 2010 15:23:16,132 [DM-CTIEventHandler] cti.CTIEventHandler - Updated CCM Connectivity State for TB : SEP001DA238F6C3 State : Registered
30 Apr 2010 15:24:44,045 [DM-ris-ipAddr_142.43.4.7] discovery.DiscoveryUtility - Syncing device Name: SEP001DA238F6C3 IP Address: 142.43.16.115
30 Apr 2010 16:11:07,401 [ObserverThread(TermObs_142.43.4.7)] cti.CTITerminalObserver - CTI Event for Terminal SEP001DA238F6C3 value:UnRegistered
30 Apr 2010 16:11:20,694 [DM-CTIEventHandler] cti.CTIEventHandler - Updated CCM Connectivity State for TB : SEP001DA238F6C3 State : Unregistered



When CTS-Man is executing one of the AXL queries against CUCM we will extract Room Email id from Device.


Here is a useful tool for looking at AXL transactions.
This definitely includes normal AXL configuration and AXL Serviceability.
Point web browser to:


https://CUCM IP Address:8443/realtimeservice/SOAPMonitor


authenticate with CCMAdministrator. this launches a java app in the browser that shows every AXL SOAP response and request

2. After Discovery process is completed and room is synchronized with CUCM, CTS-Man will start room syncronization with LDAP and Exchange service.
We will read information from LDAP  to execute a query that will help us find Rooms in Active Directory. This new connection will help us matching Email ID in CUCM against LDAP configuration


3.  After above process is completed, we will verify if EWS connection is valid by sending EWS message to Exchange server configured. 
The Axis2 Library does not support NTLM v2 before CTS-Man 1.6.3. CTS-Man 1.6.3 and above support this NTLM v2.

Note:
Account used to authenticate will be the one configured under EWS section.

30 Apr 2010 20:27:54,220 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
30 Apr 2010 20:27:54,221 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
30 Apr 2010 20:27:54,221 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "SOAPAction: "http://schemas.microsoft.com/exchange/services/2006/messages/GetFolder"[\r][\n]"
30 Apr 2010 20:27:54,221 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "User-Agent: Axis2[\r][\n]"
30 Apr 2010 20:27:54,222 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "Host: 10.34.78.67[\r][\n]"
30 Apr 2010 20:27:54,222 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "Content-Length: 654[\r][\n]"
30 Apr 2010 20:27:54,222 DEBUG [GA-EWSConnectionMonitor] wire.header (wire:69) - >> "[\r][\n]"
30 Apr 2010 20:27:54,223 DEBUG [GA-EWSConnectionMonitor] wire.content (wire:83) - >> "IdOnly"


CTS-Man will start a new HTTP connection to Exchange server, this HTTP connection can be on port 80 or by using HTTP over SSL if secure option is configured in CTS-Man.


CTS-Man will start a new HTTP TCP connection using an ephemeral port but as destination port 80 or 443 depending what is configured above. Example:

CTS-Man 172.16.154.11
Exchange 172.16.154.4


CTS-Man src port 32828 src ip.addr 172.16.154.11
                  dst port 443     dst ip.addr 172.16.154.4


4. Once we verify EWS Exchange connection is established, we will connect to Active Directory and authenticate using CTS-Man account configured under EWS.
A new LDAP search is performed by retrieving the parameters configured under LDAP settings in CTS-Man Administration Web Page or Pre-qual tool. This is one of the reason why LDAP integration is mandatory for Exchange; we must configured both for a successful integration.

Verify EWS in Exchange by using:

curl -I -k -u yourctsmanaccount@yourdomain.com:password https://1ews/Services.wsdl --ntlm
or

From Browser

https://1ews/exchange.asmx

During this stage mailbox quota parameters are retrieved.

30 Apr 2010 20:27:54,560 AUDIT [GA-EWSConnectionMonitor] ews.EWSConnectionMonitor (testConnection:133) - Connection to Exchange Web Service is valid
30 Apr 2010 20:28:20,283 DEBUG [http-8080-1] server.ServerAdminMgmtImpl (getWebappState:678) - Returning state: Running,  for controller: GroupwareAdapter
30 Apr 2010 20:29:00,044 DEBUG [http-8080-1] server.ServerAdminMgmtImpl (getWebappState:678) - Returning state: Running,  for controller: GroupwareAdapter
30 Apr 2010 20:29:00,052 DEBUG [http-8080-1] server.ServerAdminMgmtImpl (getWebappStateMessage:710) - Returning webapp state message: , for controller: GroupwareAdapter
30 Apr 2010 20:29:00,265 PERF [http-8080-1] dataaccess.DataAccessManager (search:235) - Searching for objects of type Person using attribute emailID
30 Apr 2010 20:29:00,266 PERF [http-8080-1] dataaccess.PObjectHandler (searchWithCountAndSkip:1345) - Start search()
30 Apr 2010 20:29:00,283 DEBUG [http-8080-1] util.LDAPServerDBUtil (getDefaultLDAPServer:318) - Returning Default LDAPServer...LDAPServerImpl(1.1.1.1)
30 Apr 2010 20:29:00,284 INFO [http-8080-1] jndi.JNDIConnection (search:882) - JNDI search criteria string is : (&(proxyaddresses=SMTP:ctsmanager@cisco.com)(objectclass=Person))
30 Apr 2010 20:29:00,284 INFO [http-8080-1] jndi.JNDIConnection (search:898) - Searching from specified user containers: [cn=Users,dc=Telepresence,dc=cisco,dc=com]
30 Apr 2010 20:29:00,285 DEBUG [http-8080-1] jndi.JNDIConnection (search:992) - The attributes requested in search :
distinguishedname
displayname
proxyaddresses
proxyaddresses
mdbstoragequota
memberof
msexchuseraccountcontrol
msexchrecipienttypedetails
msexchmasteraccountsid
objectsid

30 Apr 2010 20:29:00,298 ERROR [http-8080-1] common.MailboxMonitor (checkMailboxSize:155) - unable to retrieve mailbox quota. Error: ErrorCode(MAILBOX_PROCESS_ERROR,EA,3112,Unable to calculate mailbox size because $1.)


5.  Now we need to verify information for each room which is successfully configured from Exchange EWS folders:



30 Apr 2010 20:29:43,264 DEBUG [http-8080-1] server.ServerAdminMgmtImpl (getWebappState:678) - Returning state: Running, Sync In Progress... 0% of room(s) completed for controller: GroupwareAdapter

30 Apr 2010 20:29:43,358 DEBUG [GA-SyncMonitor] sync.SyncMonitor (run:385) - About to sync syncEntityName=[15], # running tasks: 0, remaining to run: 5
30 Apr 2010 20:29:43,358 DEBUG [GA-SyncMonitor] executor.ThreadPool (execute:64) - Pool EWSSyncUpThreadPool executes task: com.cisco.ts.scheduler.adapter.ews.sync.EWSSyncThread@1fba1d
30 Apr 2010 20:29:43,358 DEBUG [GA-SyncMonitor] sync.EWSSyncMonitor (syncUp:50) - Executing SyncTask for room=[15]

30 Apr 2010 20:29:43,364 AUDIT [GA-EWSSyncUpThreadPool-Thread-19] sync.EWSSyncThread (run:71) - About to syncup, roomSerialId=[15], roomName=[Cisco.Room4@cisco.com]; syncTaskID=29, syncPeriodID: 0
30 Apr 2010 20:29:43,365 DEBUG [GA-EWSSyncUpThreadPool-Thread-19] sync.EWSSyncThread (checkRoomValidity:188) - room name: Cisco Room4, id: 15 is valid for syncup processing

30 Apr 2010 20:29:43,382 DEBUG [GA-EWSSyncUpThreadPool-Thread-19] common.DBHelper (setRoomStatus:754) - Updating DB with subscription status for room ID:  15 =0

30 Apr 2010 20:29:43,402 DEBUG [GA-EWSSyncUpThreadPool-Thread-19] util.LDAPServerDBUtil (getDefaultLDAPServer:318) - Returning Default LDAPServer...LDAPServerImpl(10.34.70.242)
30 Apr 2010 20:29:43,403 INFO [GA-EWSSyncUpThreadPool-Thread-19] jndi.JNDIConnection (search:882) - JNDI search criteria string is : (&(proxyaddresses=SMTP:Cisco.Room4@cisco.com)(objectclass=Person))
30 Apr 2010 20:29:43,403 INFO [GA-EWSSyncUpThreadPool-Thread-19] jndi.JNDIConnection (search:898) - Searching from specified user containers: [cn=Users,dc=Telepresence,dc=cisco,dc=com]
30 Apr 2010 20:29:43,403 DEBUG [GA-EWSSyncUpThreadPool-Thread-19] jndi.JNDIConnection (search:992) - The attributes requested in search :
distinguishedname
displayname
proxyaddresses


During this stage we will retrieve room information as well as meetings in which these rooms are  participants.

30 Apr 2010 20:29:45,030 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "POST /EWS/Exchange.asmx HTTP/1.1[\r][\n]"
30 Apr 2010 20:29:45,030 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
30 Apr 2010 20:29:45,031 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "SOAPAction: "http://schemas.microsoft.com/exchange/services/2006/messages/Subscribe"[\r][\n]"
30 Apr 2010 20:29:45,031 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "User-Agent: Axis2[\r][\n]"
30 Apr 2010 20:29:45,031 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "Host: 10.34.78.67[\r][\n]"
30 Apr 2010 20:29:45,032 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "Content-Length: 1180[\r][\n]"
30 Apr 2010 20:29:45,032 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.header (wire:69) - >> "[\r][\n]"
30 Apr 2010 20:29:45,032 DEBUG [GA-EWSSyncUpThreadPool-Thread-8] wire.content (wire:83) - >> "Cisco_Room4@cisco.comCreatedEventModifiedEventDeletedEventMovedEventNewMailEvent10http://CTPFCPCTM/adapters/services/NotificationService"
 


6. EWS will notify CTS-Man and will assign a subscription ID for every room:


30 Apr 2010 20:29:45,817 DEBUG [GA-EWSSyncUpThreadPool-Thread-10] wire.content (wire:83) - << "l version="1.0" encoding="utf-8"?>NoErrorIQBibWZnc2NjZXhzY2EwMS5hZHJvb3RxYS5ibW9nYy5uZXQQAAAAoXGZIpNymkuzscAwmJ3FDA==AQAAAHtb4C7DyZVFn/fjlV1+49l1Fwg
AAAAAAAE="
30 Apr 2010 20:29:45,818 DEBUG [GA-EWSSyncUpThreadPool-Thread-10] ews.EWSRoomManager (subscribeRoom:227) - Successfully subscribe to  room=[Cisco_Room4@cisco.com], Subs ID: IQBibWZnc2NjZXhzY2EwMS5hZHJvb3RxYS5ibW9nYy5uZXQQAAAAoXGZIpNymkuzscAwmJ3FDA==


 

Inside EWS, Exchange will keep a table with all subscriptions, so when there is a new event triggered (i.e. a new scheduled meeting in Exchange),  Exchange EWS service will notify immediately to its clients (in this case CTS-Man) by using the following URL: 

http://CTS Manager hostname/adapters/services/NotificationService?wsdl

This URL is obtained from  field when we started Subscription in POST message described above. Above means that every time you schedule a Meeting in Exchange, this  meeting should appear intermediately in CTS-Man without manual intervention.


 
As you can see Exchange will open a new connection to CTM destination HTTP port 80, this is just a notification, even though communication is set to secure we will still use port 80 from Exchange to CTM, once this communication is successful, CTM will retrieve meeting information via SSL (secure
mode) or HTTP depending what is configured under Exchange tab.
 
In this case CTM will be listening port 80 for this new events, so we need a Firewall rule that opens communication from Exchange to CTM as following:

SRC IP address Exchange, SRC port RANDOM
DST IP address CTM,  DST port 80


Once they open this communication you can test it by using the above URL from Exchange server

http:// CTSManager hostname/adapters/services/NotificationService?wsdl


It is important that Exchange EWS is able to resolve CTS-MAN hostname, this can prevent new meetings to be displayed in CTS-Man hence, in IP Phone. this can be achieved by configuring DNS or static hosts entries in hosts files for Exchange server

This can cause Warnings and after several attempts Errors in Event Viewer for Exchange server

Event Type:    Warning
Event Source:    MSExchange Web Services
Event Category:    Core
Event ID:    6
Date:        12/19/2009
Time:        5:05:24 PM
User:        N/A
Computer:    CAS1
Description:
Unable to send a notification for subscription HABkYy1jYXMxLmJvc3RvbnByb3BlcnRpZXMuY29tEAAAAJTMWGDbMvhOvs2P6CGieDg=. (Send attempts: 5)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.



Event Type:    Error

Event Source:    MSExchange Web Services
Event Category:    Core
Event ID:    7
Date:        12/19/2009
Time:        5:06:40 PM
User:        N/A
Computer:    CAS1
Description:
After 7 unsuccessful attempts to send a notification for subscription HABkYy1jYXMxLmJvc3RvbnByb3BlcnRpZXMuY29tEAAAAPQCTI/hbxVGnY2yTl5DBdU=, subscription has been removed.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

No comments:

Post a Comment