summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-12-01 11:50:33 +0100
committerAndreas Eversberg <jolly@eversberg.eu>2016-09-25 08:11:47 +0200
commita5a5cd1eff13e8079c6f0058d5e5d94e8dd99ba5 (patch)
tree811404dde076068502b3c0472781087a01be3592 /src/host/layer23/include
parent7f67caed4f1c4650dc2c4475e1371a2e80a17fc2 (diff)
layer23/mobile Fixes and improvements of built in call control (mnccms)
The list of calls are now per MS instance, as they should be. Added init and exit function. Pending call instances are removed on exit. Added call state to call instances for easier state handling. Call functions now have optional indexes to handle explicitly given calls. gsm_call structure and function prototypes are now moved to a new header file (mnccms.h).
Diffstat (limited to 'src/host/layer23/include')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h1
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/Makefile.am2
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/mncc.h30
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/mnccms.h59
4 files changed, 61 insertions, 31 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 7e8faa88..d42cf09b 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -36,6 +36,7 @@ struct osmomncc_entity {
int (*mncc_recv)(struct osmocom_ms *ms, int msg_type, void *arg);
struct mncc_sock_state *sock_state;
uint32_t ref;
+ struct llist_head call_list;
};
diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index b58b9529..6adb6991 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,3 +1,3 @@
noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
gsm48_rr.h mncc.h settings.h subscriber.h support.h \
- transaction.h vty.h mncc_sock.h
+ transaction.h vty.h mncc_sock.h mnccms.h
diff --git a/src/host/layer23/include/osmocom/bb/mobile/mncc.h b/src/host/layer23/include/osmocom/bb/mobile/mncc.h
index a73a882c..5431d696 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/mncc.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/mncc.h
@@ -26,38 +26,8 @@
#ifndef _MNCC_H
#define _MNCC_H
-#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/mncc.h>
-struct gsm_call {
- struct llist_head entry;
-
- struct osmocom_ms *ms;
-
- uint32_t callref;
-
- uint8_t init; /* call initiated, no response yet */
- uint8_t hold; /* call on hold */
- uint8_t ring; /* call ringing/knocking */
-
- struct osmo_timer_list dtmf_timer;
- uint8_t dtmf_state;
- uint8_t dtmf_index;
- char dtmf[32]; /* dtmf sequence */
-
- struct osmo_timer_list ringer_timer;
- uint8_t ringer_state;
-};
-
-#define DTMF_ST_IDLE 0 /* no DTMF active */
-#define DTMF_ST_START 1 /* DTMF started, waiting for resp. */
-#define DTMF_ST_MARK 2 /* wait tone duration */
-#define DTMF_ST_STOP 3 /* DTMF stopped, waiting for resp. */
-#define DTMF_ST_SPACE 4 /* wait space between tones */
-
-#define RINGER_MARK 0, 500000
-#define RINGER_SPACE 0, 250000
-
#define MNCC_SETUP_REQ 0x0101
#define MNCC_SETUP_IND 0x0102
#define MNCC_SETUP_RSP 0x0103
diff --git a/src/host/layer23/include/osmocom/bb/mobile/mnccms.h b/src/host/layer23/include/osmocom/bb/mobile/mnccms.h
new file mode 100644
index 00000000..929bc8c1
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/mobile/mnccms.h
@@ -0,0 +1,59 @@
+#ifndef _MNCCMS_H
+#define _MNCCMS_H
+
+#include <osmocom/core/linuxlist.h>
+
+#define DTMF_ST_IDLE 0 /* no DTMF active */
+#define DTMF_ST_START 1 /* DTMF started, waiting for resp. */
+#define DTMF_ST_MARK 2 /* wait tone duration */
+#define DTMF_ST_STOP 3 /* DTMF stopped, waiting for resp. */
+#define DTMF_ST_SPACE 4 /* wait space between tones */
+
+#define RINGER_MARK 0, 500000
+#define RINGER_SPACE 0, 250000
+
+#define CALL_ST_IDLE 0 /* no state */
+#define CALL_ST_MO_INIT 1 /* call initiated, no response yet */
+#define CALL_ST_MO_PROC 2 /* call proceeding */
+#define CALL_ST_MO_ALERT 3 /* call alerting */
+#define CALL_ST_MT_RING 4 /* call ringing */
+#define CALL_ST_MT_KNOCK 5 /* call knocking */
+#define CALL_ST_ACTIVE 6 /* call connected and active */
+#define CALL_ST_HOLD 7 /* call connected, but on hold */
+#define CALL_ST_DISC_RX 8 /* call disconnected (disc received) */
+#define CALL_ST_DISC_TX 9 /* call disconnected (disc sent) */
+
+struct gsm_call {
+ struct llist_head entry;
+
+ struct osmocom_ms *ms;
+
+ uint32_t callref;
+
+ uint8_t call_state;
+
+ char number[33]; /* remote number */
+
+ struct osmo_timer_list dtmf_timer;
+ uint8_t dtmf_state;
+ uint8_t dtmf_index;
+ char dtmf[32]; /* dtmf sequence */
+
+ struct osmo_timer_list ringer_timer;
+ uint8_t ringer_state;
+};
+
+int mncc_recv_dummy(struct osmocom_ms *ms, int msg_type, void *arg);
+int mncc_recv_socket(struct osmocom_ms *ms, int msg_type, void *arg);
+int mncc_recv_mobile(struct osmocom_ms *ms, int msg_type, void *arg);
+int mnccms_init(struct osmocom_ms *ms);
+void mnccms_exit(struct osmocom_ms *ms);
+int mncc_call(struct osmocom_ms *ms, char *number);
+int mncc_hangup(struct osmocom_ms *ms, int index);
+int mncc_answer(struct osmocom_ms *ms, int index);
+int mncc_hold(struct osmocom_ms *ms, int index);
+int mncc_retrieve(struct osmocom_ms *ms, int index);
+int mncc_dtmf(struct osmocom_ms *ms, int index, char *dtmf);
+int mncc_list(struct osmocom_ms *ms);
+
+#endif /* _MNCCMS_H */