Exemplo n.º 1
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (From != null)
            {
                p.Add(new KeyValuePair <string, string>("From", From.ToString()));
            }

            if (To != null)
            {
                p.Add(new KeyValuePair <string, string>("To", To.ToString()));
            }

            if (StatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("StatusCallback", Serializers.Url(StatusCallback)));
            }

            if (StatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("StatusCallbackMethod", StatusCallbackMethod.ToString()));
            }

            if (StatusCallbackEvent != null)
            {
                p.AddRange(StatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("StatusCallbackEvent", prop)));
            }

            if (Label != null)
            {
                p.Add(new KeyValuePair <string, string>("Label", Label));
            }

            if (Timeout != null)
            {
                p.Add(new KeyValuePair <string, string>("Timeout", Timeout.ToString()));
            }

            if (Record != null)
            {
                p.Add(new KeyValuePair <string, string>("Record", Record.Value.ToString().ToLower()));
            }

            if (Muted != null)
            {
                p.Add(new KeyValuePair <string, string>("Muted", Muted.Value.ToString().ToLower()));
            }

            if (Beep != null)
            {
                p.Add(new KeyValuePair <string, string>("Beep", Beep));
            }

            if (StartConferenceOnEnter != null)
            {
                p.Add(new KeyValuePair <string, string>("StartConferenceOnEnter", StartConferenceOnEnter.Value.ToString().ToLower()));
            }

            if (EndConferenceOnExit != null)
            {
                p.Add(new KeyValuePair <string, string>("EndConferenceOnExit", EndConferenceOnExit.Value.ToString().ToLower()));
            }

            if (WaitUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("WaitUrl", Serializers.Url(WaitUrl)));
            }

            if (WaitMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("WaitMethod", WaitMethod.ToString()));
            }

            if (EarlyMedia != null)
            {
                p.Add(new KeyValuePair <string, string>("EarlyMedia", EarlyMedia.Value.ToString().ToLower()));
            }

            if (MaxParticipants != null)
            {
                p.Add(new KeyValuePair <string, string>("MaxParticipants", MaxParticipants.ToString()));
            }

            if (ConferenceRecord != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceRecord", ConferenceRecord));
            }

            if (ConferenceTrim != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceTrim", ConferenceTrim));
            }

            if (ConferenceStatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceStatusCallback", Serializers.Url(ConferenceStatusCallback)));
            }

            if (ConferenceStatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceStatusCallbackMethod", ConferenceStatusCallbackMethod.ToString()));
            }

            if (ConferenceStatusCallbackEvent != null)
            {
                p.AddRange(ConferenceStatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("ConferenceStatusCallbackEvent", prop)));
            }

            if (RecordingChannels != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingChannels", RecordingChannels));
            }

            if (RecordingStatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingStatusCallback", Serializers.Url(RecordingStatusCallback)));
            }

            if (RecordingStatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingStatusCallbackMethod", RecordingStatusCallbackMethod.ToString()));
            }

            if (SipAuthUsername != null)
            {
                p.Add(new KeyValuePair <string, string>("SipAuthUsername", SipAuthUsername));
            }

            if (SipAuthPassword != null)
            {
                p.Add(new KeyValuePair <string, string>("SipAuthPassword", SipAuthPassword));
            }

            if (Region != null)
            {
                p.Add(new KeyValuePair <string, string>("Region", Region));
            }

            if (ConferenceRecordingStatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceRecordingStatusCallback", Serializers.Url(ConferenceRecordingStatusCallback)));
            }

            if (ConferenceRecordingStatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("ConferenceRecordingStatusCallbackMethod", ConferenceRecordingStatusCallbackMethod.ToString()));
            }

            if (RecordingStatusCallbackEvent != null)
            {
                p.AddRange(RecordingStatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("RecordingStatusCallbackEvent", prop)));
            }

            if (ConferenceRecordingStatusCallbackEvent != null)
            {
                p.AddRange(ConferenceRecordingStatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("ConferenceRecordingStatusCallbackEvent", prop)));
            }

            if (Coaching != null)
            {
                p.Add(new KeyValuePair <string, string>("Coaching", Coaching.Value.ToString().ToLower()));
            }

            if (CallSidToCoach != null)
            {
                p.Add(new KeyValuePair <string, string>("CallSidToCoach", CallSidToCoach.ToString()));
            }

            if (JitterBufferSize != null)
            {
                p.Add(new KeyValuePair <string, string>("JitterBufferSize", JitterBufferSize));
            }

            if (Byoc != null)
            {
                p.Add(new KeyValuePair <string, string>("Byoc", Byoc.ToString()));
            }

            if (CallerId != null)
            {
                p.Add(new KeyValuePair <string, string>("CallerId", CallerId));
            }

            if (CallReason != null)
            {
                p.Add(new KeyValuePair <string, string>("CallReason", CallReason));
            }

            return(p);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Generate the necessary parameters
        /// </summary>
        public List <KeyValuePair <string, string> > GetParams()
        {
            var p = new List <KeyValuePair <string, string> >();

            if (To != null)
            {
                p.Add(new KeyValuePair <string, string>("To", To.ToString()));
            }

            if (From != null)
            {
                p.Add(new KeyValuePair <string, string>("From", From.ToString()));
            }

            if (Url != null)
            {
                p.Add(new KeyValuePair <string, string>("Url", Serializers.Url(Url)));
            }

            if (Twiml != null)
            {
                p.Add(new KeyValuePair <string, string>("Twiml", Twiml.ToString()));
            }

            if (ApplicationSid != null)
            {
                p.Add(new KeyValuePair <string, string>("ApplicationSid", ApplicationSid.ToString()));
            }

            if (Method != null)
            {
                p.Add(new KeyValuePair <string, string>("Method", Method.ToString()));
            }

            if (FallbackUrl != null)
            {
                p.Add(new KeyValuePair <string, string>("FallbackUrl", Serializers.Url(FallbackUrl)));
            }

            if (FallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("FallbackMethod", FallbackMethod.ToString()));
            }

            if (StatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("StatusCallback", Serializers.Url(StatusCallback)));
            }

            if (StatusCallbackEvent != null)
            {
                p.AddRange(StatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("StatusCallbackEvent", prop)));
            }

            if (StatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("StatusCallbackMethod", StatusCallbackMethod.ToString()));
            }

            if (SendDigits != null)
            {
                p.Add(new KeyValuePair <string, string>("SendDigits", SendDigits));
            }

            if (Timeout != null)
            {
                p.Add(new KeyValuePair <string, string>("Timeout", Timeout.ToString()));
            }

            if (Record != null)
            {
                p.Add(new KeyValuePair <string, string>("Record", Record.Value.ToString().ToLower()));
            }

            if (RecordingChannels != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingChannels", RecordingChannels));
            }

            if (RecordingStatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingStatusCallback", RecordingStatusCallback));
            }

            if (RecordingStatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("RecordingStatusCallbackMethod", RecordingStatusCallbackMethod.ToString()));
            }

            if (SipAuthUsername != null)
            {
                p.Add(new KeyValuePair <string, string>("SipAuthUsername", SipAuthUsername));
            }

            if (SipAuthPassword != null)
            {
                p.Add(new KeyValuePair <string, string>("SipAuthPassword", SipAuthPassword));
            }

            if (MachineDetection != null)
            {
                p.Add(new KeyValuePair <string, string>("MachineDetection", MachineDetection));
            }

            if (MachineDetectionTimeout != null)
            {
                p.Add(new KeyValuePair <string, string>("MachineDetectionTimeout", MachineDetectionTimeout.ToString()));
            }

            if (RecordingStatusCallbackEvent != null)
            {
                p.AddRange(RecordingStatusCallbackEvent.Select(prop => new KeyValuePair <string, string>("RecordingStatusCallbackEvent", prop)));
            }

            if (Trim != null)
            {
                p.Add(new KeyValuePair <string, string>("Trim", Trim));
            }

            if (CallerId != null)
            {
                p.Add(new KeyValuePair <string, string>("CallerId", CallerId));
            }

            if (MachineDetectionSpeechThreshold != null)
            {
                p.Add(new KeyValuePair <string, string>("MachineDetectionSpeechThreshold", MachineDetectionSpeechThreshold.ToString()));
            }

            if (MachineDetectionSpeechEndThreshold != null)
            {
                p.Add(new KeyValuePair <string, string>("MachineDetectionSpeechEndThreshold", MachineDetectionSpeechEndThreshold.ToString()));
            }

            if (MachineDetectionSilenceTimeout != null)
            {
                p.Add(new KeyValuePair <string, string>("MachineDetectionSilenceTimeout", MachineDetectionSilenceTimeout.ToString()));
            }

            if (AsyncAmd != null)
            {
                p.Add(new KeyValuePair <string, string>("AsyncAmd", AsyncAmd));
            }

            if (AsyncAmdStatusCallback != null)
            {
                p.Add(new KeyValuePair <string, string>("AsyncAmdStatusCallback", Serializers.Url(AsyncAmdStatusCallback)));
            }

            if (AsyncAmdStatusCallbackMethod != null)
            {
                p.Add(new KeyValuePair <string, string>("AsyncAmdStatusCallbackMethod", AsyncAmdStatusCallbackMethod.ToString()));
            }

            if (Byoc != null)
            {
                p.Add(new KeyValuePair <string, string>("Byoc", Byoc.ToString()));
            }

            if (CallReason != null)
            {
                p.Add(new KeyValuePair <string, string>("CallReason", CallReason));
            }

            return(p);
        }