aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2012-12-07 15:04:07 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-12-10 14:46:00 +0100
commitce55361e93529522790fa681ef5837237e9492b1 (patch)
treeb243e0468889c812413dfa5b5770950621a81c33 /openbsc/include
parent29de346b329fc05750b52446f3516f897415b43b (diff)
mgcp: Test and implement re-transmission handling
MGCP is used over UDP and a response might be lost. The MGCP RFC asks for keeping a list of responses and then using the previous response to answer a duplicate request. I tried to conserve memory and just wanted to remember the last transaction identifier and result-code and re-generate the result from that. This made the code look bad and this is why the entire response will now be stored. It sadly increases the memory usage but can not be avoided at this time. Remove the msg->l3h pointer for the RQNT callback as strtok has modified the content of it.
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/mgcp.h2
-rw-r--r--openbsc/include/openbsc/mgcp_internal.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/mgcp.h b/openbsc/include/openbsc/mgcp.h
index 9c6cfd8b9..858a29dd9 100644
--- a/openbsc/include/openbsc/mgcp.h
+++ b/openbsc/include/openbsc/mgcp.h
@@ -83,7 +83,7 @@ typedef int (*mgcp_realloc)(struct mgcp_trunk_config *cfg, int endpoint);
typedef int (*mgcp_change)(struct mgcp_trunk_config *cfg, int endpoint, int state);
typedef int (*mgcp_policy)(struct mgcp_trunk_config *cfg, int endpoint, int state, const char *transactio_id);
typedef int (*mgcp_reset)(struct mgcp_trunk_config *cfg);
-typedef int (*mgcp_rqnt)(struct mgcp_endpoint *endp, char tone, const char *data);
+typedef int (*mgcp_rqnt)(struct mgcp_endpoint *endp, char tone);
#define PORT_ALLOC_STATIC 0
#define PORT_ALLOC_DYNAMIC 1
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h
index 025b813a5..bcef8724e 100644
--- a/openbsc/include/openbsc/mgcp_internal.h
+++ b/openbsc/include/openbsc/mgcp_internal.h
@@ -126,6 +126,10 @@ struct mgcp_endpoint {
/* SSRC/seq/ts patching for loop */
int allow_patch;
+ /* fields for re-transmission */
+ char *last_trans;
+ char *last_response;
+
/* tap for the endpoint */
struct mgcp_rtp_tap taps[MGCP_TAP_COUNT];
};