aboutsummaryrefslogtreecommitdiffstats
path: root/src/libosmo-mgcp/mgcp_endp.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-02-01 14:38:12 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2018-02-05 10:32:42 +0100
commit37d11c80da420c1e51c3c7c0ff6186294bb2ed8d (patch)
treede2a92067d315fcf45d22f5fb0cb6782de363034 /src/libosmo-mgcp/mgcp_endp.c
parent1355d7e4f781fa007d69bae8531ebe8d3cf01511 (diff)
cosmetic: rename mgcp_ep.c/h to mgcp_endp.c/h
The short term of endpoint has always been "endp" througout the whole project and not "ep". - rename mcgp_ep.c to mgcp_endp.c - rename mgcp_ep.h to mgcp_endp.h Change-Id: Id52047bb2d0407655ac272c858ed3412b8ae9e6d
Diffstat (limited to 'src/libosmo-mgcp/mgcp_endp.c')
-rw-r--r--src/libosmo-mgcp/mgcp_endp.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/libosmo-mgcp/mgcp_endp.c b/src/libosmo-mgcp/mgcp_endp.c
new file mode 100644
index 000000000..77310c69e
--- /dev/null
+++ b/src/libosmo-mgcp/mgcp_endp.c
@@ -0,0 +1,55 @@
+/* Endpoint types */
+
+/*
+ * (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * Author: Philipp Maier
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <osmocom/mgcp/mgcp_internal.h>
+#include <osmocom/mgcp/mgcp_endp.h>
+
+/* Endpoint typeset definition */
+const struct mgcp_endpoint_typeset ep_typeset = {
+ /* Specify endpoint properties for RTP endpoint */
+ .rtp.max_conns = 2,
+ .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb
+};
+
+/*! release endpoint, all open connections are closed.
+ * \param[in] endp endpoint to release */
+void mgcp_endp_release(struct mgcp_endpoint *endp)
+{
+ LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n",
+ ENDPOINT_NUMBER(endp));
+
+ /* Normally this function should only be called when
+ * all connections have been removed already. In case
+ * that there are still connections open (e.g. when
+ * RSIP is executed), free them all at once. */
+ mgcp_conn_free_all(endp);
+
+ /* Reset endpoint parameters and states */
+ talloc_free(endp->callid);
+ endp->callid = NULL;
+ talloc_free(endp->local_options.string);
+ endp->local_options.string = NULL;
+ talloc_free(endp->local_options.codec);
+ endp->local_options.codec = NULL;
+ endp->wildcarded_crcx = false;
+}