Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
Hello neels, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 to look at the new patch set (#6). Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 5 files changed, 57 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/6 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 6 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
Hello neels, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 to look at the new patch set (#5). Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. The intention of this patch is for a production network to remove some of the slightly unpredictable behaviour of call waiting. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 5 files changed, 57 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/5 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 5 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
Hello neels, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 to look at the new patch set (#4). Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. The intention of this patch is for a production network to remove some of the slightly unpredictable behaviour of call waiting. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 5 files changed, 57 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 4 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
Hello neels, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 to look at the new patch set (#3). Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. The intention of this patch is for a production network to remove some of the slightly unpredictable behaviour of call waiting. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/transaction.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 6 files changed, 57 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 3 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
keith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 ) Change subject: Implements a global switch on the network to disable call waiting. .. Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h@258 PS1, Line 258: uint8_t callwaiting; > rather use bool oops, I thought I did.. -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 1 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-Comment-Date: Thu, 08 Aug 2019 15:04:57 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels Gerrit-MessageType: comment
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
Hello neels, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 to look at the new patch set (#2). Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. The intention of this patch is for a production network to remove some of the slightly unpredictable behaviour of call waiting. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/transaction.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/libmsc/transaction.c M src/osmo-msc/msc_main.c M tests/test_nodes.vty 7 files changed, 71 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 2 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-MessageType: newpatchset
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 ) Change subject: Implements a global switch on the network to disable call waiting. .. Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h@258 PS1, Line 258: uint8_t callwaiting; > rather use bool call_waiting -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 1 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-CC: pespin Gerrit-Comment-Date: Thu, 08 Aug 2019 14:27:39 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels Gerrit-MessageType: comment
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 ) Change subject: Implements a global switch on the network to disable call waiting. .. Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/15120/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/15120/1//COMMIT_MSG@7 PS1, Line 7: Implements a global switch on the network to disable call waiting. minor style: in general, always use the imperative form, "implement"; shorter even would be: "add 'no callwaiting'" -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 1 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-Comment-Date: Thu, 08 Aug 2019 14:26:31 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 ) Change subject: Implements a global switch on the network to disable call waiting. .. Patch Set 1: Code-Review-1 (11 comments) build failure: you need to adjust the vty transcript test that failed. You added the 'callwaiting' vty option, and the transcript test didn't expect that to appear. https://gerrit.osmocom.org/#/c/15120/1//COMMIT_MSG Commit Message: https://gerrit.osmocom.org/#/c/15120/1//COMMIT_MSG@22 PS1, Line 22: of call waiting. would be nice to briefly mention or reference issues of the unpredictable behavior https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h File include/osmocom/msc/gsm_data.h: https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/gsm_data.h@258 PS1, Line 258: uint8_t callwaiting; rather use bool https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/transaction.h File include/osmocom/msc/transaction.h: https://gerrit.osmocom.org/#/c/15120/1/include/osmocom/msc/transaction.h@142 PS1, Line 142: struct vlr_subscr *vsub); Instead of adding this I would suggest the caller use trans_find_by_type(msc_a_for_vsub(vsub, true), TRANS_CC); (to avoid API clutter) https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c File src/libmsc/gsm_04_08_cc.c: https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1806 PS1, Line 1806: struct gsm_trans *_trans = NULL; > Not sure about this, but I got a segfault (in other code path) while testing, > wasn't sure if it was […] as I read the code there shouldn't be a segfault, but it is better style to use a separate variable indeed. Rather declare the separate variable at the start of the "if (!net->callwaiting)" scope because it isn't used elsewhere, and rather name it like existing_cc_trans or something to clarify. https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1879 PS1, Line 1879: if (!net->callwaiting) { (put the trans var decl here) https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1880 PS1, Line 1880: _trans = trans_find_cc_by_vsub(net, vsub); (use trans_find_by_type() here, see below) https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1886 PS1, Line 1886: _trans->cc.state, cosmetic: no need to log both the state number and the gsm48_cc_state_name(), just the name is enough https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1894 PS1, Line 1894: if (!vsub->lu_complete) { would make sense to keep this check before the callwaiting check. It's higher up the priority of reject reasons. so... (read below) https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1902 PS1, Line 1902: } <-- MARKER (see below) https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1917 PS1, Line 1917: msc_a = msc_a_for_vsub(vsub, true); and here is an msc_a already. So I would suggest: - move this msc_a = msc_a_for_vsub() up to "MARKER" above. - put the net->callwaiting check right below that - use trans_find_by_type(msc_a, TRANS_CC) instead of adding API https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/msc_vty.c File src/libmsc/msc_vty.c: https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/msc_vty.c@360 PS1, Line 360: vty_out(vty, " callwaiting%s", VTY_NEWLINE); (we often don't write back the default, so could only write 'no callwaiting' in case it is false) -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 1 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Reviewer: neels Gerrit-Comment-Date: Thu, 08 Aug 2019 14:19:19 + Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: keith Gerrit-MessageType: comment
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
keith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 ) Change subject: Implements a global switch on the network to disable call waiting. .. Patch Set 1: (1 comment) > Build Failed > > https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-msc/1824/ : > FAILURE Aw boo. It built for me. https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c File src/libmsc/gsm_04_08_cc.c: https://gerrit.osmocom.org/#/c/15120/1/src/libmsc/gsm_04_08_cc.c@1806 PS1, Line 1806: struct gsm_trans *_trans = NULL; Not sure about this, but I got a segfault (in other code path) while testing, wasn't sure if it was due to my redefining trans below, so I left it here. As far as i can make out, if the code path continues, we are going to trans = trans_alloc() anyway. but may be something I'm doing wring here with memory. -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/15120 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae Gerrit-Change-Number: 15120 Gerrit-PatchSet: 1 Gerrit-Owner: keith Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith Gerrit-Comment-Date: Thu, 08 Aug 2019 14:01:33 + Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
Change in ...osmo-msc[master]: Implements a global switch on the network to disable call waiting.
keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/15120 Change subject: Implements a global switch on the network to disable call waiting. .. Implements a global switch on the network to disable call waiting. Add a network -> callwaiting VTY command as boolean. When this is enabled (default) there is no change to operation previous to this commit. When this switch is disabled with "no callwaiting" in vty then when a call arrives, we will check if we have an active call transaction for this subscriber, no matter if it is establishing, established, or alerting, in any of these cases we will return USER BUSY to the calling party. The intention of this patch is for a production network to remove some of the slightly unpredictable behaviour of call waiting. Change-Id: I3eb6f23f7103e3002874fb5d3a30c9de952202ae --- M include/osmocom/msc/gsm_data.h M include/osmocom/msc/transaction.h M src/libmsc/gsm_04_08_cc.c M src/libmsc/msc_vty.c M src/libmsc/transaction.c M src/osmo-msc/msc_main.c 6 files changed, 69 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/20/15120/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index e926b3f..e0d6a6c 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -253,6 +253,9 @@ /* Whether we want to use Osmux against BSCs. Controlled via VTY */ enum osmux_usage use_osmux; + + /* Whether to use call waiting on the network */ + uint8_t callwaiting; }; struct osmo_esme; diff --git a/include/osmocom/msc/transaction.h b/include/osmocom/msc/transaction.h index 69cd652..b173f31 100644 --- a/include/osmocom/msc/transaction.h +++ b/include/osmocom/msc/transaction.h @@ -138,7 +138,8 @@ }; - +struct gsm_trans *trans_find_cc_by_vsub(const struct gsm_network *net, + struct vlr_subscr *vsub); struct gsm_trans *trans_find_by_type(const struct msc_a *msc_a, enum trans_type type); struct gsm_trans *trans_find_by_id(const struct msc_a *msc_a, enum trans_type type, uint8_t trans_id); diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c index 03830de..37d0a07 100644 --- a/src/libmsc/gsm_04_08_cc.c +++ b/src/libmsc/gsm_04_08_cc.c @@ -1803,6 +1803,7 @@ int i, rc = 0; struct msc_a *msc_a = NULL; struct gsm_trans *trans = NULL; + struct gsm_trans *_trans = NULL; const struct gsm_mncc *data; /* handle special messages */ @@ -1874,6 +1875,21 @@ /* update the subscriber we deal with */ log_set_context(LOG_CTX_VLR_SUBSCR, vsub); + /* If subscriber is BUSY and we do not DO call in call or "call-waiting" */ + if (!net->callwaiting) { + _trans = trans_find_cc_by_vsub(net, vsub); + if (_trans && _trans->cc.state != GSM_CSTATE_NULL) { + LOG_TRANS_CAT(_trans, DCC, LOGL_NOTICE, + "rx '%s' for subscriber %s with trans state %d (%s)" + " rejecting with USER_BUSY\n", + get_mncc_name(msg->msg_type), data->called.number, + _trans->cc.state, + gsm48_cc_state_name(_trans->cc.state)); + return mncc_release_ind(net, NULL, data->callref, + GSM48_CAUSE_LOC_PRN_S_LU, + GSM48_CC_CAUSE_USER_BUSY); + } + } /* If subscriber is not "attached" */ if (!vsub->lu_complete) { LOG_TRANS_CAT(trans, DCC, LOGL_ERROR, "rx %s for subscriber that is not attached: %s\n", diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 5bf9701..13b9687 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -292,6 +292,29 @@ return CMD_SUCCESS; } +DEFUN(cfg_net_call_wait, cfg_net_call_wait_cmd, + "callwaiting", + "Enable Call Waiting on the Network\n") +{ + struct gsm_network *net = vty->index; + + net->callwaiting = true; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_no_call_wait, cfg_net_no_call_wait_cmd, + "no callwaiting", + NO_STR + "Disable Call Waiting on the Network\n") +{ + struct gsm_network *net = vty->index; + + net->callwaiting = false; + + return CMD_SUCCESS; +} + static int config_write_net(struct vty *vty) { int i; @@ -333,6 +356,11 @@ gsmnet->emergency.route_to_msisdn, VTY_NEWLINE); } + if (gsmnet->callwaiting) + vty_out(vty, " callwaiting%s",