[asterisk-commits] qwell: branch qwell/pjsip-shared-libs r382312 - in /team/qwell/pjsip-shared-l...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 28 16:22:51 CST 2013


Author: qwell
Date: Thu Feb 28 16:22:48 2013
New Revision: 382312

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382312
Log:
Multiple revisions 382294-382295,382297,382299

........
  r382294 | rmudgett | 2013-02-28 15:29:57 -0600 (Thu, 28 Feb 2013) | 1 line
  
  threadpool: Whitespace and comment corrections.
........
  r382295 | rmudgett | 2013-02-28 15:31:14 -0600 (Thu, 28 Feb 2013) | 1 line
  
  threadpool: Make ast_threadpool_push() return -1 if shutting_down
........
  r382297 | file | 2013-02-28 15:37:57 -0600 (Thu, 28 Feb 2013) | 10 lines
  
  Fix a bug with ICE and strictrtp where media could get dropped.
  
  If the end result of the ICE negotiation resulted in the path for media
  changing it was possible for the strictrtp code to discard the RTP packets.
  This change causes strictrtp to enter learning mode once again when the
  ICE negotiation has completed successfully.
  ........
  
  Merged revisions 382296 from http://svn.asterisk.org/svn/asterisk/branches/11
........
  r382299 | file | 2013-02-28 15:59:56 -0600 (Thu, 28 Feb 2013) | 5 lines
  
  While the ICE negotiation is occurring leave strictrtp in an open state, media can and will come from different places.
  ........
  
  Merged revisions 382298 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 382294-382295,382297,382299 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/qwell/pjsip-shared-libs/   (props changed)
    team/qwell/pjsip-shared-libs/include/asterisk/threadpool.h
    team/qwell/pjsip-shared-libs/main/threadpool.c
    team/qwell/pjsip-shared-libs/res/res_rtp_asterisk.c

Propchange: team/qwell/pjsip-shared-libs/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/qwell/pjsip-shared-libs/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/qwell/pjsip-shared-libs/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Feb 28 16:22:48 2013
@@ -1,1 +1,1 @@
-/trunk:1-382292
+/trunk:1-382308

Modified: team/qwell/pjsip-shared-libs/include/asterisk/threadpool.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pjsip-shared-libs/include/asterisk/threadpool.h?view=diff&rev=382312&r1=382311&r2=382312
==============================================================================
--- team/qwell/pjsip-shared-libs/include/asterisk/threadpool.h (original)
+++ team/qwell/pjsip-shared-libs/include/asterisk/threadpool.h Thu Feb 28 16:22:48 2013
@@ -103,6 +103,9 @@
 	 *
 	 * When the threadpool's size increases, it can never increase
 	 * beyond this number of threads.
+	 *
+	 * Zero is a valid value if the threadpool does not have a
+	 * maximum size.
 	 */
 	int max_size;
 };
@@ -132,7 +135,7 @@
  * \brief Create a new threadpool
  *
  * This function creates a threadpool. Tasks may be pushed onto this thread pool
- * in and will be automatically acted upon by threads within the pool.
+ * and will be automatically acted upon by threads within the pool.
  *
  * Only a single threadpool with a given name may exist. This function will fail
  * if a threadpool with the given name already exists.

Modified: team/qwell/pjsip-shared-libs/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pjsip-shared-libs/main/threadpool.c?view=diff&rev=382312&r1=382311&r2=382312
==============================================================================
--- team/qwell/pjsip-shared-libs/main/threadpool.c (original)
+++ team/qwell/pjsip-shared-libs/main/threadpool.c Thu Feb 28 16:22:48 2013
@@ -94,7 +94,7 @@
 	 * that the threadpool had its state change.
 	 */
 	struct ast_taskprocessor *control_tps;
-	/*! True if the threadpool is in the processof shutting down */
+	/*! True if the threadpool is in the process of shutting down */
 	int shutting_down;
 	/*! Threadpool-specific options */
 	struct ast_threadpool_options options;
@@ -898,7 +898,7 @@
 	if (!pool->shutting_down) {
 		return ast_taskprocessor_push(pool->tps, task, data);
 	}
-	return 0;
+	return -1;
 }
 
 void ast_threadpool_shutdown(struct ast_threadpool *pool)
@@ -1127,28 +1127,32 @@
 
 static int execute_tasks(void *data)
 {
-       struct ast_taskprocessor *tps = data;
-
-       while (ast_taskprocessor_execute(tps)) {
-	       /* No-op */
-       }
-
-       ast_taskprocessor_unreference(tps);
-       return 0;
-}
-
-static void serializer_task_pushed(struct ast_taskprocessor_listener *listener, int was_empty) {
-       if (was_empty) {
-	       struct serializer *ser = ast_taskprocessor_listener_get_user_data(listener);
-	       struct ast_taskprocessor *tps = ast_taskprocessor_listener_get_tps(listener);
-	       ast_threadpool_push(ser->pool, execute_tasks, tps);
-       }
-};
+	struct ast_taskprocessor *tps = data;
+
+	while (ast_taskprocessor_execute(tps)) {
+		/* No-op */
+	}
+
+	ast_taskprocessor_unreference(tps);
+	return 0;
+}
+
+static void serializer_task_pushed(struct ast_taskprocessor_listener *listener, int was_empty)
+{
+	if (was_empty) {
+		struct serializer *ser = ast_taskprocessor_listener_get_user_data(listener);
+		struct ast_taskprocessor *tps = ast_taskprocessor_listener_get_tps(listener);
+
+		if (ast_threadpool_push(ser->pool, execute_tasks, tps)) {
+			ast_taskprocessor_unreference(tps);
+		}
+	}
+}
 
 static int serializer_start(struct ast_taskprocessor_listener *listener)
 {
-       /* No-op */
-       return 0;
+	/* No-op */
+	return 0;
 }
 
 static void serializer_shutdown(struct ast_taskprocessor_listener *listener)
@@ -1158,9 +1162,9 @@
 }
 
 static struct ast_taskprocessor_listener_callbacks serializer_tps_listener_callbacks = {
-       .task_pushed = serializer_task_pushed,
-       .start = serializer_start,
-       .shutdown = serializer_shutdown,
+	.task_pushed = serializer_task_pushed,
+	.start = serializer_start,
+	.shutdown = serializer_shutdown,
 };
 
 struct ast_taskprocessor *ast_threadpool_serializer(const char *name, struct ast_threadpool *pool)

Modified: team/qwell/pjsip-shared-libs/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pjsip-shared-libs/res/res_rtp_asterisk.c?view=diff&rev=382312&r1=382311&r2=382312
==============================================================================
--- team/qwell/pjsip-shared-libs/res/res_rtp_asterisk.c (original)
+++ team/qwell/pjsip-shared-libs/res/res_rtp_asterisk.c Thu Feb 28 16:22:48 2013
@@ -547,6 +547,7 @@
 		pj_ice_sess_start_check(rtp->ice);
 		pj_timer_heap_poll(timerheap, NULL);
 		rtp->ice_started = 1;
+		rtp->strict_rtp_state = STRICT_RTP_OPEN;
 	}
 }
 
@@ -1035,6 +1036,20 @@
 };
 
 #ifdef HAVE_PJPROJECT
+static void rtp_learning_seq_init(struct ast_rtp *rtp, uint16_t seq);
+
+static void ast_rtp_on_ice_complete(pj_ice_sess *ice, pj_status_t status)
+{
+	struct ast_rtp *rtp = ice->user_data;
+
+	if (!strictrtp) {
+		return;
+	}
+
+	rtp->strict_rtp_state = STRICT_RTP_LEARN;
+	rtp_learning_seq_init(rtp, (uint16_t)rtp->seqno);
+}
+
 static void ast_rtp_on_ice_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len)
 {
 	struct ast_rtp *rtp = ice->user_data;
@@ -1081,6 +1096,7 @@
 
 /* ICE Session interface declaration */
 static pj_ice_sess_cb ast_rtp_ice_sess_cb = {
+	.on_ice_complete = ast_rtp_on_ice_complete,
 	.on_rx_data = ast_rtp_on_ice_rx_data,
 	.on_tx_pkt = ast_rtp_on_ice_tx_pkt,
 };
@@ -3970,7 +3986,7 @@
 
 	rtp->rxseqno = 0;
 
-	if (strictrtp) {
+	if (strictrtp && rtp->strict_rtp_state != STRICT_RTP_OPEN) {
 		rtp->strict_rtp_state = STRICT_RTP_LEARN;
 		rtp_learning_seq_init(rtp, rtp->seqno);
 	}




More information about the asterisk-commits mailing list