Allows Tropo applications to begin recording the current session.
Inheritance: TropoBase
Example #1
0
        /// <summary>
        /// Allows Tropo applications to begin recording the current session.
        /// The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form.
        /// </summary>
        /// <param name="format">This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        public void StartRecording(string format, string method, string url, string username, string password)
        {
            StartRecording startRecording = new StartRecording();

            startRecording.Format   = format;
            startRecording.Method   = method;
            startRecording.Url      = url;
            startRecording.Username = username;
            startRecording.Password = password;

            Serialize(startRecording, "startRecording");
        }
Example #2
0
        /// <summary>
        /// Allows Tropo applications to begin recording the current session.
        /// The transcription of this recording is then sent via HTTP POST/Multipart Form.
        /// </summary>
        /// <param name="format">This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        /// <param name="transcriptionID">The value that's included with your transcription when it's sent to your URL. This allows you to keep track of transcriptions; accepts a string..</param>
        /// <param name="transcriptionEmailFormat">The format of the email. Setting it as "encoded" will include a chunk of JSON in the email body or you can set it as "omit" to send as a human-readable message. It defaults to "omit", so unless you want JSON, this can be left out.</param>
        /// <param name="transcriptionOutURI">The address this transcription will be POSTed to; use a mailto: url to have the transcription emailed.</param>
        public void StartRecording(string format, string method, string url, string username, string password, string transcriptionID, string transcriptionEmailFormat, string transcriptionOutURI)
        {
            StartRecording startRecording = new StartRecording();

            startRecording.Format                   = format;
            startRecording.Method                   = method;
            startRecording.Url                      = url;
            startRecording.Username                 = username;
            startRecording.Password                 = password;
            startRecording.TranscriptionID          = transcriptionID;
            startRecording.TranscriptionEmailFormat = transcriptionEmailFormat;
            startRecording.TranscriptionOutURI      = transcriptionOutURI;

            Serialize(startRecording, "startRecording");
        }
        public void testCallUseAllOptions()
        {
            Tropo tropo = new Tropo();

            IDictionary<string, string> headers = new Dictionary<String, String>();
            headers.Add("foo", "bar");
            headers.Add("bling", "baz");

            StartRecording recording = new StartRecording(AudioFormat.Mp3, Method.Post, "http://blah.com/recordings/1234.wav", "jose", "password");

            tropo.Call("3055195825", "3055551212", Network.SMS, Channel.Text, false, 10, headers, recording);
            Assert.AreEqual(this.callJsonAllOptions, tropo.RenderJSON());
        }
Example #4
0
        /// <summary>
        /// Allows Tropo applications to begin recording the current session.
        /// The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form. 
        /// </summary>
        /// <param name="format">This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        public void StartRecording(string format, string method, string url, string username, string password)
        {
            StartRecording startRecording = new StartRecording();
            startRecording.Format = format;
            startRecording.Method = method;
            startRecording.Url = url;
            startRecording.Username = username;
            startRecording.Password = password;

            Serialize(startRecording, "startRecording");
        }
Example #5
0
 /// <summary>
 /// Overload for StartRecording that allows a a StartRecording object to be passed directly. 
 /// </summary>
 /// <param name="startRecording">A StartRecording object.</param>
 public void StartRecording(StartRecording startRecording)
 {
     StartRecording(startRecording.Format, startRecording.Method, startRecording.Url, startRecording.Username, startRecording.Password);
 }
Example #6
0
        /// <summary>
        /// Places a call or sends an an IM, Twitter, or SMS message. To start a call, use the Session API to tell Tropo to launch your code.
        /// </summary>
        /// <param name="to">The party(ies)to call.</param>
        /// <param name="from">A string representing who the call is from.</param>
        /// <param name="network">Network is used mainly by the text channels; values can be SMS when sending a text message, or a valid IM network name such as AIM, MSN, JABBER, YAHOO and GTALK.</param>
        /// <param name="channel">This defines the channel used to place new calls.</param>
        /// <param name="answerOnMedia">If this is set to true, the call will be considered "answered" and audio will begin playing as soon as media is received from the far end </param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="headers">This contains the Session Initiation Protocol (SIP) Headers for the current session.</param>
        /// <param name="recording">This is a shortcut to allow you to start call recording as soon as the call is answered. </param>      
        public void Call(IEnumerable<String> to, string from, string network, string channel, bool? answerOnMedia, float? timeout, IDictionary<String, String> headers, StartRecording recording)
        {
            Call call = new Call();
            call.To = to;
            call.From = from;
            call.Network = network;
            call.Channel = channel;
            call.AnswerOnMedia = answerOnMedia;
            call.Timeout = timeout;
            call.Headers = headers;
            call.Recording = recording;

            Serialize(call, "call");
        }
