Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ type Channel interface {
// Answer answers the channel
Answer(key *Key) error

// Progress indicates progress on the channel
Progress(key *Key) error

// Hangup hangs up the given channel
Hangup(key *Key, reason string) error

Expand Down Expand Up @@ -397,6 +400,11 @@ func (ch *ChannelHandle) Answer() error {
return ch.c.Answer(ch.key)
}

// Progress indicates progress on the channel
func (ch *ChannelHandle) Progress() error {
return ch.c.Progress(ch.key)
}

// IsAnswered checks the current state of the channel to see if it is "Up"
func (ch *ChannelHandle) IsAnswered() (bool, error) {
updated, err := ch.Data()
Expand Down
5 changes: 5 additions & 0 deletions client/native/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ func (c *Channel) Answer(key *ari.Key) error {
return c.client.post("/channels/"+key.ID+"/answer", nil, nil)
}

// Progress indicates progress on the channel
func (c *Channel) Progress(key *ari.Key) error {
return c.client.post("/channels/"+key.ID+"/progress", nil, nil)
}

// Ring causes a channel to start ringing (TODO: does this return an error if already ringing?)
func (c *Channel) Ring(key *ari.Key) error {
return c.client.post("/channels/"+key.ID+"/ring", nil, nil)
Expand Down