Philipp Maier | 87bd9be | 2017-08-22 16:35:41 +0200 | [diff] [blame] | 1 | /* 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 Maier | 87bd9be | 2017-08-22 16:35:41 +0200 | [diff] [blame] | 24 | #include <osmocom/mgcp/mgcp_internal.h> |
Philipp Maier | fdd603c | 2018-02-01 13:31:15 +0100 | [diff] [blame^] | 25 | #include <osmocom/mgcp/mgcp_ep.h> |
Philipp Maier | 87bd9be | 2017-08-22 16:35:41 +0200 | [diff] [blame] | 26 | |
| 27 | /* Endpoint typeset definition */ |
| 28 | const 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 Maier | edc00f4 | 2018-01-24 11:58:56 +0100 | [diff] [blame] | 33 | |
| 34 | /*! release endpoint, all open connections are closed. |
| 35 | * \param[in] endp endpoint to release */ |
| 36 | void 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 | } |