diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index abfcdddec601dd7b75ad39654d5874adb45dce06..9ed4056fea3b64dbcc9f3656447a4ac40e0fcbb4 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -3274,7 +3274,7 @@ static int unregister_task(void *obj) if (pjsip_regc_unregister(client, &tdata) == PJ_SUCCESS && add_configured_supported_headers(state->client_state, tdata)) { - if (registration_client_send(state->client_state, tdata) == PJ_SUCCESS) { + if (state->client_state->status == SIP_REGISTRATION_REGISTERED && registration_client_send(state->client_state, tdata) == PJ_SUCCESS) { if (sip_uri) ast_log_dt(LOG_EVENT_CODE_IPX002, (int) sip_uri->user.slen, sip_uri->user.ptr, (int) sip_uri->host.slen, sip_uri->host.ptr);