C# Class TropoCSharp.Tropo.Tropo

The main tropo class.
Exibir arquivo Open project: hack4reno/hack4reno2011 Class Usage Examples

Public Properties

Property Type Description
tropo ArrayList

Public Methods

Method Description
Tropo ( ) : System

Class constructor.

ask ( Ask ask ) : void

Overload for Ask that allows an Ask object to be passed.

ask ( int attempts, bool bargein, Choices choices, int minConfidence, string name, bool required, Say say, float timeout ) : void

Sends a prompt to the user and optionally waits for a response.

ask ( int attempts, bool bargein, Choices choices, int minConfidence, string name, bool required, Say say, float timeout, Array events ) : void

Overload method for Ask that allows an array of events to be used.

call ( ArrayList to ) : void

Overload for call that allows multiple calls to be made with one parmameter.

call ( ArrayList to, Endpoint from, string network, string channel, bool answerOnMedia, float timeout, Hashtable headers, StartRecording recording ) : void

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.

call ( Call call ) : void

Overload for call that allows a Call object to be passed.

call ( String to ) : void

Overload for Call that allows one parameter.

call ( String to, string from, string network, string channel, bool answerOnMedia, float timeout, Hashtable headers, StartRecording recording ) : void

Overload for Call that allows the To parameter to be passed as a String.

conference ( TropoCSharp.Tropo.Conference conference ) : void

Overload for Conference that allows a Conference object to be passed.

conference ( string id, bool mute, string name, bool playTones, bool required, string terminator ) : void

This object allows multiple lines in separate sessions to be conferenced together so that the parties on each line can talk to each other simultaneously. This is a voice channel only feature.

hangup ( ) : void

This function instructs Tropo to "hang-up" or disconnect the session associated with the current session.

message ( TropoCSharp.Tropo.Message message ) : void

Overload for Message that allows a Message object to be passed.

message ( Say say, ArrayList to, bool answerOnMedia, string channel, Endpoint from, string name, string network, bool required, float timeout ) : void

A shortcut method to create a session, say something, and hang up, all in one step. This is particularly useful for sending out a quick SMS or IM.

on ( On on ) : void

Overload for On that allows an On object to be passed.

on ( string @event, string next, Say say ) : void

Adds an event callback so that your application may be notified when a particular event occurs.

record ( TropoCSharp.Tropo.Record record ) : void

Overload for Record that allows a Record object to be passed.

record ( int attempts, bool bargein, bool beep, Choices choices, string format, float maxSilence, float maxTime, string method, string password, bool required, Say say, float timeout, TropoCSharp.Tropo.Transcription transcription, string username, string url ) : void

Overload for Record that allows a Transcription object to be passed.

record ( int attempts, bool bargein, bool beep, Choices choices, string format, float maxSilence, float maxTime, string method, string password, bool required, Say say, float timeout, string username, string url ) : void

Plays a prompt (audio file or text to speech) and optionally waits for a response from the caller that is recorded. If collected, responses may be in the form of DTMF or speech recognition using a simple grammar format defined below. The record funtion is really an alias of the prompt function, but one which forces the record option to true regardless of how it is (or is not) initially set. At the conclusion of the recording, the audio file may be automatically sent to an external server via FTP or an HTTP POST/Multipart Form. If specified, the audio file may also be transcribed and the text returned to you via an email address or HTTP POST/Multipart Form.

redirect ( ArrayList to, string name, bool required ) : void

The redirect function forwards an incoming call to another destination / phone number before answering it. The redirect function must be called before answer is called; redirect expects that a call be in the ringing or answering state. Use transfer when working with active answered calls.

redirect ( TropoCSharp.Tropo.Redirect redirect ) : void

Overload for Redirect that allow a Redirect object to be passed.

reject ( ) : void

Allows Tropo applications to reject incoming sessions before they are answered.

say ( Array says ) : void

Ooverload method for Say that allows an arrat of prompts to be used.

say ( Say say ) : void

Overload method for Say that allows a Say object to be passed directly.

say ( string @value ) : void

Overload method for Say that allows only a string value to be passed.

