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. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211732 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
593c44bc43
commit
199ef7e3d8
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
|
|
Reference in New Issue