originate static method
Future
originate(
{ - String? endpoint,
- String? extension,
- String? context,
- String? priority,
- String? label,
- String? app,
- List<String>? appArgs,
- String? callerId,
- num? timeout,
- String? channelId,
- String? otherChannelId,
- String? originator,
})
Implementation
static Future<dynamic> originate(
{String? endpoint,
String? extension,
String? context,
String? priority,
String? label,
String? app,
List<String>? appArgs,
String? callerId,
num? timeout,
String? channelId,
String? otherChannelId,
String? originator}) async {
// params: {
// 'endpoint':,
// 'extension':,
// 'context':,
// 'priority':,
// 'label':,
// 'app':,
// 'appArgs':,
// 'callerId':,
// 'timeout':,
// 'channelId':,
// 'otherChannelId':,
// 'originator':,
// 'formats': [].concat(formats).join(","),
// },
// data: { variables },
var uri = Uri(
scheme: "http",
userInfo: "",
host: "10.44.0.55",
port: 8088,
path: "ari/channels",
//Iterable<String>? pathSegments,
query: "",
queryParameters: {
'api_key': api_key,
'endpoint': endpoint ?? "",
'extension': extension ?? "",
'context': context ?? "",
'priority': priority ?? "",
'label': label ?? "",
'app': app ?? "",
'appArgs': appArgs != null ? appArgs.join(",") : "",
'callerId': callerId ?? "",
'timeout': timeout ?? "",
'channelId': channelId ?? "",
'otherChannelId': otherChannelId ?? "",
'originator': originator ?? "",
}
//String? fragment
);
//dsvar uri = Uri.http(baseUrl, '/channels', qParams);
HttpClientRequest request = await client.postUrl(uri);
HttpClientResponse response = await request.close();
print(response);
final String stringData = await response.transform(utf8.decoder).join();
print(response.statusCode);
//print(stringData);
return (statusCode: response.statusCode, resp: stringData);
}