Example #7
0
        /// <summary>
        /// Overload for Call that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="to"></param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="from"></param>
        /// <param name="network"></param>
        /// <param name="channel"></param>
        /// <param name="answerOnMedia"></param>
        /// <param name="timeout"></param>
        /// <param name="headers"></param>
        /// <param name="recording"></param>
        public void Call(String to, Array allowSignals, string from, string network, string channel, bool? answerOnMedia, float? timeout, IDictionary<String, String> headers, StartRecording recording)
        {
            Call call = new Call
            {
                To = new List<String> { to },
                allowSignals = allowSignals,
                From = from,
                Network = network,
                Channel = channel,
                AnswerOnMedia = answerOnMedia,
                Timeout = timeout,
                Headers = headers,
                Recording = recording
            };

            Serialize(call, "call");
        }
Example #8
0
 /// <summary>
 /// Overload for StartRecording that allows a a StartRecording object to be passed directly.
 /// </summary>
 /// <param name="startRecording">A StartRecording object.</param>
 public void StartRecording(StartRecording startRecording)
 {
     StartRecording(startRecording.Format, startRecording.Method, startRecording.Url, startRecording.Username, startRecording.Password);
 }
        /// <summary>
        /// Allows Tropo applications to begin recording the current session.
        /// The transcription of this recording is then sent via HTTP POST/Multipart Form.
        /// </summary>
        /// <param name="format">This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        /// <param name="transcriptionID">The value that's included with your transcription when it's sent to your URL. This allows you to keep track of transcriptions; accepts a string..</param>
        /// <param name="transcriptionEmailFormat">The format of the email. Setting it as "encoded" will include a chunk of JSON in the email body or you can set it as "omit" to send as a human-readable message. It defaults to "omit", so unless you want JSON, this can be left out.</param>
        /// <param name="transcriptionOutURI">The address this transcription will be POSTed to; use a mailto: url to have the transcription emailed.</param>
        public void StartRecording(string format, string method, string url, string username, string password, string transcriptionID, string transcriptionEmailFormat, string transcriptionOutURI)
        {
            StartRecording startRecording = new StartRecording();
            startRecording.Format = format;
            startRecording.Method = method;
            startRecording.Url = url;
            startRecording.Username = username;
            startRecording.Password = password;
            startRecording.TranscriptionID = transcriptionID;
            startRecording.TranscriptionEmailFormat = transcriptionEmailFormat;
            startRecording.TranscriptionOutURI = transcriptionOutURI;

            Serialize(startRecording, "startRecording");
        }
        public void testCallUsingCallObject()
        {
            Tropo tropo = new Tropo();

            IDictionary<string, string> headers = new Dictionary<String, String>();
            headers.Add("foo", "bar");
            headers.Add("bling", "baz");

            StartRecording recording = new StartRecording(AudioFormat.Mp3, Method.Post, "http://blah.com/recordings/1234.wav", "jose", "password");

            List<String> to = new List<String>(1);
            to.Add("3055195825");

            Call call = new Call();
            call.Recording = recording;
            call.Headers = headers;
            call.Timeout = 10;
            call.AnswerOnMedia = false;
            call.Channel = Channel.Text;
            call.Network = Network.SMS;
            call.To = to;
            call.From = "3055551212";

            tropo.Call(call);
            Assert.AreEqual(this.callJsonAllOptions, tropo.RenderJSON());
        }
        public void testCallUsingCallObject()
        {
            Tropo tropo = new Tropo();

            Hashtable headers = new Hashtable();
            headers.Add("foo", "bar");
            headers.Add("bling", "baz");

            StartRecording recording = new StartRecording(AudioFormat.mp3, Method.post, "http://blah.com/recordings/1234.wav", "jose", "password");

            ArrayList to = new ArrayList(1);
            to.Add("3055195825");

            Call call = new Call();
            call.recording = recording;
            call.headers = headers;
            call.timeout = 10;
            call.answerOnMedia = false;
            call.channel = Channel.text;
            call.network = Network.sms;
            call.to = to;
            call.from = new Endpoint("3055551212", null, null, null);

            tropo.call(call);
            Assert.AreEqual(this.callJsonAllOptions, TropoJSON.render(tropo));
        }