say ( string @value, string @as, string name, bool required ) : void

When the current session is a voice channel this key will either play a message or an audio file from a URL. In the case of an text channel it will send the text back to the user via i nstant messaging or SMS.

startRecording ( StartRecording startRecording ) : void

Overload for StartRecording that allows a a StartRecording object to be passed directly.

startRecording ( string format, string method, string url, string username, string password ) : void

Allows Tropo applications to begin recording the current session. The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form.

stopRecording ( ) : void

Stops a previously started recording.

transfer ( TropoCSharp.Tropo.Transfer transfer ) : void

Overload for Transfer that allows a Transfer object to be passed directly.

transfer ( bool answerOnMedia, Choices choices, Endpoint from, On on, int ringRepeat, float timeout, ArrayList to ) : void

Transfers an already answered call to another destination / phone number. Call may be transferred to another phone number or SIP address, which is set through the "to" parameter and is in URL format.

Private Methods

Method Description
serialize ( TropoBase action, string prefix ) : void

Method to serialize Tropo action objects and add to the base Tropo array.

Method Details

Tropo() public method

Class constructor.
public Tropo ( ) : System
return System

ask() public method

Overload for Ask that allows an Ask object to be passed.
public ask ( Ask ask ) : void
ask Ask An Ask object.
return void

ask() public method

Sends a prompt to the user and optionally waits for a response.
public ask ( int attempts, bool bargein, Choices choices, int minConfidence, string name, bool required, Say say, float timeout ) : void
attempts int How many times the caller can attempt input before an error is thrown.
bargein bool Should the user be allowed to barge in before TTS is complete?
choices Choices The grammar to use in recognizing and validating input.
minConfidence int How confident should Tropo be in a speech recognition match?
name string identifies the return value of an ask, so you know the context for the returned information.
required bool Is input required here?
say Say This determines what is played or sent to the caller.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
return void

ask() public method

Overload method for Ask that allows an array of events to be used.
public ask ( int attempts, bool bargein, Choices choices, int minConfidence, string name, bool required, Say say, float timeout, Array events ) : void
attempts int How many times the caller can attempt input before an error is thrown.
bargein bool Should the user be allowed to barge in before TTS is complete?
choices Choices The grammar to use in recognizing and validating input
minConfidence int How confident should Tropo be in a speech reco match?
name string Identifies the return value of an Ask, so you know the context for the returned information.
required bool Is input required here?
say Say This determines what is played or sent to the caller.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
events System.Array ??
return void

call() public method

Overload for call that allows multiple calls to be made with one parmameter.
public call ( ArrayList to ) : void
to ArrayList An ArryList containing recipients to call.
return void

call() public method

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.
public call ( ArrayList to, Endpoint from, string network, string channel, bool answerOnMedia, float timeout, Hashtable headers, StartRecording recording ) : void
to ArrayList An ArryList containing recipients to call.
from Endpoint An Endpoint object representing who the call is from.
network string 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.
channel string This defines the channel used to place new calls.
answerOnMedia bool 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
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
headers Hashtable This contains the Session Initiation Protocol (SIP) Headers for the current session.
recording StartRecording This is a shortcut to allow you to start call recording as soon as the call is answered.
return void

call() public method

Overload for call that allows a Call object to be passed.
public call ( Call call ) : void
call Call A Call object.
return void

call() public method

Overload for Call that allows one parameter.
public call ( String to ) : void
to String The number of the person to call.
return void

call() public method

Overload for Call that allows the To parameter to be passed as a String.
public call ( String to, string from, string network, string channel, bool answerOnMedia, float timeout, Hashtable headers, StartRecording recording ) : void
to String A String containing the recipient to call.
from string An Endpoint object representing who the call is from.
network string 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.
channel string This defines the channel used to place new calls.
answerOnMedia bool 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.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
headers Hashtable This contains the Session Initiation Protocol (SIP) Headers for the current session.
recording StartRecording This is a shortcut to allow you to start call recording as soon as the call is answered.
return void

conference() public method

