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
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;
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));
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");
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) {
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);
/* 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));