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 | 37d11c8 | 2018-02-01 14:38:12 +0100 | [diff] [blame] | 25 | #include <osmocom/mgcp/mgcp_endp.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, |
Philipp Maier | df5d219 | 2018-01-24 11:39:32 +0100 | [diff] [blame] | 31 | .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb, |
| 32 | .rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb |
Philipp Maier | 87bd9be | 2017-08-22 16:35:41 +0200 | [diff] [blame] | 33 | }; |
Philipp Maier | edc00f4 | 2018-01-24 11:58:56 +0100 | [diff] [blame] | 34 | |
| 35 | /*! release endpoint, all open connections are closed. |
| 36 | * \param[in] endp endpoint to release */ |
Philipp Maier | 1355d7e | 2018-02-01 14:30:06 +0100 | [diff] [blame] | 37 | void mgcp_endp_release(struct mgcp_endpoint *endp) |
Philipp Maier | edc00f4 | 2018-01-24 11:58:56 +0100 | [diff] [blame] | 38 | { |
Pau Espin Pedrol | 3239f62 | 2019-04-24 18:47:46 +0200 | [diff] [blame] | 39 | LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Releasing endpoint\n"); |
Philipp Maier | edc00f4 | 2018-01-24 11:58:56 +0100 | [diff] [blame] | 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; |
Philipp Maier | 207ab51 | 2018-02-02 14:19:26 +0100 | [diff] [blame] | 54 | endp->wildcarded_req = false; |
Philipp Maier | edc00f4 | 2018-01-24 11:58:56 +0100 | [diff] [blame] | 55 | } |