summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 2a821dd73..497fb6e61 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7285,6 +7285,10 @@ static int sip_hangup(struct ast_channel *ast)
} while (sip_pvt_trylock(p));
}
+ if (p->rtp || p->vrtp || p->trtp) {
+ ast_channel_stage_snapshot(oldowner);
+ }
+
if (p->rtp) {
ast_rtp_instance_set_stats_vars(oldowner, p->rtp);
}
@@ -7320,6 +7324,9 @@ static int sip_hangup(struct ast_channel *ast)
}
pbx_builtin_setvar_helper(oldowner, "RTPTEXTQOS", quality);
}
+ if (p->rtp || p->vrtp || p->trtp) {
+ ast_channel_stage_snapshot_done(oldowner);
+ }
/* Send a hangup */
if (ast_channel_state(oldowner) == AST_STATE_UP) {
@@ -8092,6 +8099,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
}
}
+ ast_channel_stage_snapshot(tmp);
+
/* If we sent in a callid, bind it to the channel. */
if (callid) {
ast_channel_callid_set(tmp, callid);
@@ -8287,6 +8296,8 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
append_history(i, "NewChan", "Channel %s - from %s", ast_channel_name(tmp), i->callid);
}
+ ast_channel_stage_snapshot_done(tmp);
+
return tmp;
}
@@ -26531,6 +26542,10 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
}
}
+ if ((p->rtp || p->vrtp || p->trtp) && p->owner) {
+ ast_channel_stage_snapshot(p->owner);
+ }
+
/* Get RTCP quality before end of call */
if (p->rtp) {
if (p->do_history) {
@@ -26595,6 +26610,10 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
}
}
+ if ((p->rtp || p->vrtp || p->trtp) && p->owner) {
+ ast_channel_stage_snapshot_done(p->owner);
+ }
+
stop_media_flows(p); /* Immediately stop RTP, VRTP and UDPTL as applicable */
stop_session_timer(p); /* Stop Session-Timer */