Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectivityOptions" /> 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="dynamicFlags">List of function names (or &#39;zone&#39;) that are called on the Call record to populate the &#39;flags&#39; array sent to the resource(s) for matching.</param>
 /// <param name="emergencyCallerId">emergencyCallerId.</param>
 /// <param name="enabled">Is the server ready for sending and receiving calls (default to true).</param>
 /// <param name="failover">failover.</param>
 /// <param name="flags">List of flags to use when matching resources to route the call.</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="huntAccountId">When using local resources, use this account instead of the account making the call (useful for resellers).</param>
 /// <param name="huntNonReconcilable">Whether to allow routing to continue on a non-reconcilable TO number (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="ip">IP (sip) address for this device.</param>
 /// <param name="mediaHandling">Determine whether the switch should be in the media path or not (default to MediaHandlingEnum.Bypass).</param>
 /// <param name="port">Port to send SIP traffic for the remote device.</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 ConnectivityOptions(ConnectivityOptionsCallerId callerId = default(ConnectivityOptionsCallerId), int?delay = default(int?), List <string> dynamicFlags = default(List <string>), ConnectivityAccountCallerId emergencyCallerId = default(ConnectivityAccountCallerId), bool?enabled = true, ConnectivityOptionsFailover failover = default(ConnectivityOptionsFailover), List <string> flags = default(List <string>), bool?forceOutbound = false, string huntAccountId = default(string), bool?huntNonReconcilable = false, bool?ignoreEarlyMedia = default(bool?), InboundFormatEnum?inboundFormat = InboundFormatEnum.Npan, string ip = default(string), MediaHandlingEnum?mediaHandling = MediaHandlingEnum.Bypass, int?port = default(int?), int?progressTimeout = default(int?), List <Object> sipHeaders = default(List <Object>), int?timeout = default(int?))
 {
     this.CallerId          = callerId;
     this.Delay             = delay;
     this.DynamicFlags      = dynamicFlags;
     this.EmergencyCallerId = emergencyCallerId;
     // use default value if no "enabled" provided
     if (enabled == null)
     {
         this.Enabled = true;
     }
     else
     {
         this.Enabled = enabled;
     }
     this.Failover = failover;
     this.Flags    = flags;
     // use default value if no "forceOutbound" provided
     if (forceOutbound == null)
     {
         this.ForceOutbound = false;
     }
     else
     {
         this.ForceOutbound = forceOutbound;
     }
     this.HuntAccountId = huntAccountId;
     // use default value if no "huntNonReconcilable" provided
     if (huntNonReconcilable == null)
     {
         this.HuntNonReconcilable = false;
     }
     else
     {
         this.HuntNonReconcilable = huntNonReconcilable;
     }
     this.IgnoreEarlyMedia = ignoreEarlyMedia;
     // use default value if no "inboundFormat" provided
     if (inboundFormat == null)
     {
         this.InboundFormat = InboundFormatEnum.Npan;
     }
     else
     {
         this.InboundFormat = inboundFormat;
     }
     this.Ip = ip;
     // use default value if no "mediaHandling" provided
     if (mediaHandling == null)
     {
         this.MediaHandling = MediaHandlingEnum.Bypass;
     }
     else
     {
         this.MediaHandling = mediaHandling;
     }
     this.Port            = port;
     this.ProgressTimeout = progressTimeout;
     this.SipHeaders      = sipHeaders;
     this.Timeout         = timeout;
 }
Example #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;
 }