Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TrunkstoreAccount" /> class.
 /// </summary>
 /// <param name="authRealm">The realm any device in the account will use to authenticate with (required).</param>
 /// <param name="callerId">callerId.</param>
 /// <param name="credits">credits (required).</param>
 /// <param name="emergencyCallerId">emergencyCallerId.</param>
 /// <param name="trunks">The number of two-way trunks this account has purchased (required).</param>
 public TrunkstoreAccount(string authRealm = default(string), TrunkstoreAccountCallerId callerId = default(TrunkstoreAccountCallerId), TrunkstoreAccountCredits credits = default(TrunkstoreAccountCredits), TrunkstoreAccountCallerId emergencyCallerId = default(TrunkstoreAccountCallerId), int?trunks = default(int?))
 {
     // to ensure "authRealm" is required (not null)
     if (authRealm == null)
     {
         throw new InvalidDataException("authRealm is a required property for TrunkstoreAccount and cannot be null");
     }
     else
     {
         this.AuthRealm = authRealm;
     }
     // to ensure "credits" is required (not null)
     if (credits == null)
     {
         throw new InvalidDataException("credits is a required property for TrunkstoreAccount and cannot be null");
     }
     else
     {
         this.Credits = credits;
     }
     // to ensure "trunks" is required (not null)
     if (trunks == null)
     {
         throw new InvalidDataException("trunks is a required property for TrunkstoreAccount and cannot be null");
     }
     else
     {
         this.Trunks = trunks;
     }
     this.CallerId          = callerId;
     this.EmergencyCallerId = emergencyCallerId;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TrunkstoreOptions" /> class.
 /// </summary>
 /// <param name="callerId">callerId.</param>
 /// <param name="delay">The time, in seconds, to wait before attempting to call the server.</param>
 /// <param name="enabled">Is the server ready for sending and receiving calls (default to true).</param>
 /// <param name="failover">failover.</param>
 /// <param name="forceOutbound">If true, will send the call over configured carriers instead of to the server (as opposed to the &#39;enabled&#39; flag, which will reject the calls) (default to false).</param>
 /// <param name="ignoreEarlyMedia">ignoreEarlyMedia.</param>
 /// <param name="inboundFormat">Determines how the INVITE is sent to the server (default to InboundFormatEnum.Npan).</param>
 /// <param name="mediaHandling">Determine whether the switch should be in the media path or not (default to MediaHandlingEnum.Bypass).</param>
 /// <param name="progressTimeout">The time, in seconds, to wait for the server to progress in the call, before trying an optionally defined failover route or terminating the call.</param>
 /// <param name="sipHeaders">List of arbitrary SIP headers to add to the INVITE.</param>
 /// <param name="timeout">The time, in seconds, to wait for an answer from the server.</param>
 public TrunkstoreOptions(TrunkstoreAccountCallerId callerId = default(TrunkstoreAccountCallerId), int?delay = default(int?), bool?enabled = true, ConnectivityOptionsFailover failover = default(ConnectivityOptionsFailover), bool?forceOutbound = false, bool?ignoreEarlyMedia = default(bool?), InboundFormatEnum?inboundFormat = InboundFormatEnum.Npan, MediaHandlingEnum?mediaHandling = MediaHandlingEnum.Bypass, int?progressTimeout = default(int?), List <Object> sipHeaders = default(List <Object>), int?timeout = default(int?))
 {
     this.CallerId = callerId;
     this.Delay    = delay;
     // use default value if no "enabled" provided
     if (enabled == null)
     {
         this.Enabled = true;
     }
     else
     {
         this.Enabled = enabled;
     }
     this.Failover = failover;
     // use default value if no "forceOutbound" provided
     if (forceOutbound == null)
     {
         this.ForceOutbound = false;
     }
     else
     {
         this.ForceOutbound = forceOutbound;
     }
     this.IgnoreEarlyMedia = ignoreEarlyMedia;
     // use default value if no "inboundFormat" provided
     if (inboundFormat == null)
     {
         this.InboundFormat = InboundFormatEnum.Npan;
     }
     else
     {
         this.InboundFormat = inboundFormat;
     }
     // use default value if no "mediaHandling" provided
     if (mediaHandling == null)
     {
         this.MediaHandling = MediaHandlingEnum.Bypass;
     }
     else
     {
         this.MediaHandling = mediaHandling;
     }
     this.ProgressTimeout = progressTimeout;
     this.SipHeaders      = sipHeaders;
     this.Timeout         = timeout;
 }