Add paused and wrapupTime fields to static member config lines#1
Merged
Conversation
Asterisk's member => line accepts these as the 6th/7th positional fields after ringinuse. Needed by core so linear-strategy static members (delivered as flat-file lines, not realtime queue_members rows) can still carry their paused state.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Clearvox\Asterisk\Queue\Member value object to support emitting Asterisk static queue member config lines with the additional trailing positional fields wrapuptime and paused, enabling linear-strategy queues to preserve member pause state without relying on realtime DB tables.
Changes:
- Added
wrapupTimeandpausedproperties plus constructor params and accessors onMember. - Updated
Member::toString()to output up to 7 positional fields (interface,penalty,membername,state_interface,ringinuse,wrapuptime,paused) using cascading null placeholders to preserve field positions. - Extended
MemberTestwith additionaltoString()assertions for paused-related output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Clearvox/Asterisk/Queue/Member.php | Adds wrapupTime/paused support and extends toString() to emit correct positional fields for Asterisk static member lines. |
| tests/Clearvox/Asterisk/Queue/MemberTest.php | Adds test cases validating the new paused output and the full 7-field serialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
setPaused() cast every input to bool, so setPaused(null) silently became setPaused(false) instead of unsetting the field like the constructor's $paused = null does. Also adds the wrapupTime-only cascading-null case flagged as untested.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/Clearvox/Asterisk/Queue/Member.php:151
- setWrapupTime() assigns the raw input to $this->wrapupTime, which can diverge from the constructor’s behavior (constructor casts non-null to int). This makes getWrapupTime()/toString() potentially return/emit non-integers despite the @param/@return docs stating int|null. Consider mirroring the constructor logic by casting non-null values to int (and preserving null to unset).
public function setWrapupTime($wrapupTime)
{
$this->wrapupTime = $wrapupTime;
return $this;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Core (
clearvox/core) is reverting linear-strategy queue ring order from a penalty encoding to ordered flat-filemember =>lines (see core#3488). Those lines bypass Asterisk's realtimequeue_memberstable entirely for linear queues, which is where the member'spausedstate used to be written from.Asterisk's static member line supports
pausedas an optional positional field (afterringinuseandwrapuptime), but thisMembervalue object had no way to set it.What changed
$wrapupTimeand$pausedconstructor params + getters/setters toMember.toString()to emit them as the correct trailing positional fields, following the existing cascading-null pattern (a later field forces every field before it to be emitted, even empty, to keep position). Existing 5-field behavior is unchanged when the new fields are left unset.reload_single_member()parsing):interface,penalty,membername,state_interface,ringinuse,wrapuptime,paused.Tests
Extended
MemberTest: paused-only, paused-false, and all-7-fields cases. Also hand-verified the exact output strings by running the class directly under PHP 8.2 (this package's PHPUnit ~4.0 doesn't run there) — all match expected Asterisk config syntax.