mgcp: Only allow transcoding on the virtual trunk

This commit is contained in:
Holger Hans Peter Freyther 2011-02-28 14:51:48 +01:00
parent 44016fee14
commit 6990687f4c
2 changed files with 3 additions and 2 deletions

View File

@ -475,7 +475,7 @@ static int allocate_ports(struct mgcp_endpoint *endp)
return -1;
}
if (endp->cfg->transcoder_ip) {
if (endp->cfg->transcoder_ip && endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) {
if (allocate_port(endp, &endp->trans_net,
&endp->cfg->transcoder_ports,
mgcp_bind_trans_net_rtp_port) != 0) {

View File

@ -672,7 +672,8 @@ static int allocate_trunk(struct mgcp_trunk_config *trunk)
endp->net_end.local_alloc = PORT_ALLOC_STATIC;
}
if (cfg->transcoder_ip && cfg->transcoder_ports.mode == PORT_ALLOC_STATIC) {
if (trunk->trunk_type == MGCP_TRUNK_VIRTUAL &&
cfg->transcoder_ip && cfg->transcoder_ports.mode == PORT_ALLOC_STATIC) {
int rtp_port;
/* network side */