github.com/CyCoreSystems/ari@v4.8.4+incompatible/originate.go (about) 1 package ari 2 3 // OriginateRequest defines the parameters for the creation of a new Asterisk channel 4 type OriginateRequest struct { 5 6 // Endpoint is the name of the Asterisk resource to be used to create the 7 // channel. The format is tech/resource. 8 // 9 // Examples: 10 // 11 // - PJSIP/george 12 // 13 // - Local/party@mycontext 14 // 15 // - DAHDI/8005558282 16 Endpoint string `json:"endpoint"` 17 18 // Timeout specifies the number of seconds to wait for the channel to be 19 // answered before giving up. Note that this is REQUIRED and the default is 20 // to timeout immediately. Use a negative value to specify no timeout, but 21 // be aware that this could result in an unlimited call, which could result 22 // in a very unfriendly bill. 23 Timeout int `json:"timeout,omitempty"` 24 25 // CallerID specifies the Caller ID (name and number) to be set on the 26 // newly-created channel. This is optional but recommended. The format is 27 // `"Name" <number>`, but most every component is optional. 28 // 29 // Examples: 30 // 31 // - "Jane" <100> 32 // 33 // - <102> 34 // 35 // - 8005558282 36 // 37 CallerID string `json:"callerId,omitempty"` 38 39 // CEP (Context/Extension/Priority) is the location in the Asterisk dialplan 40 // into which the newly created channel should be dropped. All of these are 41 // required if the CEP is used. Exactly one of CEP or App/AppArgs must be 42 // specified. 43 Context string `json:"context,omitempty"` 44 Extension string `json:"extension,omitempty"` 45 Priority int64 `json:"priority,omitempty"` 46 47 // The Label is the string form of Priority, if there is such a label in the 48 // dialplan. Like CEP, Label may not be used if an ARI App is specified. 49 // If both Label and Priority are specified, Label will take priority. 50 Label string `json:"label,omitempty"` 51 52 // App specifies the ARI application and its arguments into which 53 // the newly-created channel should be placed. Exactly one of CEP or 54 // App/AppArgs is required. 55 App string `json:"app,omitempty"` 56 57 // AppArgs defines the arguments to supply to the ARI application, if one is 58 // defined. It is optional but only applicable for Originations which 59 // specify an ARI App. 60 AppArgs string `json:"appArgs,omitempty"` 61 62 // Formats describes the (comma-delimited) set of codecs which should be 63 // allowed for the created channel. This is an optional parameter, and if 64 // an Originator is specified, this should be left blank so that Asterisk 65 // derives the codecs from that Originator channel instead. 66 // 67 // Ex. "ulaw,slin16". 68 // 69 // The list of valid codecs can be found with Asterisk command "core show codecs". 70 Formats string `json:"formats,omitempty"` 71 72 // ChannelID specifies the unique ID to be used for the channel to be 73 // created. It is optional, and if not specified, a time-based UUID will be 74 // generated. 75 ChannelID string `json:"channelId,omitempty"` // Optionally assign channel id 76 77 // OtherChannelID specifies the unique ID of the second channel to be 78 // created. This is only valid for the creation of Local channels, which 79 // are always generated in pairs. It is optional, and if not specified, a 80 // time-based UUID will be generated (again, only if the Origination is of a 81 // Local channel). 82 OtherChannelID string `json:"otherChannelId,omitempty"` 83 84 // Originator is the channel for whom this Originate request is being made, if there is one. 85 // It is used by Asterisk to set the right codecs (and possibly other parameters) such that 86 // when the new channel is bridged to the Originator channel, there should be no transcoding. 87 // This is a purely optional (but helpful, where applicable) field. 88 Originator string `json:"originator,omitempty"` 89 90 // Variables describes the set of channel variables to apply to the new channel. It is optional. 91 Variables map[string]string `json:"variables,omitempty"` 92 }