Skip to content

res_pjsip_maintenance: Add tests for PJSIP endpoint maintenance mode#128

Open
danieldonoghue wants to merge 1 commit intoasterisk:masterfrom
danieldonoghue:pjsip-maint
Open

res_pjsip_maintenance: Add tests for PJSIP endpoint maintenance mode#128
danieldonoghue wants to merge 1 commit intoasterisk:masterfrom
danieldonoghue:pjsip-maint

Conversation

@danieldonoghue
Copy link

Adds tests for the res_pjsip_maintenance module, which provides per- endpoint runtime maintenance mode via AMI and CLI.

inbound_rejection: enables maintenance mode on endpoint "alice" via the PJSIPSetMaintenance AMI action, then verifies that a new inbound INVITE is rejected with 503 Service Unavailable before reaching the dialplan.

ami_actions: verifies the full AMI control plane - PJSIPSetMaintenance emits a PJSIPMaintenanceStatus event with Status: enabled, which in turn triggers PJSIPShowMaintenance, confirming the list response and PJSIPMaintenanceStatusComplete are correctly produced.

outbound_blocking: enables maintenance mode on endpoint "alice" via PJSIPSetMaintenance, then fires an async AMI Originate to PJSIP/alice and verifies that OriginateResponse carries Response: Failure. No registered contact is required; the session_create supplement check in ast_sip_session_create_outgoing() fires before any contact or AOR lookup, so the origination is refused immediately without any SIP traffic being generated.

Development was assisted by Claude (Anthropic). All generated code has been reviewed, tested, and is understood by the author.

@danieldonoghue
Copy link
Author

cherry-pick-to: 23
cherry-pick-to: 22
cherry-pick-to: 20

@danieldonoghue
Copy link
Author

asterisk-test-pr: 1820

Adds tests for the res_pjsip_maintenance module, which provides per-
endpoint runtime maintenance mode via AMI and CLI.

inbound_rejection: enables maintenance mode on endpoint "alice" via the
PJSIPSetMaintenance AMI action, then verifies that a new inbound INVITE
is rejected with 503 Service Unavailable before reaching the dialplan.

ami_actions: verifies the full AMI control plane - PJSIPSetMaintenance
emits a PJSIPMaintenanceStatus event with Status: enabled, which in turn
triggers PJSIPShowMaintenance, confirming the list response and
PJSIPMaintenanceStatusComplete are correctly produced.

outbound_blocking: enables maintenance mode on endpoint "alice" via
PJSIPSetMaintenance, then fires an async AMI Originate to PJSIP/alice
and verifies that OriginateResponse carries Response: Failure.  No
registered contact is required; the session_create supplement check
in ast_sip_session_create_outgoing() fires before any contact or AOR
lookup, so the origination is refused immediately without any SIP
traffic being generated.

Development was assisted by Claude (Anthropic). All generated code has
been reviewed, tested, and is understood by the author.
@github-actions
Copy link

Workflow Check completed successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant