[asterisk-commits] russell: trunk r211732 - /trunk/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 12 05:11:40 CDT 2009


Author: russell
Date: Wed Aug 12 05:11:36 2009
New Revision: 211732

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=211732
Log:
Always specify which RTP engine is desired for a new RTP instance.

This fixes a crash reported in #asterisk-dev where chan_mgcp unexpectedly
allocated an RTP instance from res_rtp_multicast, since by not specifying an
engine, you get the first one in the list of engines.

Modified:
    trunk/channels/chan_gtalk.c
    trunk/channels/chan_h323.c
    trunk/channels/chan_jingle.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_skinny.c
    trunk/channels/chan_unistim.c

Modified: trunk/channels/chan_gtalk.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_gtalk.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_gtalk.c (original)
+++ trunk/channels/chan_gtalk.c Wed Aug 12 05:11:36 2009
@@ -947,7 +947,7 @@
 		tmp->initiator = 1;
 	}
 	/* clear codecs */
-	if (!(tmp->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL))) {
+	if (!(tmp->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr, NULL))) {
 	  ast_log(LOG_ERROR, "Failed to create a new RTP instance (possibly an invalid bindaddr?)\n");
 	  ast_free(tmp);
 	  return NULL;

Modified: trunk/channels/chan_h323.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_h323.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Wed Aug 12 05:11:36 2009
@@ -958,7 +958,7 @@
 		ast_log(LOG_ERROR, "Unable to locate local IP address for RTP stream\n");
 		return -1;
 	}
-	pvt->rtp = ast_rtp_instance_new(NULL, sched, &our_addr, NULL);
+	pvt->rtp = ast_rtp_instance_new("asterisk", sched, &our_addr, NULL);
 	if (!pvt->rtp) {
 		ast_mutex_unlock(&pvt->lock);
 		ast_log(LOG_WARNING, "Unable to create RTP session: %s\n", strerror(errno));

Modified: trunk/channels/chan_jingle.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_jingle.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_jingle.c (original)
+++ trunk/channels/chan_jingle.c Wed Aug 12 05:11:36 2009
@@ -772,7 +772,7 @@
 		ast_copy_string(tmp->them, idroster, sizeof(tmp->them));
 		tmp->initiator = 1;
 	}
-	tmp->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+	tmp->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr, NULL);
 	tmp->parent = client;
 	if (!tmp->rtp) {
 		ast_log(LOG_WARNING, "Out of RTP sessions?\n");

Modified: trunk/channels/chan_mgcp.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Wed Aug 12 05:11:36 2009
@@ -2614,7 +2614,7 @@
 		sub->rtp = NULL;
 	}
 	/* Allocate the RTP now */
-	sub->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+	sub->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr, NULL);
 	if (sub->rtp && sub->owner)
 		ast_channel_set_fd(sub->owner, 0, ast_rtp_instance_fd(sub->rtp, 0));
 	if (sub->rtp) {

Modified: trunk/channels/chan_skinny.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Wed Aug 12 05:11:36 2009
@@ -3632,9 +3632,9 @@
 
 	ast_mutex_lock(&sub->lock);
 	/* Allocate the RTP */
-	sub->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+	sub->rtp = ast_rtp_instance_new("asterisk", sched, &bindaddr, NULL);
 	if (hasvideo)
-		sub->vrtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+		sub->vrtp = ast_rtp_instance_new("asterisk", sched, &bindaddr, NULL);
 
 	if (sub->rtp) {
 		ast_rtp_instance_set_prop(sub->rtp, AST_RTP_PROPERTY_RTCP, 1);

Modified: trunk/channels/chan_unistim.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_unistim.c?view=diff&rev=211732&r1=211731&r2=211732
==============================================================================
--- trunk/channels/chan_unistim.c (original)
+++ trunk/channels/chan_unistim.c Wed Aug 12 05:11:36 2009
@@ -2061,7 +2061,7 @@
 	/* Allocate the RTP */
 	if (unistimdebug)
 		ast_verb(0, "Starting RTP. Bind on %s\n", ast_inet_ntoa(sout.sin_addr));
-	sub->rtp = ast_rtp_instance_new(NULL, sched, &sout, NULL);
+	sub->rtp = ast_rtp_instance_new("asterisk", sched, &sout, NULL);
 	if (!sub->rtp) {
 		ast_log(LOG_WARNING, "Unable to create RTP session: %s binaddr=%s\n",
 				strerror(errno), ast_inet_ntoa(sout.sin_addr));




More information about the asterisk-commits mailing list