Fix global Power menu key handling, SIP G.711 audio routing, Webarchy audio playback, and ReMEdy Call menu key
This commit is contained in:
1 parent
d7335b5ebe
commit
0af39d9fa0
76 files changed
+506
-104
No files matched your search
@@ -506,7 +506,8 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto isVoipCallId = [&](const std::string& cid) -> bool {
|
||||
return cid.rfind("sip:", 0) == 0 || cid.rfind("tox:", 0) == 0;
|
||||
return cid.rfind("sip:", 0) == 0 || cid.rfind("tox:", 0) == 0 ||
|
||||
activeSimSlot == 3 || activeSimSlot == 4;
|
||||
};
|
||||
|
||||
auto setSpeakerRoute = [&](bool toSpeaker) {
|
||||
@@ -572,8 +573,15 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
setOutDevFile("Earpiece");
|
||||
statusNotice = "Audio routed to Earpiece";
|
||||
}
|
||||
runAsyncCmd("PATH=\"$HOME/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH\" "
|
||||
"sxmo_hook_statusbar.sh volume >/dev/null 2>&1");
|
||||
if (voip) {
|
||||
runAsyncCmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ 0 >/dev/null 2>&1; "
|
||||
"wpctl set-volume @DEFAULT_AUDIO_SINK@ 100% >/dev/null 2>&1; "
|
||||
"PATH=\"$HOME/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH\" "
|
||||
"sxmo_hook_statusbar.sh volume >/dev/null 2>&1");
|
||||
} else {
|
||||
runAsyncCmd("PATH=\"$HOME/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH\" "
|
||||
"sxmo_hook_statusbar.sh volume >/dev/null 2>&1");
|
||||
}
|
||||
statusNoticeUntilMs = nowMs() + 2000;
|
||||
};
|
||||
|
||||
@@ -1305,14 +1313,28 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
alsa.setBoolean("PRI_MI2S_RX Voice Mixer VoiceMMode1", false);
|
||||
alsa.setBoolean("VoiceMMode1 Capture Mixer TERT_MI2S_TX", false);
|
||||
alsa.setEnum("EAR_S", 0);
|
||||
alsa.setEnum("RX1 MIX1 INP1", 0);
|
||||
alsa.setInteger("RX1 Digital Volume", 0);
|
||||
alsa.setEnum("RX3 MIX1 INP1", 3);
|
||||
alsa.setBoolean("SPK DAC Switch", true);
|
||||
int spkPct = readIntFile(getHomeDirPath() + "/.config/sxmo/speaker_vol", 85);
|
||||
alsa.setInteger("RX3 Digital Volume", pctToHwVol(spkPct, true, false));
|
||||
{
|
||||
bool jackPlugged = (readIntFile("/tmp/sxmo_jack_plugged", 0) == 1);
|
||||
std::ofstream out("/tmp/sxmo_audio_out_device", std::ios::trunc);
|
||||
if (out.is_open()) out << (jackPlugged ? "Headphones" : "Speaker") << "\n";
|
||||
}
|
||||
runAsyncCmd("sxmo_jobs.sh stop ringing >/dev/null 2>&1; "
|
||||
"pkill -TERM -f sxmo_hook_ring.sh >/dev/null 2>&1; "
|
||||
"pkill -TERM -f 'pw-play.*ring' >/dev/null 2>&1; "
|
||||
"pkill -TERM -f 'mpv.*ring' >/dev/null 2>&1; "
|
||||
"pkill -TERM -x sxmo_vibrate >/dev/null 2>&1; "
|
||||
"sxmo_modemaudio.sh disable_call_audio_mode >/dev/null 2>&1");
|
||||
"sxmo_modemaudio.sh disable_call_audio_mode >/dev/null 2>&1; "
|
||||
"if [ \"$(cat /tmp/sxmo_jack_plugged 2>/dev/null)\" = \"1\" ]; then "
|
||||
" sxmo_audio.sh out set Headphones >/dev/null 2>&1; "
|
||||
"else "
|
||||
" sxmo_audio.sh out set Speaker >/dev/null 2>&1; "
|
||||
"fi");
|
||||
render();
|
||||
};
|
||||
|
||||
@@ -1320,9 +1342,9 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
std::string cid = resolveActiveModemCallId();
|
||||
bool wasIncoming = (callState == CallState::Incoming);
|
||||
stopRingingJobs();
|
||||
if (cid.rfind("sip:", 0) == 0) {
|
||||
if (cid.rfind("sip:", 0) == 0 || activeSimSlot == 3) {
|
||||
sendPluginCommand("sip", "CALL_HANGUP " + cid);
|
||||
} else if (cid.rfind("tox:", 0) == 0) {
|
||||
} else if (cid.rfind("tox:", 0) == 0 || activeSimSlot == 4) {
|
||||
sendPluginCommand("tox", "CALL_HANGUP " + cid);
|
||||
} else if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
runAsyncArgv("sxmo_modemcall.sh", "hangup", cid.c_str());
|
||||
|
||||
Reference in new issue
Block a user