Store RTCP reports in channel variables and SIP history
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
6d4ab87321
commit
d2fa9efdad
|
@ -2966,16 +2966,26 @@ static int sip_hangup(struct ast_channel *ast)
|
||||||
}
|
}
|
||||||
} else { /* Call is in UP state, send BYE */
|
} else { /* Call is in UP state, send BYE */
|
||||||
if (!p->pendinginvite) {
|
if (!p->pendinginvite) {
|
||||||
|
char *audioqos = "";
|
||||||
|
char *videoqos = "";
|
||||||
|
if (p->rtp)
|
||||||
|
audioqos = ast_rtp_get_quality(p->rtp);
|
||||||
|
if (p->vrtp)
|
||||||
|
videoqos = ast_rtp_get_quality(p->vrtp);
|
||||||
/* Send a hangup */
|
/* Send a hangup */
|
||||||
transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
|
transmit_request_with_auth(p, SIP_BYE, 0, XMIT_RELIABLE, 1);
|
||||||
|
|
||||||
/* Get RTCP quality before end of call */
|
/* Get RTCP quality before end of call */
|
||||||
if (recordhistory) {
|
if (recordhistory) {
|
||||||
if (p->rtp)
|
if (p->rtp)
|
||||||
append_history(p, "RTCPaudio", "Quality:%s", ast_rtp_get_quality(p->rtp));
|
append_history(p, "RTCPaudio", "Quality:%s", audioqos);
|
||||||
if (p->vrtp)
|
if (p->vrtp)
|
||||||
append_history(p, "RTCPvideo", "Quality:%s", ast_rtp_get_quality(p->vrtp));
|
append_history(p, "RTCPvideo", "Quality:%s", videoqos);
|
||||||
}
|
}
|
||||||
|
if (p->rtp)
|
||||||
|
pbx_builtin_setvar_helper(p->owner, "RTPAUDIOQOS", audioqos);
|
||||||
|
if (p->vrtp)
|
||||||
|
pbx_builtin_setvar_helper(p->owner, "RTPVIDEOQOS", videoqos);
|
||||||
} else {
|
} else {
|
||||||
/* Note we will need a BYE when this all settles out
|
/* Note we will need a BYE when this all settles out
|
||||||
but we can't send one while we have "INVITE" outstanding. */
|
but we can't send one while we have "INVITE" outstanding. */
|
||||||
|
@ -12629,6 +12639,7 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
|
||||||
int res;
|
int res;
|
||||||
struct ast_channel *bridged_to;
|
struct ast_channel *bridged_to;
|
||||||
char iabuf[INET_ADDRSTRLEN];
|
char iabuf[INET_ADDRSTRLEN];
|
||||||
|
char *audioqos = NULL, *videoqos = NULL;
|
||||||
|
|
||||||
if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !ast_test_flag(req, SIP_PKT_IGNORE))
|
if (p->pendinginvite && !ast_test_flag(&p->flags[0], SIP_OUTGOING) && !ast_test_flag(req, SIP_PKT_IGNORE))
|
||||||
transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
|
transmit_response_reliable(p, "487 Request Terminated", &p->initreq);
|
||||||
|
@ -12637,18 +12648,28 @@ static int handle_request_bye(struct sip_pvt *p, struct sip_request *req)
|
||||||
check_via(p, req);
|
check_via(p, req);
|
||||||
ast_set_flag(&p->flags[0], SIP_ALREADYGONE);
|
ast_set_flag(&p->flags[0], SIP_ALREADYGONE);
|
||||||
|
|
||||||
|
if (p->rtp)
|
||||||
|
audioqos = ast_rtp_get_quality(p->rtp);
|
||||||
|
if (p->vrtp)
|
||||||
|
videoqos = ast_rtp_get_quality(p->vrtp);
|
||||||
|
|
||||||
/* Get RTCP quality before end of call */
|
/* Get RTCP quality before end of call */
|
||||||
if (recordhistory) {
|
if (recordhistory) {
|
||||||
if (p->rtp)
|
if (p->rtp)
|
||||||
append_history(p, "RTCPaudio", "Quality:%s", ast_rtp_get_quality(p->rtp));
|
append_history(p, "RTCPaudio", "Quality:%s", audioqos);
|
||||||
if (p->vrtp)
|
if (p->vrtp)
|
||||||
append_history(p, "RTCPvideo", "Quality:%s", ast_rtp_get_quality(p->vrtp));
|
append_history(p, "RTCPvideo", "Quality:%s", videoqos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->rtp) {
|
if (p->rtp) {
|
||||||
|
if (p->owner)
|
||||||
|
pbx_builtin_setvar_helper(p->owner, "RTPAUDIOQOS", audioqos);
|
||||||
/* Immediately stop RTP */
|
/* Immediately stop RTP */
|
||||||
ast_rtp_stop(p->rtp);
|
ast_rtp_stop(p->rtp);
|
||||||
}
|
}
|
||||||
if (p->vrtp) {
|
if (p->vrtp) {
|
||||||
|
if (p->owner)
|
||||||
|
pbx_builtin_setvar_helper(p->owner, "RTPVIDEOQOS", videoqos);
|
||||||
/* Immediately stop VRTP */
|
/* Immediately stop VRTP */
|
||||||
ast_rtp_stop(p->vrtp);
|
ast_rtp_stop(p->vrtp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue