Asterisk - The Open Source Telephony Project
21.4.1
|
res_pjsip Scheduler More...
#include "asterisk.h"
#include "asterisk/res_pjsip.h"
#include "include/res_pjsip_private.h"
#include "asterisk/res_pjsip_cli.h"
#include "asterisk/taskprocessor.h"
#include <regex.h>
Go to the source code of this file.
Data Structures | |
struct | ast_sip_sched_task |
Macros | |
#define | ID_LEN 13 /* task_deadbeef */ |
#define | TASK_BUCKETS 53 |
#define | TIME_FORMAT "%a %T" |
Functions | |
AO2_STRING_FIELD_CMP_FN (ast_sip_sched_task, name) | |
AO2_STRING_FIELD_HASH_FN (ast_sip_sched_task, name) | |
AO2_STRING_FIELD_SORT_FN (ast_sip_sched_task, name) | |
int | ast_sip_destroy_scheduler (void) |
int | ast_sip_initialize_scheduler (void) |
Initialize scheduler. More... | |
int | ast_sip_sched_is_task_running (struct ast_sip_sched_task *schtd) |
Checks if the task is currently running. More... | |
int | ast_sip_sched_is_task_running_by_name (const char *name) |
Checks if the task is currently running. More... | |
int | ast_sip_sched_task_cancel (struct ast_sip_sched_task *schtd) |
Cancels the next invocation of a task. More... | |
int | ast_sip_sched_task_cancel_by_name (const char *name) |
Cancels the next invocation of a task by name. More... | |
int | ast_sip_sched_task_get_name (struct ast_sip_sched_task *schtd, char *name, size_t maxlen) |
Gets the task name. More... | |
int | ast_sip_sched_task_get_next_run (struct ast_sip_sched_task *schtd) |
Gets the number of milliseconds until the next invocation. More... | |
int | ast_sip_sched_task_get_next_run_by_name (const char *name) |
Gets the number of milliseconds until the next invocation. More... | |
int | ast_sip_sched_task_get_times (struct ast_sip_sched_task *schtd, struct timeval *queued, struct timeval *last_start, struct timeval *last_end) |
Gets the last start and end times of the task. More... | |
int | ast_sip_sched_task_get_times2 (struct ast_sip_sched_task *schtd, struct timeval *queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start) |
Gets the queued, last start, last_end, time left, interval, next run. More... | |
int | ast_sip_sched_task_get_times_by_name (const char *name, struct timeval *queued, struct timeval *last_start, struct timeval *last_end) |
Gets the last start and end times of the task by name. More... | |
int | ast_sip_sched_task_get_times_by_name2 (const char *name, struct timeval *queued, struct timeval *last_start, struct timeval *last_end, int *interval, int *time_left, struct timeval *next_start) |
Gets the queued, last start, last_end, time left, interval, next run by task name. More... | |
struct ast_sip_sched_task * | ast_sip_schedule_task (struct ast_taskprocessor *serializer, int interval, ast_sip_task sip_task, const char *name, void *task_data, enum ast_sip_scheduler_task_flags flags) |
Schedule a task to run in the res_pjsip thread pool. More... | |
static char * | cli_show_tasks (struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) |
static int | push_to_serializer (const void *data) |
static int | run_task (void *data) |
static void | schtd_dtor (void *data) |
Variables | |
static struct ast_cli_entry | cli_commands [] |
static struct ast_sched_context * | scheduler_context |
static int | task_count |
static struct ao2_container * | tasks |
res_pjsip Scheduler
Definition in file pjsip_scheduler.c.
int ast_sip_initialize_scheduler | ( | void | ) |
Initialize scheduler.
-1 | failure |
0 | success |
Definition at line 614 of file pjsip_scheduler.c.
References AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_container_alloc_hash, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, ast_cli_register_multiple, ast_sched_context_create(), ast_sched_context_destroy(), and ast_sched_start_thread().
|
static |
Definition at line 610 of file pjsip_scheduler.c.