diff --git a/client/bridge.go b/client/bridge.go index 01d75f8..748fb3a 100644 --- a/client/bridge.go +++ b/client/bridge.go @@ -92,7 +92,6 @@ func (b *bridge) AddChannelWithOptions(key *ari.Key, channelID string, options * Role: options.Role, }, }) - } func (b *bridge) RemoveChannel(key *ari.Key, channelID string) error { @@ -130,6 +129,9 @@ func (b *bridge) StopMOH(key *ari.Key) error { } func (b *bridge) Play(key *ari.Key, id string, uri string) (*ari.PlaybackHandle, error) { + if id == "" { + id = rid.New(rid.Playback) + } k, err := b.c.createRequest(&proxy.Request{ Kind: "BridgePlay", Key: key, @@ -145,6 +147,9 @@ func (b *bridge) Play(key *ari.Key, id string, uri string) (*ari.PlaybackHandle, } func (b *bridge) StagePlay(key *ari.Key, id string, uri string) (*ari.PlaybackHandle, error) { + if id == "" { + id = rid.New(rid.Playback) + } k, err := b.c.getRequest(&proxy.Request{ Kind: "BridgeStagePlay", Key: key, diff --git a/client/channel.go b/client/channel.go index 1a458cf..2ec34f3 100644 --- a/client/channel.go +++ b/client/channel.go @@ -46,7 +46,6 @@ func (c *channel) Originate(referenceKey *ari.Key, o ari.OriginateRequest) (*ari } func (c *channel) StageOriginate(referenceKey *ari.Key, o ari.OriginateRequest) (*ari.ChannelHandle, error) { - if o.ChannelID == "" { o.ChannelID = rid.New(rid.Channel) } @@ -273,6 +272,10 @@ func (c *channel) Dial(key *ari.Key, caller string, timeout time.Duration) error } func (c *channel) Play(key *ari.Key, playbackID string, mediaURI string) (*ari.PlaybackHandle, error) { + if playbackID == "" { + playbackID = rid.New(rid.Playback) + } + k, err := c.c.createRequest(&proxy.Request{ Kind: "ChannelPlay", Key: key,