src/api/ChannelsAPI.js
/**
   * POST /channels/create
   *
   * Create a channel and place it into a stasis application. This is similiar
   * to originate except the created channel is not dialed. This allows for an
   * application writer to create a channel and perform manipulations to it
   * prior to performing dial on the channel.
   *
   * *API available since Asterisk 14.0*
   *
   * @param {object} params
   * @param {string} params.endpoint The endpoint for channel communication.
   * @param {string} params.app The stasis application to place the channel into.
   * @param {string} [params.appArgs] The application arguments to pass to the
   *  stasis application.
   * @param {string} [params.channelId] The unique id to assign the channel on
   *  creation.
   * @param {string} [params.otherChannelId] The unique id to assign the second
   *  channel when using local channels.
   * @param {string} [params.originator] The unique ID of the calling channel.
   * @param {string|Array.<string>} [params.formats] The format name
   *  capability list to use if originator is not specified. For example,
   *  ['ulaw', 'slin16']. Format names can be found by executing the
   *  `core show codecs` command in the Asterisk console.
   * @returns {Promise.<Channel>} Resolves with the newly created channel.
   *  Rejects when invalid params are passed (status 400).
   */
POST /channels/create
Create a channel and place it into a stasis application. This is similiar
to originate except the created channel is not dialed. This allows for an
application writer to create a channel and perform manipulations to it
prior to performing dial on the channel.

*API available since Asterisk 14.0

@param {object} params
@param {string} params.endpoint The endpoint for channel communication.
@param {string} params.app The stasis application to place the channel into.
@param {string} [params.appArgs] The application arguments to pass to the
stasis application.
@param {string} [params.channelId] The unique id to assign the channel on
creation.
@param {string} [params.otherChannelId] The unique id to assign the second
channel when using local channels.
@param {string} [params.originator] The unique ID of the calling channel.
@param {string|Array.} [params.formats] The format name
capability list to use if originator is not specified.
POST / channels / create Create a channel and place it into a stasis application . This is similiar to originate except the created channel is not dialed . This allows for an application writer to create a channel and perform manipulations to it prior to performing dial on the channel . * API available since Asterisk 14 . 0 @param { object } params @param { string } params . endpoint The endpoint for channel communication . @param { string } params . app The stasis application to place the channel into . @param { string } [ params . appArgs ] The application arguments to pass to the stasis application . @param { string } [ params . channelId ] The unique id to assign the channel on creation . @param { string } [ params . otherChannelId ] The unique id to assign the second channel when using local channels . @param { string } [ params . originator ] The unique ID of the calling channel . @param { string|Array . } [ params . formats ] The format name capability list to use if originator is not specified .
create(params) {
    const {
      endpoint,
      app,
      appArgs,
      channelId,
      otherChannelId,
      originator,
      formats,
    } = params;
    return this._request({
      method: "POST",
      url: `${this._baseUrl}/channels/create`,
      params: {
        endpoint,
        app,
        appArgs,
        channelId,
        otherChannelId,
        originator,
        formats: [].concat(formats).join(","),
      },
    });
  }
create ( params ) { const { endpoint , app , appArgs , channelId , otherChannelId , originator , formats , } = params ; return this . _request ( { method : "POST" , url : ` ${ this . _baseUrl } ` , params : { endpoint , app , appArgs , channelId , otherChannelId , originator , formats : [ ] . concat ( formats ) . join ( "," ) , } , } ) ; }
POST /channels/create
 Create a channel and place it into a stasis application.
POST / channels / create Create a channel and place it into a stasis application .