Example #12
0
        /// <summary>
        /// Places a call or sends an an IM, Twitter, or SMS message. To start a call, use the Session API to tell Tropo to launch your code.
        /// </summary>
        /// <param name="to">The party(ies)to call.</param>
        /// <param name="from">A string representing who the call is from.</param>
        /// <param name="network">Network is used mainly by the text channels; values can be SMS when sending a text message, or a valid IM network name such as AIM, MSN, JABBER, YAHOO and GTALK.</param>
        /// <param name="channel">This defines the channel used to place new calls.</param>
        /// <param name="answerOnMedia">If this is set to true, the call will be considered "answered" and audio will begin playing as soon as media is received from the far end </param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="headers">This contains the Session Initiation Protocol (SIP) Headers for the current session.</param>
        /// <param name="recording">This is a shortcut to allow you to start call recording as soon as the call is answered. </param>
        public void Call(IEnumerable <String> to, string from, string network, string channel, bool?answerOnMedia, float?timeout, IDictionary <String, String> headers, StartRecording recording)
        {
            Call call = new Call();

            call.To            = to;
            call.From          = from;
            call.Network       = network;
            call.Channel       = channel;
            call.AnswerOnMedia = answerOnMedia;
            call.Timeout       = timeout;
            call.Headers       = headers;
            call.Recording     = recording;

            Serialize(call, "call");
        }
Example #13
0
        /// <summary>
        /// Overload for Call that allows events to be set via allowSignals.
        /// </summary>
        /// <param name="to"></param>
        /// <param name="allowSignals">Allows for the assignment of an interruptable signal for this Tropo function</param>
        /// <param name="from"></param>
        /// <param name="network"></param>
        /// <param name="channel"></param>
        /// <param name="answerOnMedia"></param>
        /// <param name="timeout"></param>
        /// <param name="headers"></param>
        /// <param name="recording"></param>
        public void Call(String to, Array allowSignals, string from, string network, string channel, bool?answerOnMedia, float?timeout, IDictionary <String, String> headers, StartRecording recording)
        {
            Call call = new Call
            {
                To = new List <String> {
                    to
                },
                allowSignals  = allowSignals,
                From          = from,
                Network       = network,
                Channel       = channel,
                AnswerOnMedia = answerOnMedia,
                Timeout       = timeout,
                Headers       = headers,
                Recording     = recording
            };

            Serialize(call, "call");
        }
Example #14
0
 /// <summary>
 /// Overload for StartRecording that allows a a StartRecording object to be passed directly. 
 /// </summary>
 /// <param name="startRecording">A StartRecording object.</param>
 public void startRecording(StartRecording startRecording)
 {
     this.startRecording(startRecording.format, startRecording.method, startRecording.url, startRecording.username, startRecording.password);
 }
Example #15
0
        /// <summary>
        /// Allows Tropo applications to begin recording the current session.
        /// The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form. 
        /// </summary>
        /// <param name="format">This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.</param>
        /// <param name="method">This defines how you want to send the audio file.</param>
        /// <param name="url">This is the destination URL to send the recording.</param>
        /// <param name="username">This identifies the FTP account username.</param>
        /// <param name="password">This identifies the FTP account password.</param>
        public void startRecording(string format, string method, string url, string username, string password)
        {
            StartRecording startRecording = new StartRecording();
            startRecording.format = format;
            startRecording.method = method;
            startRecording.url = url;
            startRecording.username = username;
            startRecording.password = password;

            serialize(startRecording, "startRecording");
        }
