From 31f3f588f5f4753c30739e497d55fe9cb5ac3d7b Mon Sep 17 00:00:00 2001 From: virgilio-a-cunha-alb Date: Thu, 6 Nov 2025 16:44:52 +0000 Subject: [PATCH] Added Progress method to channels --- channel.go | 8 ++++++++ client/native/channel.go | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/channel.go b/channel.go index ed139ca..0ac3263 100644 --- a/channel.go +++ b/channel.go @@ -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 @@ -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() diff --git a/client/native/channel.go b/client/native/channel.go index 180d353..0de6082 100644 --- a/client/native/channel.go +++ b/client/native/channel.go @@ -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)