Pnsamplecsharp

From CDYNE Wiki
Revision as of 17:55, 25 October 2011 by imported>Mbaughman (RecordSoundViaPhoneCall)
Jump to navigation Jump to search

getVoices

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           Voice[] voices = pn.getVoices();
           foreach (Voice item in voices)
           {
               Console.WriteLine(item.VoiceSummary.ToString());
           }
           Console.ReadKey(true);
       }
   }

}

UploadSoundFile

RecordSoundViaPhoneCall

NotifyPhoneEnglishBasic

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.NotifyReturn nr = pn.NotifyPhoneEnglishBasic("15555555555",
           "Hello, this is a test.","00000000-0000-0000-0000-000000000000");
       }
   }

}

NotifyPhoneBasic

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.NotifyReturn nr = pn.NotifyPhoneBasic("15555555555",
           "Hello, this is a test.", "1555555555", "Test Caller ID", "0", "0000000-0000-0000-0000-000000000000");
       }
   }

}

NotifyPhoneBasicWithTransfer

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.NotifyReturn nr = pn.NotifyPhoneBasicWithTransfer("15555555555","15555555555",
           "Hello, this is a test. Press 0 to be transfered to the TransferNumber",
           "15555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
       }
   }

}

NotifyPhoneBasicWithTryCount

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.NotifyReturn nr = pn.NotifyPhoneBasicWithTryCount(3,"15555555555",
           "Hello, this is a test.", "1555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
       }
   }

}

NotifyMultiplePhoneBasic

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.NotifyReturn[] nr = pn.NotifyMultiplePhoneBasic("15555555555; 15555555555",
           "Hello, This is a test.", "15555555555", "Test Caller ID", "0", "00000000-0000-0000-0000-000000000000");
       }
   }

}

NotifyPhoneAdvanced

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.AdvancedNotifyRequest anr = new pnweb.AdvancedNotifyRequest();
           anr.CallerIDName = "Test Caller ID";
           anr.CallerIDNumber = "15555555555";
           anr.PhoneNumberToDial = "15555555555";
           anr.TextToSay = "Hello, this is a test.";
           anr.LicenseKey = "00000000-0000-0000-0000-000000000000";
           anr.VoiceID = 0;
           anr.TryCount = 1;
           anr.NextTryInSeconds = 3600;
           anr.UTCScheduledDateTime = DateTime.UtcNow;
           pnweb.NotifyReturn response = pn.NotifyPhoneAdvanced(anr);
       }
   }

}

NotifyMultiplePhoneAdvanced

namespace phnotify {

   class Program
   {
       static void Main(string[] args)
       {
           pnweb.PhoneNotify pn = new pnweb.PhoneNotify();
           pnweb.AdvancedNotifyRequest anr = new pnweb.AdvancedNotifyRequest();
           anr.CallerIDName = "Test Caller ID";
           anr.CallerIDNumber = "15555555555";
           anr.PhoneNumberToDial = "15555555555; 15555555555; 15555555555";
           anr.TextToSay = "Hello, this is a test.";
           anr.LicenseKey = "00000000-0000-0000-0000-000000000000";
           anr.VoiceID = 0;
           anr.TryCount = 1;
           anr.NextTryInSeconds = 3600;
           anr.UTCScheduledDateTime = DateTime.UtcNow;
           pnweb.NotifyReturn response = pn.NotifyPhoneAdvanced(anr);
       }
   }

}