Example #16
0
        /// <summary>
        /// Overload for Call that allows the To parameter to be passed as a String.
        /// </summary>
        /// <param name="to">A String containing the recipient to call.</param>
        /// <param name="from">An Endpoint object representing who the call is from.</param>
        /// <param name="network">Network is used mainly by the text channels; values can be SMS when sending a text message, or a valid IM network name such as AIM, MSN, JABBER, YAHOO and GTALK.</param>
        /// <param name="channel">This defines the channel used to place new calls.</param>
        /// <param name="answerOnMedia">If this is set to true, the call will be considered "answered" and audio will begin playing as soon as media is received from the far end.</param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="headers">This contains the Session Initiation Protocol (SIP) Headers for the current session.</param>
        /// <param name="recording">This is a shortcut to allow you to start call recording as soon as the call is answered. </param>      
        public void call(String to, string from, string network, string channel, bool? answerOnMedia, float? timeout, Hashtable headers, StartRecording recording)
        {
            Call call = new Call();
            ArrayList _to = new ArrayList();
            _to.Add(to);
            call.to = _to;
            call.from = new Endpoint(from, null, null, null);
            call.network = network;
            call.channel = channel;
            call.answerOnMedia = answerOnMedia;
            call.timeout = timeout;
            call.headers = headers;
            call.recording = recording;

            serialize(call, "call");
        }
Example #17
0
        /// <summary>
        /// Places a call or sends an an IM, Twitter, or SMS message. To start a call, use the Session API to tell Tropo to launch your code.
        /// </summary>
        /// <param name="to">An ArryList containing recipients to call.</param>
        /// <param name="from">An Endpoint object representing who the call is from.</param>
        /// <param name="network">Network is used mainly by the text channels; values can be SMS when sending a text message, or a valid IM network name such as AIM, MSN, JABBER, YAHOO and GTALK.</param>
        /// <param name="channel">This defines the channel used to place new calls.</param>
        /// <param name="answerOnMedia">If this is set to true, the call will be considered "answered" and audio will begin playing as soon as media is received from the far end </param>
        /// <param name="timeout">The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.</param>
        /// <param name="headers">This contains the Session Initiation Protocol (SIP) Headers for the current session.</param>
        /// <param name="recording">This is a shortcut to allow you to start call recording as soon as the call is answered. </param>      
        public void call(ArrayList to, Endpoint from, string network, string channel, bool? answerOnMedia, float? timeout, Hashtable headers, StartRecording recording)
        {
            Call call = new Call();
            call.to = to;
            call.from = from;
            call.network = network;
            call.channel = channel;
            call.answerOnMedia = answerOnMedia;
            call.timeout = timeout;
            call.headers = headers;
            call.recording = recording;

            serialize(call, "call");
        }
        public void testNewStartRecordingObject()
        {
            StartRecording startRecording = new StartRecording();
            startRecording.format = AudioFormat.mp3;
            startRecording.method = Method.post;
            startRecording.url = "http://blah.com/recordings/1234.wav";
            startRecording.username = "******";
            startRecording.password = "******";

            Tropo tropo = new Tropo();
            tropo.startRecording(startRecording);

            Assert.AreEqual(this.startRecordingJson, TropoJSON.render(tropo));
        }
        public void testNewStartRecordingObject()
        {
            StartRecording startRecording = new StartRecording();
            startRecording.Format = AudioFormat.Mp3;
            startRecording.Method = Method.Post;
            startRecording.Url = "http://blah.com/recordings/1234.wav";
            startRecording.Username = "******";
            startRecording.Password = "******";

            Tropo tropo = new Tropo();
            tropo.StartRecording(startRecording);

            Assert.AreEqual(this.startRecordingJson, tropo.RenderJSON());
        }
        public void testCallUseAllOptions()
        {
            Tropo tropo = new Tropo();

            Hashtable headers = new Hashtable(2);
            headers.Add("foo", "bar");
            headers.Add("bling", "baz");

            StartRecording recording = new StartRecording(AudioFormat.mp3, Method.post, "http://blah.com/recordings/1234.wav", "jose", "password");

            tropo.call("3055195825", "3055551212", Network.sms, Channel.text, false, 10, headers, recording);
            Assert.AreEqual(this.callJsonAllOptions, TropoJSON.render(tropo));
        }