当前位置:   article > 正文

asterisk 和 freeswitch 定时器_asterisk 定时闹钟

asterisk 定时闹钟

freeswitch

SWITCH_DECLARE(uint32_t) switch_scheduler_add_task(time_t task_runtime,
  switch_scheduler_func_t func,
  const char *desc, const char *group, uint32_t cmd_id, void *cmd_arg, switch_scheduler_flag_t flags);

SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_id(uint32_t task_id);

调用:

设置

taskid=switch_scheduler_add_task( switch_epoch_time_now(NULL) + meetme_task->seconds, meetme_retention_timer_callback, (char *) __SWITCH_FUNC__, NULL, 0, meetme_task, flags);

取消

 switch_scheduler_del_task_id(taskid);


asterisk:

  int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, const void *data)

int ast_sched_del(struct sched_context *con, int id)

设置:

r->timeout = ast_sched_add(sched, global_reg_timeout * 1000, sip_sub_timeout, r);

取消: ast_sched_del(sched, r->timeout)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/675837
推荐阅读
相关标签
  

闽ICP备14008679号