diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-12-19 01:01:46 +0100 |
---|---|---|
committer | gsmevent admin <admin@gsmevent.box> | 2018-12-24 15:45:52 +0100 |
commit | a0e39fee4d9032eeed36d127f641d997bc4e459f (patch) | |
tree | 5d3e1e31f83dadf3367e4e5e56c2cb2830126db9 | |
parent | ea621a72270b771e0798e3cf68c5035a31c39424 (diff) |
use mgcp-client configured endpoint domain name
Rationale: reading pcaps becomes so much easier when each of osmo-bsc and
osmo-msc address their MGW with differing domain names. Otherwise, both will
have a '0@mgw' endpoint and it gets really confusing.
After this, with according configuration, there can be a '0@bsc' and a '0@msc'
endpoint.
osmo-mgw-for-msc.cfg:
mgcp
domain msc
osmo-msc.cfg:
msc
mgw endpoint-domain msc
Depends: Ia662016f29dd8727d9c4626d726729641e21e1f8 (osmo-mgw)
Change-Id: I87ac11847d1a6d165ee9a2b5d8a4978e7ac73433
-rw-r--r-- | src/libmsc/msc_mgcp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c index 259fdfc86..d69a6da08 100644 --- a/src/libmsc/msc_mgcp.c +++ b/src/libmsc/msc_mgcp.c @@ -51,8 +51,6 @@ #define MGCP_ASS_TIMEOUT 10 /* in seconds */ #define MGCP_ASS_TIMEOUT_TIMER_NR 4 -#define ENDPOINT_ID "rtpbridge/*@mgw" - /* Some internal cause codes to indicate fault condition inside the FSM */ enum msc_mgcp_cause_code { MGCP_ERR_MGW_FAIL, @@ -306,7 +304,7 @@ static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data .call_id = mgcp_ctx->call_id, .conn_mode = MGCP_CONN_RECV_ONLY }; - if (osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->rtp_endpoint, sizeof(mgcp_msg.endpoint)) >= + if (osmo_strlcpy(mgcp_msg.endpoint, mgcp_client_rtpbridge_wildcard(mgcp), sizeof(mgcp_msg.endpoint)) >= MGCP_ENDPOINT_MAXLEN) { handle_error(mgcp_ctx, MGCP_ERR_TOOLONG, false); return; @@ -982,6 +980,7 @@ int msc_mgcp_call_assignment(struct gsm_trans *trans) static bool fsm_registered = false; struct ran_conn *conn; struct mgcp_client *mgcp; + int rc; OSMO_ASSERT(trans); @@ -1017,11 +1016,12 @@ int msc_mgcp_call_assignment(struct gsm_trans *trans) /* Allocate and configure a new fsm instance */ mgcp_ctx = talloc_zero(NULL, struct mgcp_ctx); OSMO_ASSERT(mgcp_ctx); - if (osmo_strlcpy(mgcp_ctx->rtp_endpoint, ENDPOINT_ID, sizeof(mgcp_ctx->rtp_endpoint)) >= - MGCP_ENDPOINT_MAXLEN) { + + rc = osmo_strlcpy(mgcp_ctx->rtp_endpoint, mgcp_client_rtpbridge_wildcard(mgcp), sizeof(mgcp_ctx->rtp_endpoint)); + if (rc >= sizeof(mgcp_ctx->rtp_endpoint)) { talloc_free(mgcp_ctx); - LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) endpoint identifier (%s) exceeds maximum length...\n", - vlr_subscr_name(trans->vsub), ENDPOINT_ID); + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) endpoint identifier exceeds maximum length: %s\n", + vlr_subscr_name(trans->vsub), osmo_quote_str(mgcp_client_rtpbridge_wildcard(mgcp), -1)); return -EINVAL; } mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, NULL); |