- fixed rtp with smoother

This commit is contained in:
MelwareDE 2006-06-12 10:22:31 +00:00
parent d3b162066a
commit 705e0e5d84
2 changed files with 14 additions and 11 deletions

View File

@ -1591,12 +1591,6 @@ static int pbx_capi_write(struct ast_channel *c, struct ast_frame *f)
cc_mutex_unlock(&i->lock);
return 0;
}
if (i->B3q < CAPI_MAX_B3_BLOCKS) {
ret = capi_write_rtp(c, f);
i->B3q++;
}
cc_mutex_unlock(&i->lock);
return ret;
}
if ((!i->smoother) || (ast_smoother_feed(i->smoother, f) != 0)) {
@ -1608,6 +1602,10 @@ static int pbx_capi_write(struct ast_channel *c, struct ast_frame *f)
for (fsmooth = ast_smoother_read(i->smoother);
fsmooth != NULL;
fsmooth = ast_smoother_read(i->smoother)) {
if (i->isdnstate & CAPI_ISDN_STATE_RTP) {
ret = capi_write_rtp(c, fsmooth);
continue;
}
DATA_B3_REQ_HEADER(&CMSG, capi_ApplID, get_capi_MessageNumber(), 0);
DATA_B3_REQ_NCCI(&CMSG) = i->NCCI;
DATA_B3_REQ_DATALENGTH(&CMSG) = fsmooth->datalen;
@ -1668,7 +1666,7 @@ static int pbx_capi_write(struct ast_channel *c, struct ast_frame *f)
}
}
cc_mutex_unlock(&i->lock);
return 0;
return ret;
}
/*

View File

@ -239,19 +239,24 @@ int capi_write_rtp(struct ast_channel *c, struct ast_frame *f)
if (f->datalen > CAPI_MAX_B3_BLOCK_SIZE) {
cc_verbose(4, 0, VERBOSE_PREFIX_4 "%s: rtp write data: frame too big (len = %d).\n",
i->name, f->datalen);
return -1;
return 0;
}
i->send_buffer_handle++;
ast_rtp_get_us(i->rtp, &us);
us.sin_port = 0; /* don't really send */
ast_rtp_set_peer(i->rtp, &us);
if (ast_rtp_write(i->rtp, f) != 0) {
cc_verbose(3, 1, VERBOSE_PREFIX_2 "%s: rtp_write error, dropping packet.\n",
i->name);
return -1;
return 0;
}
if (i->B3q >= CAPI_MAX_B3_BLOCKS)
return 0;
i->B3q++;
i->send_buffer_handle++;
len = f->datalen + rtpheaderlen;
cc_verbose(6, 1, VERBOSE_PREFIX_4 "%s: RTP write for NCCI=%#x len=%d(%d) %s\n",