mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-18 02:32:36 +00:00
res_pjsip.c: Add check that timer actually got scheduled.
Change-Id: Iabaa2e5dccf0762c258101ea0eb1487cf6959ad1
This commit is contained in:
@@ -3410,7 +3410,7 @@ static pj_status_t endpt_send_request(struct ast_sip_endpoint *endpoint,
|
||||
ast_debug(2, "%p: Set timer to %d msec\n", req_wrapper, timeout);
|
||||
|
||||
pj_timer_entry_init(req_wrapper->timeout_timer, TIMEOUT_TIMER2,
|
||||
req_wrapper, &send_request_timer_callback);
|
||||
req_wrapper, send_request_timer_callback);
|
||||
|
||||
pj_timer_heap_cancel_if_active(pjsip_endpt_get_timer_heap(endpt),
|
||||
req_wrapper->timeout_timer, TIMER_INACTIVE);
|
||||
@@ -3419,8 +3419,18 @@ static pj_status_t endpt_send_request(struct ast_sip_endpoint *endpoint,
|
||||
* timer callback is executed.
|
||||
*/
|
||||
ao2_ref(req_wrapper, +1);
|
||||
pj_timer_heap_schedule(pjsip_endpt_get_timer_heap(endpt),
|
||||
ret_val = pj_timer_heap_schedule(pjsip_endpt_get_timer_heap(endpt),
|
||||
req_wrapper->timeout_timer, &timeout_timer_val);
|
||||
if (ret_val != PJ_SUCCESS) {
|
||||
ao2_unlock(req_wrapper);
|
||||
ast_log(LOG_ERROR,
|
||||
"Failed to set timer. Not sending %.*s request to endpoint %s.\n",
|
||||
(int) pj_strlen(&tdata->msg->line.req.method.name),
|
||||
pj_strbuf(&tdata->msg->line.req.method.name),
|
||||
endpoint ? ast_sorcery_object_get_id(endpoint) : "<unknown>");
|
||||
ao2_t_ref(req_wrapper, -2, "Drop timer and routine ref");
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
req_wrapper->timeout_timer->id = TIMEOUT_TIMER2;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user