diff options
-rw-r--r-- | include/bsc_data.h | 1 | ||||
-rw-r--r-- | src/main.c | 5 | ||||
-rw-r--r-- | src/msc_conn.c | 8 |
3 files changed, 6 insertions, 8 deletions
diff --git a/include/bsc_data.h b/include/bsc_data.h index c4a938f..059800a 100644 --- a/include/bsc_data.h +++ b/include/bsc_data.h @@ -114,6 +114,7 @@ void msc_send_rlc(struct bsc_data *bsc, struct sccp_source_reference *src, struc void msc_send_reset(struct bsc_data *bsc); void msc_send_msg(struct bsc_data *bsc, int rc, struct sccp_parse_result *, struct msgb *msg); void msc_clear_queue(struct bsc_data *data); +void msc_close_connection(struct bsc_data *data); /* connection tracking and action */ void update_con_state(int rc, struct sccp_parse_result *result, struct msgb *msg, int from_msc, int sls); @@ -748,10 +748,7 @@ out: static void sigusr2() { printf("Closing the MSC connection on demand.\n"); - close(bsc.msc_connection.bfd.fd); - bsc_unregister_fd(&bsc.msc_connection.bfd); - bsc.msc_connection.bfd.fd = -1; - release_bsc_resources(&bsc); + msc_close_connection(&bsc); } static void print_help() diff --git a/src/msc_conn.c b/src/msc_conn.c index b569bf1..ad48490 100644 --- a/src/msc_conn.c +++ b/src/msc_conn.c @@ -72,7 +72,7 @@ void msc_clear_queue(struct bsc_data *data) } } -static void close_msc(struct bsc_data *bsc) +void msc_close_connection(struct bsc_data *bsc) { struct bsc_fd *bfd = &bsc->msc_connection.bfd; @@ -89,14 +89,14 @@ static void msc_connect_timeout(void *_bsc_data) struct bsc_data *bsc_data = _bsc_data; LOGP(DMSC, LOGL_ERROR, "Timeout on the MSC connection.\n"); - close_msc(bsc_data); + msc_close_connection(bsc_data); } static void msc_pong_timeout(void *_bsc_data) { struct bsc_data *bsc_data = _bsc_data; LOGP(DMSC, LOGL_ERROR, "MSC didn't respond to ping. Closing.\n"); - close_msc(bsc_data); + msc_close_connection(bsc_data); } static void send_ping(struct bsc_data *bsc) @@ -152,7 +152,7 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) else fprintf(stderr, "Error in the IPA stream.\n"); - close_msc(bsc); + msc_close_connection(bsc); return -1; } |