Add native NeoUI SIP, Email, IRCv3, Tox, and Kopher SmallWeb plugins
This commit is contained in:
1 parent
0656042f7f
commit
be9ec9af0b
45 files changed
+6544
-13
No files matched your search
@@ -503,12 +503,19 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
statusNoticeUntilMs = nowMs() + 2000;
|
||||
};
|
||||
|
||||
auto isVoipCallId = [&](const std::string& cid) -> bool {
|
||||
return cid.rfind("sip:", 0) == 0 || cid.rfind("tox:", 0) == 0;
|
||||
};
|
||||
|
||||
auto setSpeakerRoute = [&](bool toSpeaker) {
|
||||
speakerOn = toSpeaker;
|
||||
bool jackPlugged = (readIntFile("/tmp/sxmo_jack_plugged", 0) == 1);
|
||||
long hwVol = pctToHwVol(callVolumePct, toSpeaker, !toSpeaker && jackPlugged);
|
||||
alsa.setBoolean("PRI_MI2S_RX Voice Mixer VoiceMMode1", true);
|
||||
alsa.setBoolean("VoiceMMode1 Capture Mixer TERT_MI2S_TX", !micMuted);
|
||||
bool voip = isVoipCallId(callId);
|
||||
if (!voip) {
|
||||
alsa.setBoolean("PRI_MI2S_RX Voice Mixer VoiceMMode1", true);
|
||||
alsa.setBoolean("VoiceMMode1 Capture Mixer TERT_MI2S_TX", !micMuted);
|
||||
}
|
||||
alsa.setEnum("CIC1 MUX", 0);
|
||||
if (!micMuted) {
|
||||
alsa.setEnum("DEC1 MUX", savedMicMux > 0 ? savedMicMux : 1);
|
||||
@@ -760,9 +767,14 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
XftColor* stateCol = &colBlue;
|
||||
unsigned long stateAccentPx = theme.spec.accent;
|
||||
|
||||
std::string simTag = (activeSimSlot == 1 || activeSimSlot == 2)
|
||||
? (" [SIM " + std::to_string(activeSimSlot) + "]")
|
||||
: "";
|
||||
std::string simTag;
|
||||
if (activeSimSlot == 3 || callId.rfind("sip:", 0) == 0) {
|
||||
simTag = " [SIP]";
|
||||
} else if (activeSimSlot == 4 || callId.rfind("tox:", 0) == 0) {
|
||||
simTag = " [TOX]";
|
||||
} else if (activeSimSlot == 1 || activeSimSlot == 2) {
|
||||
simTag = " [SIM " + std::to_string(activeSimSlot) + "]";
|
||||
}
|
||||
if (callState == CallState::SelectSim) {
|
||||
stateIcon = kIconOutCall;
|
||||
stateBadge = "SELECT SIM CARD";
|
||||
@@ -1233,7 +1245,11 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
setSpeakerRoute(false);
|
||||
render();
|
||||
|
||||
if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
if (cid.rfind("sip:", 0) == 0) {
|
||||
sendPluginCommand("sip", "CALL_ACCEPT " + cid);
|
||||
} else if (cid.rfind("tox:", 0) == 0) {
|
||||
sendPluginCommand("tox", "CALL_ACCEPT " + cid);
|
||||
} else if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
runAsyncArgv("sxmo_modemcall.sh", "pickup", cid.c_str());
|
||||
}
|
||||
};
|
||||
@@ -1245,7 +1261,11 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
ringMuted = true;
|
||||
stopRingingJobs();
|
||||
std::string cid = resolveActiveModemCallId();
|
||||
if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
if (cid.rfind("sip:", 0) == 0) {
|
||||
sendPluginCommand("sip", "CALL_MUTE_RING " + cid);
|
||||
} else if (cid.rfind("tox:", 0) == 0) {
|
||||
sendPluginCommand("tox", "CALL_MUTE_RING " + cid);
|
||||
} else if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
runAsyncArgv("sxmo_modemcall.sh", "mute", cid.c_str());
|
||||
}
|
||||
statusNotice = "Ringtone silenced";
|
||||
@@ -1289,7 +1309,11 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
std::string cid = resolveActiveModemCallId();
|
||||
bool wasIncoming = (callState == CallState::Incoming);
|
||||
stopRingingJobs();
|
||||
if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
if (cid.rfind("sip:", 0) == 0) {
|
||||
sendPluginCommand("sip", "CALL_HANGUP " + cid);
|
||||
} else if (cid.rfind("tox:", 0) == 0) {
|
||||
sendPluginCommand("tox", "CALL_HANGUP " + cid);
|
||||
} else if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
runAsyncArgv("sxmo_modemcall.sh", "hangup", cid.c_str());
|
||||
} else {
|
||||
runAsyncCmd("mmcli -m any --voice-hangup-all >/dev/null 2>&1");
|
||||
@@ -1303,7 +1327,10 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
dtmfSent.erase(0, dtmfSent.size() - 16);
|
||||
}
|
||||
std::string cid = resolveActiveModemCallId();
|
||||
if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test") {
|
||||
if (cid.rfind("sip:", 0) == 0) {
|
||||
sendPluginCommand("sip", std::string("CALL_DTMF ") + ch);
|
||||
} else if (!cid.empty() && cid != "-" && cid != "sim" && cid != "test" &&
|
||||
cid.rfind("tox:", 0) != 0) {
|
||||
if (cid.rfind("sub", 0) == 0) {
|
||||
char cmd[160];
|
||||
std::snprintf(cmd, sizeof(cmd),
|
||||
@@ -1473,7 +1500,7 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto syncModemCalls = [&]() {
|
||||
if (callId == "sim" || callId == "test") {
|
||||
if (callId == "sim" || callId == "test" || isVoipCallId(callId)) {
|
||||
return;
|
||||
}
|
||||
std::string foundId;
|
||||
@@ -1690,6 +1717,14 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
auto parseSimTag = [&](const std::string& cidStr, const std::string& tagStr) {
|
||||
if (tagStr == "SIP" || cidStr.rfind("sip:", 0) == 0) {
|
||||
activeSimSlot = 3;
|
||||
return;
|
||||
}
|
||||
if (tagStr == "TOX" || cidStr.rfind("tox:", 0) == 0) {
|
||||
activeSimSlot = 4;
|
||||
return;
|
||||
}
|
||||
simInfo = queryDualSimInfo();
|
||||
if (tagStr == "SIM1") {
|
||||
activeSimSlot = 1;
|
||||
|
||||
Reference in new issue
Block a user