diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-01-27 07:52:30 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-01-27 12:31:50 +0100 |
commit | 4e42b637fde1dd76b5c65ffc47b86e69d7356e46 (patch) | |
tree | ed122fdf9d13d801dc3564094d6c097949ece732 | |
parent | f44de9942bf8353f41f10a99874329029fbe3929 (diff) |
[bsc_msc] Start the Inactivity Timer only when the connection is established
Start the SCCP IT timer only after the MSC has confirmed the SCCP
connection. It is safe to call bsc_del_timer even if it was never
started. This could happen on a connection refusal.
-rw-r--r-- | openbsc/src/bsc_msc_ip.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/openbsc/src/bsc_msc_ip.c b/openbsc/src/bsc_msc_ip.c index e7db79cd9..33bdf50c0 100644 --- a/openbsc/src/bsc_msc_ip.c +++ b/openbsc/src/bsc_msc_ip.c @@ -166,7 +166,16 @@ void msc_outgoing_sccp_state(struct sccp_connection *conn, int old_state) sccp_connection_free(conn); return; } else if (conn->connection_state == SCCP_CONNECTION_STATE_ESTABLISHED) { + struct bss_sccp_connection_data *con_data; + DEBUGP(DMSC, "Connection established: %p\n", conn); + + /* start the inactivity test timer */ + con_data = (struct bss_sccp_connection_data *) conn->data_ctx; + con_data->sccp_it.cb = sccp_it_fired; + con_data->sccp_it.data = con_data; + bsc_schedule_timer(&con_data->sccp_it, SCCP_IT_TIMER, 0); + bsc_send_queued(conn); } } @@ -216,11 +225,6 @@ int open_sccp_connection(struct msgb *layer3) sccp_connection->data_ctx = con_data; layer3->lchan->msc_data = con_data; - /* start the inactivity test timer */ - con_data->sccp_it.cb = sccp_it_fired; - con_data->sccp_it.data = con_data; - bsc_schedule_timer(&con_data->sccp_it, SCCP_IT_TIMER, 0); - /* FIXME: Use transaction for this */ use_lchan(layer3->lchan); sccp_connection_connect(sccp_connection, &sccp_ssn_bssap, data); |