[asterisk-commits] russell: branch 1.6.0 r106299 - in /branches/1.6.0: ./ channels/ include/aste...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 18:07:09 CST 2008


Author: russell
Date: Wed Mar  5 18:07:09 2008
New Revision: 106299

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106299
Log:
Merged revisions 105675 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r105675 | file | 2008-03-04 12:08:42 -0600 (Tue, 04 Mar 2008) | 16 lines

Merged revisions 105674 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r105674 | file | 2008-03-04 14:05:28 -0400 (Tue, 04 Mar 2008) | 8 lines

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

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c
    branches/1.6.0/include/asterisk/rtp.h
    branches/1.6.0/main/rtp.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
--- trunk-merged (original)
+++ trunk-merged Wed Mar  5 18:07:09 2008
@@ -1,1 +1,1 @@
-/trunk:1-105595,106036,106040,106139
+/trunk:1-105595,105675,106036,106040,106139

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=106299&r1=106298&r2=106299
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Wed Mar  5 18:07:09 2008
@@ -4825,8 +4825,10 @@
 		if (p->t38.state == T38_PEER_DIRECT) {
 			change_t38_state(p, T38_ENABLED);
 			res = transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
-		} else 
+		} else {
+			ast_rtp_new_source(p->rtp);
 			res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL, FALSE);
+		}
 	}
 	sip_pvt_unlock(p);
 	return res;
@@ -4859,6 +4861,7 @@
 				if ((ast->_state != AST_STATE_UP) &&
 				    !ast_test_flag(&p->flags[0], SIP_PROGRESS_SENT) &&
 				    !ast_test_flag(&p->flags[0], SIP_OUTGOING)) {
+					ast_rtp_new_source(p->rtp);
 					transmit_response_with_sdp(p, "183 Session Progress", &p->initreq, XMIT_UNRELIABLE, FALSE);
 					ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);	
 				}
@@ -5096,9 +5099,11 @@
 		res = -1;
 		break;
 	case AST_CONTROL_HOLD:
+		ast_rtp_new_source(p->rtp);
 		ast_moh_start(ast, data, p->mohinterpret);
 		break;
 	case AST_CONTROL_UNHOLD:
+		ast_rtp_new_source(p->rtp);
 		ast_moh_stop(ast);
 		break;
 	case AST_CONTROL_VIDUPDATE:	/* Request a video frame update */

Modified: branches/1.6.0/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/rtp.h?view=diff&rev=106299&r1=106298&r2=106299
==============================================================================
--- branches/1.6.0/include/asterisk/rtp.h (original)
+++ branches/1.6.0/include/asterisk/rtp.h Wed Mar  5 18:07:09 2008
@@ -170,6 +170,8 @@
 
 int ast_rtp_setqos(struct ast_rtp *rtp, int tos, int cos, char *desc);
 
+void ast_rtp_new_source(struct ast_rtp *rtp);
+
 /*! \brief  Setting RTP payload types from lines in a SDP description: */
 void ast_rtp_pt_clear(struct ast_rtp* rtp);
 /*! \brief Set payload types to defaults */

Modified: branches/1.6.0/main/rtp.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/rtp.c?view=diff&rev=106299&r1=106298&r2=106299
==============================================================================
--- branches/1.6.0/main/rtp.c (original)
+++ branches/1.6.0/main/rtp.c Wed Mar  5 18:07:09 2008
@@ -175,6 +175,8 @@
 
 	enum strict_rtp_state strict_rtp_state; /*!< Current state that strict RTP protection is in */
 	struct sockaddr_in strict_rtp_address;  /*!< Remote address information for strict RTP purposes */
+
+	int set_marker_bit:1;           /*!< Whether to set the marker bit or not */
 };
 
 /* Forward declarations */
@@ -2324,6 +2326,12 @@
 	return ast_netsock_set_qos(rtp->s, tos, cos, desc);
 }
 
+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;
@@ -3036,6 +3044,13 @@
 			}
 		}
 	}
+
+	/* 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.
 	*/




More information about the asterisk-commits mailing list