aboutsummaryrefslogtreecommitdiffstats
path: root/main/rtp.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-04 18:05:28 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-04 18:05:28 +0000
commitd69fe8861e281c80845406a82b42b44d2db63c9e (patch)
tree41011ab096bbd398a8fee02ad29c1e9a1dce16e9 /main/rtp.c
parentf9191c4c9fbc8092532bafe28a2d3db267c550ab (diff)
When a new source of audio comes in (such as music on hold) make sure the marker bit gets set.
(closes issue #10355) Reported by: wdecarne Patches: 10355.diff uploaded by file (license 11) (closes issue #11491) Reported by: kanderson git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105674 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index a1aa2985f..d75fe4852 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -172,6 +172,7 @@ struct ast_rtp {
struct ast_rtcp *rtcp;
struct ast_codec_pref pref;
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
+ int set_marker_bit:1; /*!< Whether to set the marker bit or not */
};
/* Forward declarations */
@@ -1994,6 +1995,12 @@ int ast_rtp_settos(struct ast_rtp *rtp, int tos)
return res;
}
+void ast_rtp_new_source(struct ast_rtp *rtp)
+{
+ rtp->set_marker_bit = 1;
+ return;
+}
+
void ast_rtp_set_peer(struct ast_rtp *rtp, struct sockaddr_in *them)
{
rtp->them.sin_port = them->sin_port;
@@ -2641,6 +2648,13 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
}
}
}
+
+ /* If we have been explicitly told to set the marker bit do so */
+ if (rtp->set_marker_bit) {
+ mark = 1;
+ rtp->set_marker_bit = 0;
+ }
+
/* If the timestamp for non-digit packets has moved beyond the timestamp
for digits, update the digit timestamp.
*/