Overload for Conference that allows a Conference object to be passed.
public conference ( TropoCSharp.Tropo.Conference conference ) : void
conference TropoCSharp.Tropo.Conference A Conference object.
return void

conference() public method

This object allows multiple lines in separate sessions to be conferenced together so that the parties on each line can talk to each other simultaneously. This is a voice channel only feature.
public conference ( string id, bool mute, string name, bool playTones, bool required, string terminator ) : void
id string This defines the id/name of the conference room to create.
mute bool Adds the user to the conference room with their audio muted.
name string Identifies the return value of a Conference, so you know the context for the returned information.
playTones bool This defines whether to send touch tone phone input to the conference or block the audio.
required bool Determines whether Tropo should move on to the next action.
terminator string This is the touch-tone key (also known as "DTMF digit") used to exit the conference.
return void

hangup() public method

This function instructs Tropo to "hang-up" or disconnect the session associated with the current session.
public hangup ( ) : void
return void

message() public method

Overload for Message that allows a Message object to be passed.
public message ( TropoCSharp.Tropo.Message message ) : void
message TropoCSharp.Tropo.Message A Message object.
return void

message() public method

A shortcut method to create a session, say something, and hang up, all in one step. This is particularly useful for sending out a quick SMS or IM.
public message ( Say say, ArrayList to, bool answerOnMedia, string channel, Endpoint from, string name, string network, bool required, float timeout ) : void
say Say This determines what is played or sent to the caller.
to ArrayList The destination to make a call to or send a message to.
answerOnMedia bool 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.
channel string This defines the channel used to place new calls.
from Endpoint An Endpoint object representing who the call is from.
name string Identifies the return value of a Message, so you know the context for the returned information.
network string 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.
required bool Determines whether Tropo should move on to the next action.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
return void

on() public method

Overload for On that allows an On object to be passed.
public on ( On on ) : void
on On An On object.
return void

on() public method

Adds an event callback so that your application may be notified when a particular event occurs.
public on ( string @event, string next, Say say ) : void
@event string
next string When an associated event occurs, Tropo will post to the URL defined here. If left blank, Tropo will simply hangup.
say Say This determines what is played or sent to the caller.
return void

record() public method

Overload for Record that allows a Record object to be passed.
public record ( TropoCSharp.Tropo.Record record ) : void
record TropoCSharp.Tropo.Record A Record object.
return void

record() public method

Overload for Record that allows a Transcription object to be passed.
public record ( int attempts, bool bargein, bool beep, Choices choices, string format, float maxSilence, float maxTime, string method, string password, bool required, Say say, float timeout, TropoCSharp.Tropo.Transcription transcription, string username, string url ) : void
attempts int How many times the caller can attempt input before an error is thrown.
bargein bool Should the user be allowed to barge in before TTS is complete?
beep bool When set to true, callers will hear a tone indicating the recording has begun.
choices Choices The grammar to use in recognizing and validating input.
format string This specifies the format for the audio recording.
maxSilence float The maximum amount of time, in seconds, to wait for silence after a user stops speaking.
maxTime float The maximum amount of time, in seconds, the user is allotted for input.
method string This defines how you want to send the audio file.
password string This identifies the FTP account password.
required bool Determines whether Tropo should move on to the next action.
say Say This determines what is played or sent to the caller.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
transcription TropoCSharp.Tropo.Transcription This allows you to submit a recording to be transcribed and specifies where to send the transcription.
username string This identifies the FTP account username.
url string This is the destination URL to send the recording.
return void

record() public method

