| Tropo WebAPI Development Guide | Home | Frameset Home |
| to | Data Type: String or Array | Default: (none) | Required |
The destination to make a call to or send a message to. This may currently take one of the following forms:
Some IM networks like Google Talk and Live Messenger include a domain as part of the user name. For those networks, include the domain: username@gmail.com When making a voice call, you can specify dialing options as part of the number:
You can also list multiple phone numbers or SIP addresses (or both!) as an array for a voice call; whichever destination picks up first, wins. | |||
| allowSignals | Data Type: String or Array | Default: * (any signal) | Optional |
| This parameter allows you to assign a signal to this function. Events from the Tropo REST API with a matching signal name will "interrupt" the function (i.e., stop it from running). If it already ran and completed, your interrupt request will be ignored. If the function has not run yet, the interrupt will be queued until it does run. By default, allowSignals will accept any signal as valid; if you define allowSignals as "", it defines the function as "uninterruptible". You can also use an array - the function will stop if it receives an interrupt signal matching any of the names in the array. | |||
| answerOnMedia | Data Type: Boolean | Default: false | Optional |
| 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 (ringing / busy signal / etc). | |||
| channel | Data Type: string | Default: voice | Optional |
| This defines the channel used to place new calls. For phone calls it is "VOICE", for SMS and instant messaging it is "TEXT". | |||
| from | Data Type: String | Default: (none) | Optional |
If multiple contact methods for a given network are attached to an application, this field allows you to specify which one it comes from. For example, if you have two phone numbers, setting this field would allow you to specify the caller ID that appears to the recipient. For voice calls, this can be any valid phone number; for SMS it needs to be a number assigned to your account. For IM, there's no need to set a specific value for from - it will always need to match the IM account associated with your application, which is what Tropo uses by default anyways. | |||
| headers | Data Type: Object | Default: "" (undefined) | Optional |
| This contains the Session Initiation Protocol (SIP) Headers for the current session. This is advanced network information. | |||
| name | Data Type: String | Default: "" (undefined) | Optional |
| This is the key used to identify the result of an operation, so you can differentiate between multiple results. As an example, if you asked the user for their favorite color, you could set the name value as 'color' while the returned value might be 'blue'. Not particularly useful if there's only one result returned, but if there are multiple results it helps to determine which result belonged to which operation. | |||
| network | Data Type: String | Default: "" (undefined) | Optional |
| The name of the network being used for this session. For voice, this can be 'PSTN", "SIP", "SKYPE" or "INUM". For text, this can be "AIM", "GTALK", "JABBER", "MSN", "SMS", "TWITTER" or "YAHOO". Note that SKYPE is not a valid value for outbound calls, it will only display if you're recording the network for an inbound call. Network is used mainly by the text channels; for IM network, you must have an IM account linked in your app. For example, if you try to send to AIM when you don't have an AIM username included in your app, your app will fail. TWITTER is a valid network, but as Twitter is currently only supported for inbound applications, it would not be used here. | |||
| recording | Data Type: Array or Object | Default: | Optional |
This is a shortcut to allow you to start call recording as soon as the call is answered. This parameter is only useful on voice calls and is ignored on text channels. Review the included example below:{"tropo":[
{
"call":{
"to":"+14075551212",
"recording":{"url":"http://example.com/recording.php"}
}
},
{
"ask":{
"say":{"value":"Please say your account number"},
"choices":{"value":"[5 DIGITS]"}
}
}
]
}
See startRecording for a complete list of properties. | |||
| required | Data Type: Boolean | Default: true | Optional |
| This determines whether Tropo should move on to the next verb; if required is set to 'true', Tropo will only move on to the next verb if the current operation completely successfully. | |||
| timeout | Data Type: Float | Default: 30.0 | Optional |
| The amount of time, in seconds, to wait for an answer before returning to the application. The maximum value for this parameter is 2 hours and it's recommended for outbound voice calls that this be set somewhere between 50-90 seconds. This ensures if one carrier cannot connect the call for whatever reason, there is time to try it on another carrier. | |||
{"tropo":[
{"call":{
"to":[
"+14155551212",
"+15105551212"
]}
},
{"say":[
{"value":"Hello, you were the first to answer."}
]}
]}
{"tropo":[
{"call":{
"to":"+14075550100",
"network":"SMS"
}
},
{"say":{"value":"Tag, you're it!"}}
]}
| ANNOTATIONS: EXISTING POSTS |
| login |