aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-07 22:54:07 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-07 22:54:07 +0200
commit91b5a31a2ce73b988fa1c7f28e3a2cc2c8b77b90 (patch)
tree794f00fa8e4afc237af410733f15dee769399b01 /openbsc/include/openbsc
parent54fa7991295d64a01a39f7863f585ff8ab08ed13 (diff)
parent575b89585f7fa7cb4104eeb9f853561af16603d3 (diff)
Merge branch 'on-waves/mgcp'
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/mgcp.h15
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h13
2 files changed, 27 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index f7e800bd8..71b7fc14e 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -77,6 +77,7 @@ struct mgcp_config;
typedef int (*mgcp_change)(struct mgcp_config *cfg, int endpoint, int state, int local_rtp);
typedef int (*mgcp_policy)(struct mgcp_config *cfg, int endpoint, int state, const char *transactio_id);
+typedef int (*mgcp_reset)(struct mgcp_config *cfg);
struct mgcp_config {
int source_port;
@@ -84,6 +85,7 @@ struct mgcp_config {
char *source_addr;
unsigned int number_endpoints;
char *bts_ip;
+ char *call_agent_addr;
struct in_addr bts_in;
char *audio_name;
@@ -95,8 +97,12 @@ struct mgcp_config {
char *forward_ip;
int forward_port;
+ /* spec handling */
+ int force_realloc;
+
mgcp_change change_cb;
mgcp_policy policy_cb;
+ mgcp_reset reset_cb;
void *data;
struct mgcp_endpoint *endpoints;
@@ -115,8 +121,15 @@ void mgcp_free_endp(struct mgcp_endpoint *endp);
* format helper functions
*/
struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg);
-struct msgb *mgcp_create_rsip(void);
struct msgb *mgcp_create_response_with_data(int code, const char *msg, const char *trans, const char *data);
+/* adc helper */
+static inline int mgcp_timeslot_to_endpoint(int multiplex, int timeslot)
+{
+ if (timeslot == 0)
+ timeslot = 1;
+ return timeslot + (31 * multiplex);
+}
+
#endif
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index 10d0ca6ae..3a2832436 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -57,8 +57,21 @@ struct mgcp_endpoint {
/* backpointer */
struct mgcp_config *cfg;
+
+ /* statistics */
+ unsigned int in_bts;
+ unsigned int in_remote;
};
#define ENDPOINT_NUMBER(endp) abs(endp - endp->cfg->endpoints)
+struct mgcp_msg_ptr {
+ unsigned int start;
+ unsigned int length;
+};
+
+int mgcp_analyze_header(struct mgcp_config *cfg, struct msgb *msg,
+ struct mgcp_msg_ptr *ptr, int size,
+ const char **transaction_id, struct mgcp_endpoint **endp);
+
#endif