channel method

Future<Channel> channel({
  1. String? endpoint,
  2. String? extension,
  3. String? context,
  4. String? priority,
  5. String? label,
  6. String? app,
  7. List<String>? appArgs,
  8. String? callerId,
  9. String? timeout,
  10. String? channelId,
  11. String? otherChannelId,
  12. String? originator,
  13. dynamic variables,
})

Implementation

Future<Channel> channel(
    {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,
    dynamic variables}) async {
  // print("application: $app");
  // print("endpoint: $app");
  var resp = await ChannelsApi.create(
      endpoint: endpoint,
      extension: extension,
      context: context,
      priority: priority,
      label: label,
      app: app,
      appArgs: appArgs,
      callerId: callerId,
      timeout: timeout,
      channelId: channelId,
      otherChannelId: otherChannelId,
      originator: originator,
      variables: variables);
  var channelJson;
  //resp.then((value) {
  //print(resp.resp);
  channelJson = json.decode(resp.resp);
  Channel channel = Channel.fromJson(channelJson);

  statisChannels[channel.id] = channel;

  return channel;
  //});
  //return null;
}