Plays a prompt (audio file or text to speech) and optionally waits for a response from the caller that is recorded. If collected, responses may be in the form of DTMF or speech recognition using a simple grammar format defined below. The record funtion is really an alias of the prompt function, but one which forces the record option to true regardless of how it is (or is not) initially set. At the conclusion of the recording, the audio file may be automatically sent to an external server via FTP or an HTTP POST/Multipart Form. If specified, the audio file may also be transcribed and the text returned to you via an email address or HTTP POST/Multipart Form.
public record ( int attempts, bool bargein, bool beep, Choices choices, string format, float maxSilence, float maxTime, string method, string password, bool required, Say say, float timeout, string username, string url ) : void
attempts int How many times the caller can attempt input before an error is thrown.
bargein bool Should the user be allowed to barge in before TTS is complete?
beep bool When set to true, callers will hear a tone indicating the recording has begun.
choices Choices The grammar to use in recognizing and validating input.
format string This specifies the format for the audio recording.
maxSilence float The maximum amount of time, in seconds, to wait for silence after a user stops speaking.
maxTime float The maximum amount of time, in seconds, the user is allotted for input.
method string This defines how you want to send the audio file.
password string This identifies the FTP account password.
required bool Determines whether Tropo should move on to the next action.
say Say This determines what is played or sent to the caller.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
username string This identifies the FTP account username.
url string This is the destination URL to send the recording.
return void

redirect() public method

The redirect function forwards an incoming call to another destination / phone number before answering it. The redirect function must be called before answer is called; redirect expects that a call be in the ringing or answering state. Use transfer when working with active answered calls.
public redirect ( ArrayList to, string name, bool required ) : void
to ArrayList The SIP destination for the incoming call, as a URL.
name string Identifies the return value of a Redirect, so you know the context for the returned information.
required bool Determines whether Tropo should move on to the next action.
return void

redirect() public method

Overload for Redirect that allow a Redirect object to be passed.
public redirect ( TropoCSharp.Tropo.Redirect redirect ) : void
redirect TropoCSharp.Tropo.Redirect A Redirect object.
return void

reject() public method

Allows Tropo applications to reject incoming sessions before they are answered.
public reject ( ) : void
return void

say() public method

Ooverload method for Say that allows an arrat of prompts to be used.
public say ( Array says ) : void
says System.Array The prompts to say or send to the caller.
return void

say() public method

Overload method for Say that allows a Say object to be passed directly.
public say ( Say say ) : void
say Say A Say object.
return void

say() public method

Overload method for Say that allows only a string value to be passed.
public say ( string @value ) : void
@value string
return void

say() public method

When the current session is a voice channel this key will either play a message or an audio file from a URL. In the case of an text channel it will send the text back to the user via i nstant messaging or SMS.
public say ( string @value, string @as, string name, bool required ) : void
@value string
@as string
name string Identifies the return value of a Say, so you know the context for the returned information.
required bool Determines whether Tropo should move on to the next action.
return void

startRecording() public method

Overload for StartRecording that allows a a StartRecording object to be passed directly.
public startRecording ( StartRecording startRecording ) : void
startRecording StartRecording A StartRecording object.
return void

startRecording() public method

Allows Tropo applications to begin recording the current session. The resulting recording may then be sent via FTP or an HTTP POST/Multipart Form.
public startRecording ( string format, string method, string url, string username, string password ) : void
format string This specifies the format for the audio recording; it can be 'audio/wav' or 'audio/mp3'.
method string This defines how you want to send the audio file.
url string This is the destination URL to send the recording.
username string This identifies the FTP account username.
password string This identifies the FTP account password.
return void

stopRecording() public method

Stops a previously started recording.
public stopRecording ( ) : void
return void

transfer() public method

Overload for Transfer that allows a Transfer object to be passed directly.
public transfer ( TropoCSharp.Tropo.Transfer transfer ) : void
transfer TropoCSharp.Tropo.Transfer A Transfer object.
return void

transfer() public method

Transfers an already answered call to another destination / phone number. Call may be transferred to another phone number or SIP address, which is set through the "to" parameter and is in URL format.
public transfer ( bool answerOnMedia, Choices choices, Endpoint from, On on, int ringRepeat, float timeout, ArrayList to ) : void
answerOnMedia bool 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.
choices Choices The grammar to use in recognizing and validating input.
from Endpoint An Endpoint object representing who the call is from.
on On An On object.
ringRepeat int The number of rings to allow on the outbound call attempt.
timeout float The amount of time Tropo will wait, in seconds, after sending or playing the prompt for the user to begin a response.
to ArrayList The new destination for the incoming call as a URL.
return void

Property Details

tropo public_oe property

public ArrayList tropo
return ArrayList