Skip to content

NethHotel outbound calls from checked-in rooms fail when default rates/costs are missing (AGI camere.php returns 4) #7867

@Stell0

Description

@Stell0

On NethVoice for NS8 with NethHotel configured (per best practices), room extensions cannot place outbound calls while the room is in check-in status. Calls between rooms work (when permitted) and service extensions can call outbound normally.

The call never reaches outbound routes/trunks: it stays inside the NethHotel AGI script (camere.php) and ends with a non-zero exit. Asterisk logs show camere.php returning 4 after playing the “contact reception” prompt.

This appears to be triggered by missing rates/costs configuration (tariffe/costi linea). In NV14 the rates section was pre-populated with a default set; on NS8 it seems missing, causing outbound calls from rooms to be blocked unless rates are manually configured.

Steps to reproduce

  1. Install NethVoice on NS8 and enable/configure NethHotel.
  2. Configure one or more extensions as hotel rooms.
  3. Put a room in check-in status.
  4. Ensure NethHotel rates/costs are not configured (empty / not preloaded).
  5. From a checked-in room extension, dial an external number.

Expected behavior

  • Outbound call from a checked-in room is processed normally (routes/trunks are reached),
    OR
  • The system provides an explicit UI validation/error at configuration time (wizard/module) stating that rates/costs must be configured before enabling outbound calls from rooms.

Actual behavior

  • Outbound call from a checked-in room fails immediately.
  • Call does not reach the outbound route/trunk.
  • The call stays in camere.php, plays “contact reception”, then the AGI exits non-zero (return code 4), and the call is hung up.

Evidence / logs

Asterisk log excerpt (AGI debug enabled), dialing xxxxxxxxx from room 303:

-- Executing [xxxxxxxxx@hotel:1] AGI("PJSIP/303-00000021", "set-room-lang.php,303") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/set-room-lang.php
...
    -- <PJSIP/303-00000021>AGI Script set-room-lang.php completed, returning 0
    -- Executing [xxxxxxxxx@hotel:2] AGI("PJSIP/303-00000021", "camere.php,303,xxxxxxxxx") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/camere.php
...
<PJSIP/303-00000021>AGI Rx << STREAM FILE alarm/contattare-reception "" 0
    -- <PJSIP/303-00000021> Playing 'alarm/contattare-reception.slin' (escape_digits=) (sample_offset 0) (language 'it')
<PJSIP/303-00000021>AGI Tx >> 200 result=-1 endpos=21600
    -- <PJSIP/303-00000021>AGI Script camere.php completed, returning 4
== Spawn extension (hotel, xxxxxxxxx, 2) exited non-zero on 'PJSIP/303-00000021'

Notes:

  • Room-to-room calls work (permissions enabled)
  • Service extensions can call outbound normally

Proposed fix options
Ensure default rates are created automatically

See Also*

Metadata

Metadata

Assignees

No one assigned

    Labels

    nethvoiceBug or features releted to the NethVoice project

    Type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions