]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_pjsip: set correct Endpoint Device State on multiple channels
authorAlexei Gradinari <alex2grad@gmail.com>
Tue, 25 Mar 2025 21:24:29 +0000 (17:24 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 1 May 2025 12:39:48 +0000 (12:39 +0000)
commite2a3cd224c0624513334dc773b507c3b2e73ae66
treed0866e3b98c7f217c8d58169eea9154e4b838494
parentd1f33e7c3e41d3846ae6f42b1feaa120adbd1fc2
chan_pjsip: set correct Endpoint Device State on multiple channels

1. When one channel is placed on hold, the device state is set to ONHOLD
without checking other channels states.
In case of AST_CONTROL_HOLD set the device state as AST_DEVICE_UNKNOWN
to calculate aggregate device state of all active channels.

2. The current implementation incorrectly classifies channels in use.
The only channels that has the states: UP, RING and BUSY are considered as "in use".
A channel should be considered "in use" if its state is anything other than
DOWN or RESERVED.

3. Currently, if the number of channels "in use" is greater than device_state_busy_at,
the system does not set the state to BUSY. Instead, it incorrectly assigns an aggregate
device state.
The endpoint device state should be BUSY if the number of channels "in use" is greater
than or equal to device_state_busy_at.

Fixes: #1181
(cherry picked from commit ad178d155db599483aedf9936eaedf4ee4b7940f)
channels/chan_pjsip.c
res/res_pjsip/pjsip_config.xml