res_pjsip: Prevent SEGV in pjsip_evsub_send_request

contributed pjproject - patch to check sub->pending_notify
in evsub.c:on_tsx_state before calling
pjsip_evsub_send_request()

res_pjsip_pubsub - change post pjsip 2.13 behavior to use
pubsub_on_refresh_timeout to avoid the ao2_cleanup call on
the sub_tree. This is is because the final NOTIFY send is no
longer the last place the sub_tree is referenced.

ASTERISK-30419

Change-Id: Ib5cc662ce578e9adcda312e16c58a10b6453e438
This commit is contained in:
Mike Bradeen
2023-02-21 13:25:28 -07:00
committed by Michael Bradeen
parent aeb16aa7d8
commit 37e558f6ef
2 changed files with 47 additions and 1 deletions

View File

@@ -4137,7 +4137,7 @@ static void pubsub_on_rx_refresh(pjsip_evsub *evsub, pjsip_rx_data *rdata,
SUBSCRIBE's 200 OK. The previous solution was to push the NOTIFY, but now pjproject
looks for the NOTIFY on send and delays it until after it auto-replies.
If the NOTIFY is not there when it looks to send, pjproject will assert. */
serialized_pubsub_on_refresh_timeout(sub_tree);
pubsub_on_refresh_timeout(sub_tree);
#else
if (ast_sip_push_task(sub_tree->serializer, serialized_pubsub_on_refresh_timeout, ao2_bump(sub_tree))) {
/* If we can't push the NOTIFY refreshing task...we'll just go with it. */