res_stasis: signal when new command is queued

res_statsis's app loop sleeps for up to .2s waiting on input
to a channel before re-checking the command queue. This can
cause delays between channel setup and bridge.

This change is to send a SIGURG on the sleeping thread when
a new command is enqueued. This exits the sleeping thread out
of the ast_waitfor() call triggering the new command being
processed on the channel immediately.

Resolves: #362

UserNote: Call setup times should be significantly improved
when using ARI.

(cherry picked from commit 79220e3f0c)
This commit is contained in:
Mike Bradeen
2023-10-02 12:35:32 -06:00
committed by Asterisk Development Team
parent 1f7e9bfad5
commit 0f2eb00a52
3 changed files with 33 additions and 0 deletions

View File

@@ -48,6 +48,15 @@ struct stasis_app_control *control_create(struct ast_channel *channel, struct st
*/
void control_flush_queue(struct stasis_app_control *control);
/*!
* \brief set the control's thread id
* \since 18
*
* \param control Control object on which to set the thread id.
* \param threadid id to set
*/
void control_set_thread(struct stasis_app_control *control, pthread_t threadid);
/*!
* \brief Dispatch all commands enqueued to this control.
*