aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_protocol.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-25 23:33:54 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-25 23:33:54 +0100
commit6e94d6d10d94c9d68d9e31251376f78ce8782ca1 (patch)
treec784c25f1b27a40b2162162a204e50e04b7bea55 /openbsc/src/mgcp/mgcp_protocol.c
parent3fbd2441879cf72a8d08130455c498e29afbfe9c (diff)
mgcp: Be able to parse RQNT messages and reply to them
We do not implement the request for notification at all but we will tell the server that we have received something.
Diffstat (limited to 'openbsc/src/mgcp/mgcp_protocol.c')
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 7d126593..91c4d0cc 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -87,6 +87,7 @@ static struct msgb *handle_create_con(struct mgcp_config *cfg, struct msgb *msg)
static struct msgb *handle_delete_con(struct mgcp_config *cfg, struct msgb *msg);
static struct msgb *handle_modify_con(struct mgcp_config *cfg, struct msgb *msg);
static struct msgb *handle_rsip(struct mgcp_config *cfg, struct msgb *msg);
+static struct msgb *handle_noti_req(struct mgcp_config *cfg, struct msgb *msg);
static void create_transcoder(struct mgcp_endpoint *endp);
static void delete_transcoder(struct mgcp_endpoint *endp);
@@ -121,6 +122,7 @@ static const struct mgcp_request mgcp_requests [] = {
MGCP_REQUEST("CRCX", handle_create_con, "CreateConnection")
MGCP_REQUEST("DLCX", handle_delete_con, "DeleteConnection")
MGCP_REQUEST("MDCX", handle_modify_con, "ModifiyConnection")
+ MGCP_REQUEST("RQNT", handle_noti_req, "NotificationRequest")
/* SPEC extension */
MGCP_REQUEST("RSIP", handle_rsip, "ReSetInProgress")
@@ -821,6 +823,29 @@ static struct msgb *handle_rsip(struct mgcp_config *cfg, struct msgb *msg)
return NULL;
}
+/*
+ * This can request like DTMF detection and forward, fax detection... it
+ * can also request when the notification should be send and such. We don't
+ * do this right now.
+ */
+static struct msgb *handle_noti_req(struct mgcp_config *cfg, struct msgb *msg)
+{
+ struct mgcp_msg_ptr data_ptrs[6];
+ const char *trans_id;
+ struct mgcp_endpoint *endp;
+ int found;
+
+ found = mgcp_analyze_header(cfg, msg, data_ptrs, ARRAY_SIZE(data_ptrs), &trans_id, &endp);
+ if (found != 0)
+ return create_err_response(400, "RQNT", trans_id);
+
+ if (!endp->allocated) {
+ LOGP(DMGCP, LOGL_ERROR, "Endpoint is not used. 0x%x\n", ENDPOINT_NUMBER(endp));
+ return create_err_response(400, "RQNT", trans_id);
+ }
+ return create_ok_response(200, "RQNT", trans_id);
+}
+
struct mgcp_config *mgcp_config_alloc(void)
{
struct mgcp_config *cfg;