Skip to content

NethVoice: Off-hour voicemail fails after Macro-to-Gosub migration #8339

Closed
nethesis/ns8-nethvoice
#1267

Description

@Stell0

What happened

On NethVoice 1.8.3, a caller hears the off-hour announcement for a rule configured as “message and voicemail,” then the call ends before they can leave a message. The same flow was reported working on 1.7.14. The exact set of affected 1.8.x releases is unverified.

The Asterisk log shows the following after announcement playback (channel suffix omitted).

[offhour] Off-Hour active
[offhour] message and voicemail
AGI Script Executing Application: (Gosub) Options: (macro-vm,s,1(220,NOMESSAGE))
AGI Script offhour.php completed, returning 4
Spawn extension (macro-vm, s, 0) exited non-zero

How to reproduce

  1. Enable an off-hour rule on an inbound route and select “message and voicemail.”
  2. Choose an announcement and an enabled mailbox such as 220.
  3. Call the inbound route while the rule is active and listen through the announcement.

The call should play the announcement once, let the caller record a message, and then end.

Initial investigation

The Asterisk 22 migration in nethesis/ns8-nethvoice@68b47df2 changed this AGI from EXEC Macro to EXEC Gosub. Asterisk 22.10.0 source shows that the dialplan Gosub application updates the next dialplan location. The AGI EXEC handler returns that application's result immediately, so the script's following HANGUP can run while the channel is still at the new location's preceding priority (0). The dedicated AGI GOSUB command runs the target dialplan before sending its final response. AGI result 4 means Asterisk detected a channel hangup during the AGI session. That code alone does not identify who ended the call.

Adding exit(0) after EXEC Gosub was suggested as an unverified workaround. Its behavior needs checking for a returning subroutine and a missing destination, as well as for normal voicemail.

Asterisk 22.10.0 AGI source · Gosub implementation

See also
https://mattermost.nethesis.it/nethesis/pl/8icxaoy7efndtxnenk3mczusuw

Activity

  1. added this to the NethVoice 1.8 milestone on Nov 19, 2026
  2. added
    nethvoice
    on Nov 19, 2026
  3. added theissue type on Nov 19, 2026
  4. added
    testing
    on Nov 20, 2026
  5. edospadoni commented on Nov 20, 2026

    @edospadoni
    Member

    Test

    PRs: nethesis/ns8-nethvoice#1267

    Setup: an inbound route (DID) with an off-hour rule set to "message and voicemail", an announcement and an enabled mailbox (e.g. 201). Follow /var/log/asterisk/full inside the freepbx container during the calls.

    Test Case 1 - Off-hour message and voicemail

    • Call the DID while the off-hour rule is active: the announcement plays once, then the voicemail greeting starts
    • Leave a message and hang up: the message is in the mailbox (CTI / phone voicemail / *98)
    • The log shows Goto (nethvoice-offhour-voicemail,s,1) followed by VoiceMail(201@default,s), no exited non-zero right after the AGI
    • No channel stays up after the caller hangs up (asterisk -rx "core show channels")

    Test Case 2 - Regression

    • Off-hour rule set to "message only": the announcement plays and the call ends
    • Off-hour rule set to another destination (extension, queue, IVR): the call reaches it
    • Off-hour rule not active: the call follows the normal inbound route destination
    • Voicemail reached in the normal way (busy/no answer on an extension) still works

    Testing release: 1.8.5-testing.53 (nethesis/ns8-nethvoice#1267, nethesis/ns8-nethvoice#1268)

    ghcr.io/nethesis/nethvoice:1.8.5-testing.53
    
    api-cli run update-module --data '{"module_url":"ghcr.io/nethesis/nethvoice:1.8.5-testing.53","instances":["nethvoiceX"],"force":true}'
    
  6. moved this from Todo to Testing in NethVoiceon Nov 20, 2026
  7. changed the title [-]Off-hour voicemail fails after Macro-to-Gosub migration[/-] [+]NethVoice: Off-hour voicemail fails after Macro-to-Gosub migration[/+] on Nov 23, 2026
  8. removed their assignment
    on Nov 23, 2026
  9. added
    verified
    on Nov 23, 2026
  10. removed
    testing
    on Nov 23, 2026
  11. moved this from Testing to Verified in NethVoiceon Nov 23, 2026
  12. edospadoni commented on Nov 23, 2026

    @edospadoni
    Member

    Release nethesis/ns8-nethvoice 1.8.5

  13. removed
    verified
    on Nov 23, 2026
  14. moved this from Verified to Done in NethVoiceon Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoice

    Type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions