aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc/osmo_bsc_audio.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-03-03 23:29:05 +0100
committerHarald Welte <laforge@gnumonks.org>2011-03-03 23:29:05 +0100
commit31c00f7d6fa63937f2c973157d196a427f6eef95 (patch)
tree6b7c81d92b6a8b83d0588b2b59d47fd0cca7a052 /openbsc/src/osmo-bsc/osmo_bsc_audio.c
parent9349d7ff7c5866110a1f2421ccc68a487e4030be (diff)
re-structure the OpenBSC directory layout
The new structure divides the code into a number of libraries for the BSC core functionality, MSC core functionality, Abis transport, TRAU and other bits. This doesn't introduce any functional code change but simply moves around files and alters Makefile.am accordingly. Next step would be to disentangle a lot of the inter-library dependencies and make the individual bits of code more independent.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_audio.c')
-rw-r--r--openbsc/src/osmo-bsc/osmo_bsc_audio.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_audio.c b/openbsc/src/osmo-bsc/osmo_bsc_audio.c
new file mode 100644
index 000000000..515cfa7fb
--- /dev/null
+++ b/openbsc/src/osmo-bsc/osmo_bsc_audio.c
@@ -0,0 +1,70 @@
+/*
+ * ipaccess audio handling
+ *
+ * (C) 2009-2010 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2009-2010 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <openbsc/osmo_msc_data.h>
+#include <openbsc/osmo_bsc.h>
+#include <openbsc/abis_rsl.h>
+#include <openbsc/gsm_data.h>
+#include <openbsc/debug.h>
+#include <openbsc/signal.h>
+
+#include <arpa/inet.h>
+
+static int handle_abisip_signal(unsigned int subsys, unsigned int signal,
+ void *handler_data, void *signal_data)
+{
+ struct gsm_subscriber_connection *con;
+ struct gsm_lchan *lchan = signal_data;
+ int rc;
+
+ if (subsys != SS_ABISIP)
+ return 0;
+
+ con = lchan->conn;
+ if (!con || !con->sccp_con)
+ return 0;
+
+ switch (signal) {
+ case S_ABISIP_CRCX_ACK:
+ /* we can ask it to connect now */
+ LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n",
+ con->sccp_con->rtp_port, lchan->abis_ip.conn_id);
+
+ rc = rsl_ipacc_mdcx(lchan, ntohl(INADDR_ANY),
+ con->sccp_con->rtp_port,
+ lchan->abis_ip.rtp_payload2);
+ if (rc < 0) {
+ LOGP(DMSC, LOGL_ERROR, "Failed to send MDCX: %d\n", rc);
+ return rc;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+int osmo_bsc_audio_init(struct gsm_network *net)
+{
+ net->hardcoded_rtp_payload = 98;
+ register_signal_handler(SS_ABISIP, handle_abisip_signal, net);
+ return 0;
+}