2 Copyright (C) 2003-2005 Thomas Ries <tries@gmx.net>
4 This file is part of Siproxd.
6 Siproxd is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 Siproxd is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Siproxd; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <sys/types.h>
24 #include <netinet/in.h>
26 #include <osipparser2/osip_parser.h>
32 static char const ident[]="$Id: rtpproxy.c,v 1.25 2005/01/08 10:05:12 hb9xar Exp $";
34 /* configuration storage */
35 extern struct siproxd_config configuration;
38 * initialize and create rtp_proxy
41 * STS_SUCCESS on success
43 int rtpproxy_init( void ) {
46 if (configuration.rtp_proxy_enable == 0) {
48 } else if (configuration.rtp_proxy_enable == 1) { // Relay
49 sts = rtp_relay_init ();
51 ERROR("CONFIG: rtp_proxy_enable has invalid value",
52 configuration.rtp_proxy_enable);
59 * start an rtp stream on the proxy
62 * STS_SUCCESS on success
63 * STS_FAILURE on error
65 int rtp_start_fwd (osip_call_id_t *callid, char *client_id,
66 int direction, int media_stream_no,
67 struct in_addr local_ipaddr, int *local_port,
68 struct in_addr remote_ipaddr, int remote_port) {
71 if (configuration.rtp_proxy_enable == 0) {
73 } else if (configuration.rtp_proxy_enable == 1) { // Relay
74 sts = rtp_relay_start_fwd (callid, client_id,
75 direction, media_stream_no,
76 local_ipaddr, local_port,
77 remote_ipaddr, remote_port);
79 ERROR("CONFIG: rtp_proxy_enable has invalid value",
80 configuration.rtp_proxy_enable);
88 * stop a rtp stream on the proxy
91 * STS_SUCCESS on success
92 * STS_FAILURE on error
94 int rtp_stop_fwd (osip_call_id_t *callid, int direction) {
95 int sts = STS_FAILURE;
97 if (configuration.rtp_proxy_enable == 0) {
99 } else if (configuration.rtp_proxy_enable == 1) { // Relay
100 sts = rtp_relay_stop_fwd(0, callid, direction, 0);
102 ERROR("CONFIG: rtp_proxy_enable has invalid value",
103 configuration.rtp_proxy_enable);