1 From ac685b30c17be461b2bf5b46a772ed9742b8e985 Mon Sep 17 00:00:00 2001
2 From: Riza Sulistyo <trengginas@users.noreply.github.com>
3 Date: Thu, 9 Feb 2023 13:19:23 +0700
4 Subject: [PATCH] Make sure that NOTIFY tdata is set before sending it.
7 pjsip/src/pjsip-simple/evsub.c | 9 ++++++---
8 1 file changed, 6 insertions(+), 3 deletions(-)
10 diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c
11 index da0a9b416..68c1d3951 100644
12 --- a/pjsip/src/pjsip-simple/evsub.c
13 +++ b/pjsip/src/pjsip-simple/evsub.c
14 @@ -2216,23 +2216,26 @@ static void on_tsx_state_uas( pjsip_evsub *sub, pjsip_transaction *tsx,
18 sub->state = old_state;
19 sub->state_str = old_state_str;
22 /* Send the pending NOTIFY sent by app from inside
23 * on_rx_refresh() callback.
25 - pj_assert(sub->pending_notify);
26 - status = pjsip_evsub_send_request(sub, sub->pending_notify);
27 - sub->pending_notify = NULL;
28 + //pj_assert(sub->pending_notify);
29 + /* Make sure that pending_notify is set. */
30 + if (sub->pending_notify) {
31 + status = pjsip_evsub_send_request(sub, sub->pending_notify);
32 + sub->pending_notify = NULL;
35 } else if (pjsip_method_cmp(&tsx->method, &pjsip_notify_method)==0) {
37 /* Handle authentication */
38 if (tsx->state == PJSIP_TSX_STATE_COMPLETED &&
39 (tsx->status_code==401 || tsx->status_code==407))
43 pjsip_rx_data *rdata = event->body.tsx_state.src.rdata;