blob: eec46bf65e427b21a781ed54ec3c14e6396c2e7f [file] [log] [blame]
Philipp Maier87bd9be2017-08-22 16:35:41 +02001/* Endpoint types */
2
3/*
4 * (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
5 * All Rights Reserved
6 *
7 * Author: Philipp Maier
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
18 *
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 *
22 */
23
Philipp Maier87bd9be2017-08-22 16:35:41 +020024#include <osmocom/mgcp/mgcp_internal.h>
Philipp Maier37d11c82018-02-01 14:38:12 +010025#include <osmocom/mgcp/mgcp_endp.h>
Philipp Maier87bd9be2017-08-22 16:35:41 +020026
27/* Endpoint typeset definition */
28const struct mgcp_endpoint_typeset ep_typeset = {
29 /* Specify endpoint properties for RTP endpoint */
30 .rtp.max_conns = 2,
Philipp Maierdf5d2192018-01-24 11:39:32 +010031 .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb,
32 .rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb
Philipp Maier87bd9be2017-08-22 16:35:41 +020033};
Philipp Maieredc00f42018-01-24 11:58:56 +010034
35/*! release endpoint, all open connections are closed.
36 * \param[in] endp endpoint to release */
Philipp Maier1355d7e2018-02-01 14:30:06 +010037void mgcp_endp_release(struct mgcp_endpoint *endp)
Philipp Maieredc00f42018-01-24 11:58:56 +010038{
Pau Espin Pedrol3239f622019-04-24 18:47:46 +020039 LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Releasing endpoint\n");
Philipp Maieredc00f42018-01-24 11:58:56 +010040
41 /* Normally this function should only be called when
42 * all connections have been removed already. In case
43 * that there are still connections open (e.g. when
44 * RSIP is executed), free them all at once. */
45 mgcp_conn_free_all(endp);
46
47 /* Reset endpoint parameters and states */
48 talloc_free(endp->callid);
49 endp->callid = NULL;
50 talloc_free(endp->local_options.string);
51 endp->local_options.string = NULL;
52 talloc_free(endp->local_options.codec);
53 endp->local_options.codec = NULL;
Philipp Maier207ab512018-02-02 14:19:26 +010054 endp->wildcarded_req = false;
Philipp Maieredc00f42018-01-24 11:58:56 +010055}