diff options
Diffstat (limited to 'openbsc/src/nat')
-rw-r--r-- | openbsc/src/nat/bsc_mgcp_utils.c | 10 | ||||
-rw-r--r-- | openbsc/src/nat/bsc_nat.c | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c index 55dad380a..38f1abfab 100644 --- a/openbsc/src/nat/bsc_mgcp_utils.c +++ b/openbsc/src/nat/bsc_mgcp_utils.c @@ -23,6 +23,8 @@ #include <openbsc/gsm_data.h> #include <openbsc/bssap.h> #include <openbsc/debug.h> +#include <openbsc/mgcp.h> +#include <openbsc/mgcp_internal.h> #include <netinet/in.h> #include <arpa/inet.h> @@ -64,3 +66,11 @@ void bsc_mgcp_clear(struct sccp_connections *con) con->msc_timeslot = -1; con->bsc_timeslot = -1; } + +void bsc_mgcp_free_endpoints(struct bsc_nat *nat) +{ + int i; + + for (i = 1; i < nat->mgcp_cfg->number_endpoints; ++i) + mgcp_free_endp(&nat->mgcp_cfg->endpoints[i]); +} diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index b23c3954f..b2fc2c7c9 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -304,6 +304,7 @@ static void msc_connection_was_lost(struct bsc_msc_connection *con) llist_for_each_entry_safe(bsc, tmp, &nat->bsc_connections, list_entry) remove_bsc_connection(bsc); + bsc_mgcp_free_endpoints(nat); bsc_msc_schedule_connect(con); } |