func (c *CallService) Redirect(sid string, u *url.URL) (*Call, error) {
	data := url.Values{}
	data.Set("Url", u.String())
	return c.Update(context.Background(), sid, data)
}
Redirect the given call to the given URL.
package twilio
import (
	"context"
	"encoding/json"
	"fmt"
	"net/url"
	"time"
	types "github.com/kevinburke/go-types"
)
const callsPathPart = "Calls"
type CallService struct {
	client *Client
}
type Call struct {
	Sid            string           `json:"sid"`
	From           PhoneNumber      `json:"from"`
	To             PhoneNumber      `json:"to"`
	Status         Status           `json:"status"`
	StartTime      TwilioTime       `json:"start_time"`
	EndTime        TwilioTime       `json:"end_time"`
	Duration       TwilioDuration   `json:"duration"`
	AccountSid     string           `json:"account_sid"`
	Annotation     json.RawMessage  `json:"annotation"`
	AnsweredBy     NullAnsweredBy   `json:"answered_by"`
	CallerName     types.NullString `json:"caller_name"`
	DateCreated    TwilioTime       `json:"date_created"`
	DateUpdated    TwilioTime       `json:"date_updated"`
	Direction      Direction        `json:"direction"`
	ForwardedFrom  PhoneNumber      `json:"forwarded_from"`
	GroupSid       string           `json:"group_sid"`
	ParentCallSid  string           `json:"parent_call_sid"`
	PhoneNumberSid string           `json:"phone_number_sid"`
	Price          string           `json:"price"`
	PriceUnit      string           `json:"price_unit"`
	APIVersion     string           `json:"api_version"`
	URI            string           `json:"uri"`
}
func (c *Call) Ended() bool {
	switch c.Status {
	case StatusCompleted, StatusCanceled, StatusFailed, StatusBusy, StatusNoAnswer:
		return true
	default:
		return false
	}
}
func (c *Call) EndedUnsuccessfully() bool {
	switch c.Status {
	case StatusCanceled, StatusFailed, StatusBusy, StatusNoAnswer:
		return true
	default:
		return false
	}
}
func (c *Call) FriendlyPrice() string {
	if c == nil {
		return ""
	}
	return price(c.PriceUnit, c.Price)
}
type CallPage struct {
	Page
	Calls []*Call `json:"calls"`
}
func (c *CallService) Get(ctx context.Context, sid string) (*Call, error) {
	call := new(Call)
	err := c.client.GetResource(ctx, callsPathPart, sid, call)
	return call, err
}
func (c *CallService) Update(ctx context.Context, sid string, data url.Values) (*Call, error) {
	call := new(Call)
	err := c.client.UpdateResource(ctx, callsPathPart, sid, data, call)
	return call, err
}
func (c *CallService) Cancel(sid string) (*Call, error) {
	data := url.Values{}
	data.Set("Status", string(StatusCanceled))
	return c.Update(context.Background(), sid, data)
}
func (c *CallService) Hangup(sid string) (*Call, error) {
	data := url.Values{}
	data.Set("Status", string(StatusCompleted))
	return c.Update(context.Background(), sid, data)
}