aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_mgcp_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/nat/bsc_mgcp_utils.c')
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 49c44668e..6fc5eaca2 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -466,3 +466,21 @@ int bsc_mgcp_init(struct bsc_nat *nat)
return 0;
}
+
+void bsc_mgcp_clear_endpoints_for(struct bsc_connection *bsc)
+{
+ int i;
+ for (i = 1; i < bsc->nat->mgcp_cfg->number_endpoints; ++i) {
+ struct bsc_endpoint *bsc_endp = &bsc->nat->bsc_endpoints[i];
+
+ if (bsc_endp->bsc != bsc)
+ continue;
+
+ bsc_endp->bsc = NULL;
+ bsc_endp->pending_delete = 0;
+ if (bsc_endp->transaction_id)
+ talloc_free(bsc_endp->transaction_id);
+ bsc_endp->transaction_id = NULL;
+ mgcp_free_endp(&bsc->nat->mgcp_cfg->endpoints[i]);
+ }
+}