private void JobSubmitRequestVoice_Click(object sender, EventArgs e) { //JobSubmitRequest Voice // setup Authentication objects EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Authentication EMAuthentication = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Authentication(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XDDSAuthType XDDSAuth = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XDDSAuthType(); // init Authentication objects XDDSAuth.Password = txtAccessCode.Text; XDDSAuth.RequesterID = txtUserId.Text; EMAuthentication.XDDSAuth = XDDSAuth; // Setup MessageObject EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType[] JS_Message = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType[1]; JS_Message[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.MessageType(); // Setup JobOptions - Voice and CRef EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobOptionsType JS_JobOptions = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobOptionsType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType JS_CRef = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceOptionsType JS_VoiceOptions = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceOptionsType(); // set CREF and Billing Code JS_CRef.Value = "Voice Job from Premiere Connect"; JS_JobOptions.CustomerReference = JS_CRef; // Set VoiceOptions JS_VoiceOptions.ANI = txtANI.Text; JS_VoiceOptions.VoiceDeliveryMethod = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceDeliveryMethodType.PAMD; JS_VoiceOptions.VoiceDeliveryMethodSpecified = true; JS_VoiceOptions.RecipientTimezoneOptionSpecified = false; // Set JobOptions as FaxOptions JS_JobOptions.VoiceOptions = JS_VoiceOptions; // Set Message Object JS_Message[0].JobOptions = JS_JobOptions; // Free Objects JS_JobOptions = null; JS_VoiceOptions = null; JS_CRef = null; // Setup Documents EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType[] JS_Documents = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType[1]; JS_Documents[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocumentType(); // Setup reusable variables for the document EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocDataType DocData = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocDataType(); string File; // Setup Document 1 - WAV File to be delivered via phone File = ReadAndEncodedFile(txtWAVFile.Text, true); DocData.format = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.DocEncodingFormat.base64; DocData.Value = File; JS_Documents[0].Item = DocData; EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType myFileName = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.EncodableStringType(); myFileName.Value = "message.wav"; JS_Documents[0].Filename = myFileName; JS_Documents[0].DocType = "WAV"; JS_Documents[0].CharacterSet = "UTF-8"; JS_Documents[0].ItemElementName = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ItemChoiceType.DocData; JS_Documents[0].@ref = "WAVMessage"; DocData = null; // Setup Content EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType[] JS_Content = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType[1]; JS_Content[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.ContentPartType(); JS_Content[0].Item = "WAVMessage"; JS_Content[0].Treatment = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.TreatmentType.voice_all; JS_Content[0].TreatmentSpecified = true; // Setup Destination EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceType[] delivery = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceType[1]; delivery[0] = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.VoiceType(); delivery[0].Phone = txtPhoneNumber.Text; delivery[0].@ref = "Phone Number Entered"; JS_Message[0].Contents = JS_Content; JS_Message[0].Destinations = delivery; JS_Message[0].MessageId = System.Environment.MachineName + DateTime.Now; JS_Content = null; // setup EMsgAPI object - EM EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XOA EM = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.XOA(); // Setup Request and JobSubmitRequest object EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Request Request = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Request(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Response Response = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.Response(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitRequest JS_Request = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitRequest(); EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitResult JS_Result = new EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.JobSubmitResult(); // Everything is Setup Prepare to Launch Job // First check to see if we need to setup proxy Set_Server_and_Proxy(EM); // Setup Reqeust Object Request.ReceiverKey = EM.Url; Request.Authentication = EMAuthentication; Request.ResultRequired = EMsgAPI_Demo.EMsgAPI_JobSubmit_200907.RequiredType.yes; Request.ResponseRequiredSpecified = true; // Assign Reqeust and Response objects to EM Object EM.RequestValue = Request; EM.ResponseValue = Response; JS_Request.Message = JS_Message; JS_Request.DocumentSet = JS_Documents; try { JS_Result = EM.JobSubmit(JS_Request); } catch (Exception ex) { System.Console.WriteLine(ex.Message); System.Console.Read(); return; } if (JS_Result.Status.StatusCode != null) { string JobNumber; JobNumber = JS_Result.MessageResult[0].JobId.XDN + ":" + JS_Result.MessageResult[0].JobId.MRN; txtJobNumber.Text = JobNumber; } }