Skip to content

Commit

Permalink
res_pjsip_sdp_rtp.c: Support keepalive for video streams.
Browse files Browse the repository at this point in the history
ASTERISK-28890 #close

Change-Id: Iad269a8dc36f892ede90fe8ceb3010560c0f70d1
  • Loading branch information
lukeescude authored and seanbright committed Jan 20, 2022
1 parent 23be22a commit 5875c7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions res/res_pjsip_sdp_rtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session,
ast_rtp_instance_activate(session_media->rtp);

/* audio stream handles music on hold */
if (media_type != AST_MEDIA_TYPE_AUDIO) {
if (media_type != AST_MEDIA_TYPE_AUDIO && media_type != AST_MEDIA_TYPE_VIDEO) {
if ((pjmedia_sdp_neg_was_answer_remote(session->inv_session->neg) == PJ_FALSE)
&& (session->inv_session->state == PJSIP_INV_STATE_CONFIRMED)) {
ast_queue_control(session->channel, AST_CONTROL_UPDATE_RTP_PEER);
Expand Down Expand Up @@ -2205,7 +2205,8 @@ static int apply_negotiated_sdp_stream(struct ast_sip_session *session,
session_media->encryption = session->endpoint->media.rtp.encryption;

if (session->endpoint->media.rtp.keepalive > 0 &&
session_media->type == AST_MEDIA_TYPE_AUDIO) {
(session_media->type == AST_MEDIA_TYPE_AUDIO ||
session_media->type == AST_MEDIA_TYPE_VIDEO)) {
ast_rtp_instance_set_keepalive(session_media->rtp, session->endpoint->media.rtp.keepalive);
/* Schedule the initial keepalive early in case this is being used to punch holes through
* a NAT. This way there won't be an awkward delay before media starts flowing in some
Expand Down

0 comments on commit 5875c7b

Please sign in to comment.