Add ZRTP/SRTP encryption, direct accountless calling, and alphanumeric input fix to SIP client
This commit is contained in:
1 parent
e92f7e9d96
commit
61768fa88e
15 files changed
+1468
-203
No files matched your search
@@ -437,6 +437,7 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
std::string callNumber;
|
||||
std::string contactName;
|
||||
int activeSimSlot = 0;
|
||||
std::string sipZrtpSas;
|
||||
DualSimInfo simInfo = queryDualSimInfo();
|
||||
std::string endReason = "CALL ENDED";
|
||||
std::string statusNotice;
|
||||
@@ -769,7 +770,7 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
|
||||
std::string simTag;
|
||||
if (activeSimSlot == 3 || callId.rfind("sip:", 0) == 0) {
|
||||
simTag = " [SIP]";
|
||||
simTag = sipZrtpSas.empty() ? " [SIP]" : (" [ZRTP:" + sipZrtpSas + "]");
|
||||
} else if (activeSimSlot == 4 || callId.rfind("tox:", 0) == 0) {
|
||||
simTag = " [TOX]";
|
||||
} else if (activeSimSlot == 1 || activeSimSlot == 2) {
|
||||
@@ -1676,8 +1677,15 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
render();
|
||||
return;
|
||||
}
|
||||
if (line.rfind("NOTICE ", 0) == 0) {
|
||||
statusNotice = trimStr(line.substr(7));
|
||||
statusNoticeUntilMs = nowMs() + 12000;
|
||||
render();
|
||||
return;
|
||||
}
|
||||
if (line == "ENDED" || line.rfind("ENDED ", 0) == 0) {
|
||||
std::string reason = (line.size() > 6) ? trimStr(line.substr(6)) : "CALL ENDED";
|
||||
sipZrtpSas.clear();
|
||||
if (callState != CallState::Idle) {
|
||||
transitionToEnded(reason);
|
||||
} else {
|
||||
@@ -1717,10 +1725,17 @@ 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) {
|
||||
if (tagStr == "SIP" || tagStr.rfind("SIP:", 0) == 0 ||
|
||||
cidStr.rfind("sip:", 0) == 0) {
|
||||
activeSimSlot = 3;
|
||||
if (tagStr.rfind("SIP:", 0) == 0 && tagStr.size() > 4) {
|
||||
sipZrtpSas = tagStr.substr(4);
|
||||
} else if (tagStr == "SIP") {
|
||||
sipZrtpSas.clear();
|
||||
}
|
||||
return;
|
||||
}
|
||||
sipZrtpSas.clear();
|
||||
if (tagStr == "TOX" || cidStr.rfind("tox:", 0) == 0) {
|
||||
activeSimSlot = 4;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user