blob: 68e36da766b3fd2750acdc8613610e2b9110373a [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
24#include <osmocom/mgcp/mgcp_ep.h>
25#include <osmocom/mgcp/mgcp_internal.h>
26
27/* Endpoint typeset definition */
28const struct mgcp_endpoint_typeset ep_typeset = {
29 /* Specify endpoint properties for RTP endpoint */
30 .rtp.max_conns = 2,
31 .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb
32};
Philipp Maieredc00f42018-01-24 11:58:56 +010033
34/*! release endpoint, all open connections are closed.
35 * \param[in] endp endpoint to release */
36void mgcp_release_endp(struct mgcp_endpoint *endp)
37{
38 LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n",
39 ENDPOINT_NUMBER(endp));
40
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;
54 endp->wildcarded_crcx = false;
55}