From 13d67b7ea331fdc6a0ef271a5839221c44f2d0d5 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 30 Mar 2010 15:41:03 +0200 Subject: [mgcp] Remove the sending of RSIP This message is ignored by the call agent and we were sending this on the first request which we maybe should not ignore... --- openbsc/include/openbsc/mgcp.h | 1 - 1 file changed, 1 deletion(-) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index f7e800bd8..6a07cd111 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -115,7 +115,6 @@ 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); -- cgit v1.2.3 From 9bdcc9ca75a55c5d5bc5b7589e410c39b714c0c3 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 31 Mar 2010 06:39:35 +0200 Subject: [mgcp] Add some parsing for RSIP messages coming in This will just call a callback and leave all the handling to the application. --- openbsc/include/openbsc/mgcp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 6a07cd111..37194bee8 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; @@ -97,6 +98,7 @@ struct mgcp_config { mgcp_change change_cb; mgcp_policy policy_cb; + mgcp_reset reset_cb; void *data; struct mgcp_endpoint *endpoints; -- cgit v1.2.3 From 616d2225182a3ba64d6059d52594255ee472af89 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 31 Mar 2010 09:27:04 +0200 Subject: [mgcp] Add a helper function to convert from GSM0808 ts/mux to MGCP endpoint Move the conversion of GSM0808 timeslot and multiplex from the bssap.c into the mgcp.h so it can be reused by multiple users. The weird math comes from the mapping of the MSC... --- openbsc/include/openbsc/mgcp.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index 37194bee8..c60a4550c 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -119,5 +119,13 @@ void mgcp_free_endp(struct mgcp_endpoint *endp); struct msgb *mgcp_handle_message(struct mgcp_config *cfg, struct msgb *msg); 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 -- cgit v1.2.3 From b79994c95292c8dda971268e5ac46e7f47ca6266 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 31 Mar 2010 11:46:41 +0200 Subject: [mgcp] Add a new config option to set the call agent ip addr In the case of the nat we only want to communicate with one upstream call agent and this can now be configured. --- openbsc/include/openbsc/mgcp.h | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index c60a4550c..c4081b109 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -85,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; -- cgit v1.2.3 From f2f1591ce7fde28d67da30c1998eaa631c2d5897 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 1 Apr 2010 03:27:04 +0200 Subject: [mgcp] Export header parsing via mgcp internal This will be used by the NAT code to implement custom protocol handling on top of that. --- openbsc/include/openbsc/mgcp_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 10d0ca6ae..7ce1732f9 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -61,4 +61,13 @@ struct mgcp_endpoint { #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 -- cgit v1.2.3 From b4b135efbf17f81a3faccb488ca35a5086adc618 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 7 Apr 2010 09:37:17 +0200 Subject: [mgcp] Count incoming RTP packets from the BTS and remote --- openbsc/include/openbsc/mgcp_internal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 7ce1732f9..3a2832436 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -57,6 +57,10 @@ 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) -- cgit v1.2.3 From 408cc4ace99a9163136af601549a5d1b67a168c7 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 7 Apr 2010 10:51:27 +0200 Subject: [mgcp] Add an option to allow using reallocing an endpoint For some mode of operation it can be acceptable to reallocate an already allocated endpoint. This can be the case when we only deal with one call agent that is keeping track of the endpoint but slightly confused. --- openbsc/include/openbsc/mgcp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'openbsc/include/openbsc') diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h index c4081b109..71b7fc14e 100644 --- a/openbsc/include/openbsc/mgcp.h +++ b/openbsc/include/openbsc/mgcp.h @@ -97,6 +97,9 @@ 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; -- cgit v1.2.3