int ooh323c_start_transmit_channel(ooCallData *call, ooLogicalChannel *pChannel) { struct ast_format *tmpfmt = NULL; tmpfmt = convertH323CapToAsteriskCap(pChannel->chanCap->cap); if (tmpfmt) { if ((ast_format_cmp(tmpfmt, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) || (ast_format_cmp(tmpfmt, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL)) { ooh323_set_write_format(call, tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes); } else if (ast_format_cmp(tmpfmt, ast_format_g729) == AST_FORMAT_CMP_EQUAL) { ooh323_set_write_format(call, tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes*10); } else { ooh323_set_write_format(call, tmpfmt, 0); } }else{ ast_log(LOG_ERROR, "Invalid capability type for receive channel %s\n", call->callToken); return -1; } setup_rtp_connection(call, pChannel->remoteIP, pChannel->remoteMediaPort); return 1; }
int ooh323c_start_transmit_channel(ooCallData *call, ooLogicalChannel *pChannel) { struct ast_format tmpfmt; convertH323CapToAsteriskCap(pChannel->chanCap->cap, &tmpfmt); if(tmpfmt.id) { switch (tmpfmt.id) { case AST_FORMAT_ALAW: case AST_FORMAT_ULAW: ooh323_set_write_format(call, &tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes); break; case AST_FORMAT_G729A: ooh323_set_write_format(call, &tmpfmt, ((OOCapParams *)(pChannel->chanCap->params))->txframes*10); break; default: ooh323_set_write_format(call, &tmpfmt, 0); } }else{ ast_log(LOG_ERROR, "Invalid capability type for receive channel %s\n", call->callToken); return -1; } setup_rtp_connection(call, pChannel->remoteIP, pChannel->remoteMediaPort); return 1; }