Skip to content

[BUG] Stabilized attribute is being improperly set by StartTranscription #78

Closed
@jonathanminson

Description

@jonathanminson

Checklist

  • Have you provided a description of the bug?
  • Have you provided your Environment information?
  • Have you provided a sample code snippet?
  • Have you provided a stack trace?
  • Have you outlined the expected behavior?

Description

The stabilized attribute is improperly labeled as stability in StartTranscription.php. This results either in a failure to start a call or the attribute just being ignored by Bandwidth when the call is started.

Environment Information

All

Sample Code Snippet

public function stability(bool $stability): StartTranscription {
    $this->stability = $stability;
    return $this;
}

...

 if(isset($this->stability)) {
      $element->setattribute("stability", $this->stability);
  }

Stack Trace

# Stack Trace

N/A

Expected Behavior

Suggested Fix

To fix, add a proper stabilized setter. Leave the old one for backwards compatibility.

/**
 * Sets the stabilized attribute for StartTranscription. This remains for backwards compatibility.
 *
 * @param bool $stability Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true.
 * @deprecated Use stabilized() instead
 */
public function stability( bool $stability): StartTranscription {
    $this->stabilized = $stability;
    return $this;
}

/**
 * Sets the stabilized attribute for StartTranscription
 *
 * @param bool $stabilized Whether to send transcription update events to the specified destination only after they have become stable. Requires destination. Defaults to true.
 */
public function stabilized( bool $stabilized): StartTranscription {
    $this->stabilized = $stabilized;
    return $this;
}

Then, properly set the XML attribute:

if(isset($this->stabilized)) {
    $element->setattribute("stabilized", $this->stabilized ? 'true' : 'false');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions