summaryrefslogtreecommitdiff
path: root/src/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/call.c')
-rw-r--r--src/call.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/call.c b/src/call.c
index 1ddb42f..dda9f3a 100644
--- a/src/call.c
+++ b/src/call.c
@@ -1028,14 +1028,15 @@ static void sipsess_estab_handler(const struct sip_msg *msg, void *arg)
set_state(call, STATE_ESTABLISHED);
- call_event_handler(call, CALL_EVENT_ESTABLISHED, call->peer_uri);
-
call_stream_start(call, true);
/* the transferor will hangup this call */
if (call->not) {
(void)call_notify_sipfrag(call, 200, "OK");
}
+
+ /* must be done last, the handler might deref this call */
+ call_event_handler(call, CALL_EVENT_ESTABLISHED, call->peer_uri);
}