createWithId static method
Future
createWithId(
{ - String? endpoint,
- String? extension,
- String? context,
- String? priority,
- String? label,
- String? app,
- List<String>? appArgs,
- String? callerId,
- String? timeout,
- String? channelId,
- String? otherChannelId,
- String? originator,
})
Implementation
static Future<dynamic> createWithId(
{String? endpoint,
String? extension,
String? context,
String? priority,
String? label,
String? app,
List<String>? appArgs,
String? callerId,
String? timeout,
String? channelId,
String? otherChannelId,
String? originator}) async {
// var uri = Uri.http(baseUrl, '/channels/create', query: "",
// queryParameters: {
// 'api_key': api_key,
// 'endpoint': queryParams.endpoint,
// 'extension': queryParams.extension,
// 'context': queryParams.context,
// 'priority': queryParams.priority,
// 'label': queryParams.label,
// 'app': queryParams.app,
// 'appArgs': queryParams.appArgs,
// 'callerId': queryParams.callerId,
// 'timeout': queryParams.timeout,
// 'channelId': queryParams.channelId,
// 'otherChannelId': queryParams.otherChannelId,
// 'originator': queryParams.originator,
// });
var uri = Uri(
scheme: "http",
userInfo: "",
host: "10.44.0.55",
port: 8088,
path: 'ari/channels/create',
//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 ?? "",
});
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);
}