]> 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)
committerAlexei Gradinari <alex2grad@gmail.com>
Fri, 28 Mar 2025 15:15:24 +0000 (15:15 +0000)
commit03cf8c62ad40531454ac6acd3feafa505ac6bff2
tree555a3f6f334269e65dcb9d9a096d41d7cc0f8179
parentf24729a48d9a63b5fa4b2966b92551c16900f1a8
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
channels/chan_pjsip.c
res/res_pjsip/pjsip_config.xml