Always specify which RTP engine is desired for a new RTP instance.
authorRussell Bryant <russell@russellbryant.com>
Wed, 12 Aug 2009 10:11:36 +0000 (10:11 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 12 Aug 2009 10:11:36 +0000 (10:11 +0000)
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.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211732 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_gtalk.c
channels/chan_h323.c
channels/chan_jingle.c
channels/chan_mgcp.c
channels/chan_skinny.c
channels/chan_unistim.c

index 6ad6ed9..a0cc424 100644 (file)
@@ -947,7 +947,7 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const
                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;
index a4135a9..897416a 100644 (file)
@@ -958,7 +958,7 @@ static int __oh323_rtp_create(struct oh323_pvt *pvt)
                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));
index da98986..71113f6 100644 (file)
@@ -772,7 +772,7 @@ static struct jingle_pvt *jingle_alloc(struct jingle *client, const char *from,
                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");
index d74fc9d..cc01250 100644 (file)
@@ -2614,7 +2614,7 @@ static void start_rtp(struct mgcp_subchannel *sub)
                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) {
index c289f30..546c7eb 100644 (file)
@@ -3632,9 +3632,9 @@ static void start_rtp(struct skinny_subchannel *sub)
 
        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);
index bb90301..8de4ada 100644 (file)
@@ -2061,7 +2061,7 @@ static void start_rtp(struct unistim_subchannel *sub)
        /* 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));