src/api/ChannelsAPI.js
/**
   * POST /channels/{channelId}/redirect
   *
   * Redirect the channel to a different location.
   *
   * *API available since Asterisk 13.3*
   *
   * @param {object} params
   * @param {string} params.channelId The id of the channel to redirect.
   * @param {string} params.endpoint The endpoint to redirect the channel to.
   * @returns {Promise} Resolves when the redirect is successful. Rejects when
   *  the endpoint param is not provided (status 400), the specified channel
   *  or endpoint is not found (status 404), the specified channel is not in
   *  a stasis application (status 409), or the specified endpoint is not the
   *  same type as the channel (status 422).
   */
POST /channels/{channelId}/redirect
Redirect the channel to a different location.

*API available since Asterisk 13.3

@param {object} params
@param {string} params.channelId The id of the channel to redirect.
@param {string} params.endpoint The endpoint to redirect the channel to.
@returns {Promise} Resolves when the redirect is successful. Rejects when
the endpoint param is not provided (status 400), the specified channel
or endpoint is not found (status 404), the specified channel is not in
a stasis application (status 409), or the specified endpoint is not the
same type as the channel (status 422).
POST / channels / { channelId } / redirect Redirect the channel to a different location . * API available since Asterisk 13 . 3 @param { object } params @param { string } params . channelId The id of the channel to redirect . @param { string } params . endpoint The endpoint to redirect the channel to . @returns { Promise } Resolves when the redirect is successful . Rejects when the endpoint param is not provided ( status 400 ) the specified channel or endpoint is not found ( status 404 ) the specified channel is not in a stasis application ( status 409 ) or the specified endpoint is not the same type as the channel ( status 422 ) .
redirect(params) {
    const { channelId, endpoint } = params;
    const id = encodeURIComponent(channelId);
    return this._request({
      method: "POST",
      url: `${this._baseUrl}/channels/${id}/redirect`,
      params: { endpoint },
    });
  }
redirect ( params ) { const { channelId , endpoint } = params ; const id = encodeURIComponent ( channelId ) ; return this . _request ( { method : "POST" , url : ` ${ this . _baseUrl } ${ id } ` , params : { endpoint } , } ) ; }
POST /channels/{channelId}/redirect
 Redirect the channel to a different location.
POST / channels / { channelId } / redirect Redirect the channel to a different location .