I have some confusion about the correspondence between ast_channel_state and ast_device_state.
AST_STATE_RING: Line is ringing
AST_STATE_RINGING: Remote end is ringing
What does AST_ DEVICE_ RINGING mean, is the device in a ringback state or in ring state?If it is not ring state, then there is no identification of the ring state.If it is the ring state, is there a problem with the corresponding relationship.Should it be changed to the following corresponding relationship?
/*!\brief Mapping for channel states to device states */
static const struct chan2dev {
enum ast_channel_state chan;
enum ast_device_state dev;
} chan2dev = {
{ AST_STATE_DOWN, AST_DEVICE_NOT_INUSE },
{ AST_STATE_RESERVED, AST_DEVICE_INUSE },
{ AST_STATE_OFFHOOK, AST_DEVICE_INUSE },
{ AST_STATE_DIALING, AST_DEVICE_INUSE },
{ AST_STATE_RING, AST_DEVICE_RINGING },
{ AST_STATE_RINGING, AST_DEVICE_INUSE },
{ AST_STATE_UP, AST_DEVICE_INUSE },
{ AST_STATE_BUSY, AST_DEVICE_BUSY },
{ AST_STATE_DIALING_OFFHOOK, AST_DEVICE_INUSE },
{ AST_STATE_PRERING, AST_DEVICE_RINGING },
};
I don’t know if there is a problem with my understanding. Looking forward to your answers.