summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip_outbound_publish.c')
-rw-r--r--res/res_pjsip_outbound_publish.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 75e74a26f..4894e55d1 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -362,7 +362,8 @@ static struct ast_sip_event_publisher_handler *find_publisher_handler_for_event_
/*! \brief Helper function which cancels the refresh timer on a publisher */
static void cancel_publish_refresh(struct sip_outbound_publisher *publisher)
{
- if (pj_timer_heap_cancel(pjsip_endpt_get_timer_heap(ast_sip_get_pjsip_endpoint()), &publisher->timer)) {
+ if (pj_timer_heap_cancel_if_active(pjsip_endpt_get_timer_heap(ast_sip_get_pjsip_endpoint()),
+ &publisher->timer, 0)) {
/* The timer was successfully cancelled, drop the refcount of the publisher */
ao2_ref(publisher, -1);
}
@@ -1069,7 +1070,7 @@ static struct sip_outbound_publisher *sip_outbound_publisher_alloc(
return NULL;
}
- if (ast_sip_push_task_synchronous(NULL, sip_outbound_publisher_init, publisher)) {
+ if (ast_sip_push_task_wait_servant(NULL, sip_outbound_publisher_init, publisher)) {
ast_log(LOG_ERROR, "Unable to create publisher for outbound publish '%s'\n",
ast_sorcery_object_get_id(client->publish));
ao2_ref(publisher, -1);
@@ -1513,8 +1514,8 @@ static int current_state_reusable(struct ast_sip_outbound_publish *publish,
*/
old_publish = current_state->client->publish;
current_state->client->publish = publish;
- if (ast_sip_push_task_synchronous(
- NULL, sip_outbound_publisher_reinit_all, current_state->client->publishers)) {
+ if (ast_sip_push_task_wait_servant(NULL, sip_outbound_publisher_reinit_all,
+ current_state->client->publishers)) {
/*
* If the state object fails to re-initialize then swap
* the old publish info back in.