summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-04-27 15:56:36 +0200
committerOliver Smith <osmith@sysmocom.de>2020-04-28 15:42:55 +0200
commit7bee40eafb8896c6664e3407371de7e87665ba1a (patch)
tree117e3f2ab93b1bbb8bb32bf906e407c94b03a42d
parent1bafb2c125ee722784ba4de2515d9f5a24f6d13b (diff)
mobile/voice.c: send EFR frames back instead of FRosmith/virt-voice
-rw-r--r--src/host/layer23/src/common/l1ctl.c4
-rw-r--r--src/host/layer23/src/mobile/voice.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index b6ee455a..b650f579 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -899,9 +899,9 @@ int l1ctl_tx_traffic_req(struct osmocom_ms *ms, struct msgb *msg,
DEBUGP(DL1C, "TRAFFIC REQ len=%zu (%s)\n", frame_len,
osmo_hexdump(frame, frame_len));
- if ((frame[0] >> 4) != 0xd) {
+ if ((frame[0] >> 4) != 0xc) {
LOGP(DL1C, LOGL_ERROR, "Traffic Request has incorrect magic "
- "(%u != 0xd)\n", frame[0] >> 4);
+ "(%u != 0xc)\n", frame[0] >> 4);
msgb_free(msg);
return -EINVAL;
}
diff --git a/src/host/layer23/src/mobile/voice.c b/src/host/layer23/src/mobile/voice.c
index bafe5de3..ca19755a 100644
--- a/src/host/layer23/src/mobile/voice.c
+++ b/src/host/layer23/src/mobile/voice.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <osmocom/core/msgb.h>
+#include <osmocom/codec/codec.h>
#include <osmocom/bb/common/osmocom_data.h>
#include <osmocom/bb/mobile/mncc.h>
@@ -41,7 +42,7 @@ static int gsm_recv_voice(struct osmocom_ms *ms, struct msgb *msg)
/* push mncc header in front of data */
mncc = (struct gsm_data_frame *)
msgb_push(msg, sizeof(struct gsm_data_frame));
- mncc->msg_type = GSM_TCHF_FRAME;
+ mncc->msg_type = GSM_TCHF_FRAME_EFR;
mncc->callref = ms->mncc_entity.ref;
/* HACK: send voice frame back */
@@ -63,11 +64,11 @@ int gsm_send_voice(struct osmocom_ms *ms, struct gsm_data_frame *data)
{
struct msgb *nmsg;
- nmsg = msgb_alloc_headroom(33 + 64, 64, "TCH/F");
+ nmsg = msgb_alloc_headroom(GSM_EFR_BYTES + 64, 64, "TCH/F");
if (!nmsg)
return -ENOMEM;
- nmsg->l2h = msgb_put(nmsg, 33);
- memcpy(nmsg->l2h, data->data, 33);
+ nmsg->l2h = msgb_put(nmsg, GSM_EFR_BYTES);
+ memcpy(nmsg->l2h, data->data, GSM_EFR_BYTES);
return gsm48_rr_tx_voice(ms, nmsg);
}