jolly has uploaded this change for review.
ASCI: Fix removal of call notification when lchan fails
When ASCI resource setup fails, due to channel assignment failure, the
lchan will be removed from gsm_subscriber_connection structure. Adding
a 'bts' pointer to gsm_subscriber_connection structure allows the ASCI
resource FSM destructor to remove call notification from that BTS.
Change-Id: Ib5f7fdf8c3b3606002151f86d2bdfaeb33904364
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/vgcs_fsm.c
2 files changed, 8 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/41503/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 59d22d7..63cc8e2 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -472,6 +472,8 @@
struct gsm_subscriber_connection *call;
/* Cell (BTS) FSM */
struct osmo_fsm_inst *fi;
+ /* BTS to notify about ongoing call */
+ struct gsm_bts *notify_bts;
/* lchan to be assigned */
struct gsm_lchan *new_lchan;
/* MGW peer */
diff --git a/src/osmo-bsc/vgcs_fsm.c b/src/osmo-bsc/vgcs_fsm.c
index 1f2bbef..70390f8 100644
--- a/src/osmo-bsc/vgcs_fsm.c
+++ b/src/osmo-bsc/vgcs_fsm.c
@@ -602,10 +602,7 @@
if (conn->vgcs_chan.fi->state != VGCS_CHAN_ST_WAIT_EST) {
/* Remove call from notification channel. */
- if (conn->lchan)
- rsl_notification_cmd(conn->lchan->ts->trx->bts, NULL, &conn->vgcs_chan.gc_ie, NULL);
- else
- LOG_CHAN(conn, LOGL_ERROR, "Unable to remove notification, lchan is already gone.\n");
+ rsl_notification_cmd(conn->vgcs_chan.notify_bts, NULL, &conn->vgcs_chan.gc_ie, NULL);
}
/* Detach from call, if not already. */
@@ -731,7 +728,7 @@
osmo_fsm_inst_state_chg(fi, VGCS_CHAN_ST_ACTIVE_BLOCKED, 0, 0);
if (conn->vgcs_chan.call) {
/* Add call to notification channel. */
- rsl_notification_cmd(conn->lchan->ts->trx->bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL);
+ rsl_notification_cmd(conn->vgcs_chan.notify_bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL);
/* Add/update SI10. */
si10_update(conn->vgcs_chan.call);
}
@@ -798,7 +795,7 @@
if (conn->vgcs_chan.call)
osmo_fsm_inst_dispatch(conn->vgcs_chan.call->vgcs_call.fi, VGCS_EV_CALLING_ASSIGNED, conn);
/* Repeat notification for the MS that has been assigned. */
- rsl_notification_cmd(conn->lchan->ts->trx->bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL);
+ rsl_notification_cmd(conn->vgcs_chan.notify_bts, conn->lchan, &conn->vgcs_chan.gc_ie, NULL);
break;
case VGCS_EV_CLEANUP:
LOG_CHAN(conn, LOGL_DEBUG, "SCCP connection clearing.\n");
@@ -1248,6 +1245,9 @@
}
conn->vgcs_chan.new_lchan = lchan;
+ /* Set BTS that receives notification. */
+ conn->vgcs_chan.notify_bts = bts;
+
/* Create VGCS FSM. */
conn->vgcs_chan.fi = osmo_fsm_inst_alloc(&vgcs_chan_fsm, conn->network, conn, LOGL_DEBUG, NULL);
if (!conn->vgcs_chan.fi)
To view, visit change 41503. To unsubscribe, or for help writing mail filters, visit settings.