diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-04-22 20:48:50 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2019-04-22 20:50:03 +0200 |
commit | 9f11dc5616d4431b701afc777a2f915548ad2eab (patch) | |
tree | adca95f5d1bc5379d3590f655d7f16595cf58575 | |
parent | ca0818c76004c21181960a6c0dce1c8845080f7c (diff) |
libosmo-mgcp: Use trunk type during endpoint allocation
This way we prepare it to add more endpoint types in the future (osmux)
and also make it clear that E1 endpoint specifics allocation is still
missing.
Change-Id: I7633b5287a436c11f0bbbdbaef1cf59a051a2471
-rw-r--r-- | src/libosmo-mgcp/mgcp_protocol.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4121b9f55..2acc7fda7 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1677,9 +1677,18 @@ int mgcp_endpoints_allocate(struct mgcp_trunk_config *tcfg) tcfg->endpoints[i].cfg = tcfg->cfg; tcfg->endpoints[i].tcfg = tcfg; - /* NOTE: Currently all endpoints are of type RTP, this will - * change when new variations are implemented */ - tcfg->endpoints[i].type = &ep_typeset.rtp; + switch (tcfg->trunk_type) { + case MGCP_TRUNK_VIRTUAL: + tcfg->endpoints[i].type = &ep_typeset.rtp; + break; + case MGCP_TRUNK_E1: + /* FIXME: Implement E1 allocation */ + LOGP(DLMGCP, LOGL_FATAL, "E1 trunks not implemented!\n"); + break; + default: + osmo_panic("Cannot allocate unimplemented trunk type %d! %s:%d\n", + tcfg->trunk_type, __FILE__, __LINE__); + } } tcfg->number_endpoints = tcfg->vty_number_endpoints; |