Cisco Cisco TelePresence Management Suite (TMS) Version 15 Developer's Guide

Page of 66
Booking API Setup
The code snippet below demonstrates how to authenticate with Cisco TMSBA and specify the version.
public
 
void
 InitBookingService()
 {
     
// Specify username and password to authenticate to service. 
     
// (Can also be done in web.config) 
     
var
 credentials = 
new
 NetworkCredential(
Username
Password
Server
);
                                                                         
     bookingService = 
new
 BookingService(); 
  
bookingService.Credentials = credentials;
     
if
 (bookingService.ExternalAPIVersionSoapHeaderValue == 
null
)
     {
         bookingService.ExternalAPIVersionSoapHeaderValue = 
new
 BookingServiceWS.ExternalAPIVersionSoapHeader();
     }
     bookingService.ExternalAPIVersionSoapHeaderValue.ClientVersionIn = 16;
     bookingService.ExternalAPIVersionSoapHeaderValue.ClientSession = 
"clientSessionString"
          
 }
Using Different Participant Types
When using the API as a web reference, the participant types, such as "IP Video", "ISDN Video", and so on are 
created as enumerations called, for example, 
IPTel
IPTel1
. Values ending in 1 are dial-out, values not ending in 1 are 
dial-ins.
The code snippet below shows how to create a conference with three different participant types. An MCU is required 
for this call to be saved.
public
 
void
 SaveConferenceWithVariousParticipantTypes()
 {
     InitBookingService();
     
// Get a default conference object from TMS, where most common values are set
    
// (using default values specified in TMS)
     
var
 conference = bookingService.GetDefaultConference();
     
     
// Create and initialize an array of conference participants, and add it to the conference
     conference.Participants = 
new
[]
         {
             
new
 Participant
                 {
                     
// Adds a SIP Dial-in participant
                     NameOrNumber = 
"SIP Dial-in 1"
, ParticipantCallType = ParticipantType.SIP
                 },
             
new
 Participant
                 {
                     
// Adds a SIP Dial-out participant
                     NameOrNumber = 
"manager1@example.com"
, ParticipantCallType = ParticipantType.SIP1
                 },
             
new
 Participant
                 {
                     
// Adds a TMS participant (endpoint)
                     ParticipantCallType = ParticipantType.TMS, ParticipantId = 4
                 }
         };
 
     
// Save the conference, saving the returned conference (where all values are now specified)
     conference = bookingService.SaveConference(conference);
 
     PrintConferenceInformation(conference);
 }
58
Cisco TelePresence Management Suite Extension Booking API Programming Reference Guide