From 4925c0af99217263e3bf27446465e055572003d4 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 15 Oct 2020 17:16:00 +0200 Subject: [PATCH] qmimodem: Support Emergency calls Tested with a QMI modem (SierraW MC7304) on an Osmocom 2G network operated by osmo-gsm-tester. When setting the specific call type, an Emergency Setup is submitted towards the network. --- drivers/qmimodem/voice.h | 3 ++- drivers/qmimodem/voicecall.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/qmimodem/voice.h b/drivers/qmimodem/voice.h index bb98e693..9c8dffdf 100644 --- a/drivers/qmimodem/voice.h +++ b/drivers/qmimodem/voice.h @@ -74,7 +74,8 @@ enum qmi_voice_call_state { enum qmi_voice_call_type { QMI_CALL_TYPE_VOICE = 0x0, - QMI_CALL_TYPE_VOICE_FORCE, + QMI_CALL_TYPE_VOICE_FORCE = 0x01, + QMI_CALL_TYPE_EMERGENCY = 0x09, }; struct qmi_ussd_data { diff --git a/drivers/qmimodem/voicecall.c b/drivers/qmimodem/voicecall.c index 499e0b5f..382258df 100644 --- a/drivers/qmimodem/voicecall.c +++ b/drivers/qmimodem/voicecall.c @@ -245,7 +245,10 @@ static void dial(struct ofono_voicecall *vc, const struct ofono_phone_number *ph memcpy(&vd->dialed, ph, sizeof(*ph)); arg.call_type_set = true; - arg.call_type = QMI_CALL_TYPE_VOICE_FORCE; + if (ofono_voicecall_is_emergency_number(vc, ph->number) == TRUE) + arg.call_type = QMI_CALL_TYPE_EMERGENCY; + else + arg.call_type = QMI_CALL_TYPE_VOICE_FORCE; if (!qmi_voice_dial_call( &arg,