pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29418 )
Change subject: mgcp: Set up Osmux only when AMR codec is selected
......................................................................
mgcp: Set up Osmux only when AMR codec is selected
Until now Osmux was selected unconditionally in bss-side CRCX, without
checking if the codec was AMR or not. If Osmux use policy is "on", we
only want to request Osmux use if AMR codec is selected.
Change-Id: I3f53555dd9608f1337365e4f82b492bdf1da05bb
---
M include/osmocom/bsc/lchan_rtp_fsm.h
M src/osmo-bsc/lchan_rtp_fsm.c
2 files changed, 27 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/29418/1
diff --git a/include/osmocom/bsc/lchan_rtp_fsm.h b/include/osmocom/bsc/lchan_rtp_fsm.h
index 5dbdb0a..397b5e1 100644
--- a/include/osmocom/bsc/lchan_rtp_fsm.h
+++ b/include/osmocom/bsc/lchan_rtp_fsm.h
@@ -13,6 +13,7 @@
struct gsm_lchan;
struct mgcp_conn_peer;
+enum mgcp_codecs;
enum lchan_rtp_fsm_state {
LCHAN_RTP_ST_WAIT_MGW_ENDPOINT_AVAILABLE,
@@ -48,3 +49,4 @@
void lchan_forget_mgw_endpoint(struct gsm_lchan *lchan);
void mgcp_pick_codec(struct mgcp_conn_peer *verb_info, const struct gsm_lchan *lchan, bool bss_side);
+bool mgcp_codec_is_picked(const struct mgcp_conn_peer *verb_info, enum mgcp_codecs codec);
diff --git a/src/osmo-bsc/lchan_rtp_fsm.c b/src/osmo-bsc/lchan_rtp_fsm.c
index 87c235f..916823a 100644
--- a/src/osmo-bsc/lchan_rtp_fsm.c
+++ b/src/osmo-bsc/lchan_rtp_fsm.c
@@ -166,8 +166,7 @@
crcx_info = (struct mgcp_conn_peer){
.ptime = 20,
- .x_osmo_osmux_use = bts->use_osmux != OSMUX_USAGE_OFF,
- .x_osmo_osmux_cid = -1, /* -1 is wildcard */
+ .x_osmo_osmux_cid = -1, /* -1 is wildcard, .x_osmo_osmux_use set below */
};
if (lchan->conn) {
crcx_info.call_id = lchan->conn->sccp.conn_id;
@@ -175,9 +174,25 @@
crcx_info.x_osmo_ign = lchan->conn->sccp.msc->x_osmo_ign;
}
mgcp_pick_codec(&crcx_info, lchan, true);
- /* TODO: lchan_rtp_fail() here if crcx_info->codecs[] contains non-AMR and bts->use_osmux=ONLY.
- If bts->use_osmux=ON, only set .x_osmo_osmux_use if there's an AMR in crcx_info->codecs[].
- IF osmux=no, always set x_osmo_osmux_use=false*/
+
+ /* Set up Osmux use in MGW according to configured policy */
+ bool amr_picked = mgcp_codec_is_picked(&crcx_info, CODEC_AMR_8000_1);
+ switch (bts->use_osmux) {
+ case OSMUX_USAGE_OFF:
+ crcx_info.x_osmo_osmux_use = false;
+ break;
+ case OSMUX_USAGE_ON:
+ crcx_info.x_osmo_osmux_use = amr_picked;
+ break;
+ case OSMUX_USAGE_ONLY:
+ if (!amr_picked) {
+ lchan_rtp_fail("Only AMR codec can be used when configured with policy 'osmux only'."
+ " Check your configuration.");
+ return;
+ }
+ crcx_info.x_osmo_osmux_use = true;
+ break;
+ }
osmo_mgcpc_ep_ci_request(lchan->mgw_endpoint_ci_bts, MGCP_VERB_CRCX, &crcx_info,
fi, LCHAN_RTP_EV_MGW_ENDPOINT_AVAILABLE, LCHAN_RTP_EV_MGW_ENDPOINT_ERROR,
@@ -908,3 +923,8 @@
verb_info->param.amr_octet_aligned = lchan->conn->sccp.msc->amr_octet_aligned;
}
}
+
+bool mgcp_codec_is_picked(const struct mgcp_conn_peer *verb_info, enum mgcp_codecs codec)
+{
+ return verb_info->codecs[0] == codec;
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/29418
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3f53555dd9608f1337365e4f82b492bdf1da05bb
Gerrit-Change-Number: 29418
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/29370 )
Change subject: ipaccess_close(): No need to lookup already available struct e1i_ts
......................................................................
ipaccess_close(): No need to lookup already available struct e1i_ts
Change-Id: I54a69cad5adc3df3f95dd51e00ea68bb04ba9963
---
M src/input/ipaccess.c
1 file changed, 4 insertions(+), 8 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
neels: Looks good to me, approved
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 1b8d8d0..94d2baf 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -452,15 +452,11 @@
struct e1inp_ts *e1i_ts = sign_link->ts;
struct osmo_fd *bfd = &e1i_ts->driver.ipaccess.fd;
struct e1inp_line *line = e1i_ts->line;
+ struct osmo_fsm_inst *ka_fsm = e1i_ts->driver.ipaccess.ka_fsm;
- /* line might not exist if != bsc||bts */
- if (line) {
- /* depending on caller the fsm might be dead */
- struct osmo_fsm_inst* ka_fsm = ipaccess_line_ts(bfd, line)->driver.ipaccess.ka_fsm;
- if (ka_fsm)
- ipa_keepalive_fsm_stop(ka_fsm);
-
- }
+ /* depending on caller the fsm might be dead */
+ if (ka_fsm)
+ ipa_keepalive_fsm_stop(ka_fsm);
e1inp_int_snd_event(e1i_ts, sign_link, S_L_INP_TEI_DN);
/* the first e1inp_sign_link_destroy call closes the socket. */
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/29370
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I54a69cad5adc3df3f95dd51e00ea68bb04ba9963
Gerrit-Change-Number: 29370
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/29371 )
Change subject: ipaccess: Call line->ops->sign_link_down() only if set
......................................................................
ipaccess: Call line->ops->sign_link_down() only if set
This op must not necessarily be set by the user, so check if it is set
before calling it.
Change-Id: I666c5bbf157fe604e336df44f7eac098572d42ba
---
M src/input/ipaccess.c
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
neels: Looks good to me, approved
fixeria: Looks good to me, approved
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 94d2baf..42dd942 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -123,7 +123,8 @@
e1i_ts->pending_msg = NULL;
/* e1inp_sign_link_destroy releases the socket descriptors for us. */
- line->ops->sign_link_down(line);
+ if (line->ops->sign_link_down)
+ line->ops->sign_link_down(line);
e1inp_line_put2(line, __func__);
return ret;
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/29371
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I666c5bbf157fe604e336df44f7eac098572d42ba
Gerrit-Change-Number: 29371
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged