summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README3
-rw-r--r--config.mk3
-rw-r--r--nodes.h120
-rw-r--r--ratox.c17
5 files changed, 80 insertions, 65 deletions
diff --git a/Makefile b/Makefile
index 767d8ab..c5765cb 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ nodes.h:
.o:
@echo LD $@
- @$(LD) -o $@ $< util.a $(LDFLAGS)
+ @$(LD) -o $@ $< util.a $(LDFLAGS) $(LDLIBS)
.c.o:
@echo CC $<
diff --git a/README b/README
index 32d3f22..d87f2e5 100644
--- a/README
+++ b/README
@@ -124,8 +124,7 @@ NOTE: Some of these features are not intended to be developed
in ratox itself but rather in external scripts[1] that are built upon
ratox.
-Group chats do not have file transfers or audio, but will be updated
-in the near future.
+Group chats do not have audio yet.
Examples
diff --git a/config.mk b/config.mk
index 8f15a5a..43c789e 100644
--- a/config.mk
+++ b/config.mk
@@ -9,4 +9,5 @@ CC = cc
LD = $(CC)
CPPFLAGS = -DVERSION=\"${VERSION}\"
CFLAGS = -g -I/usr/local/include -Wall -Wunused $(CPPFLAGS)
-LDFLAGS = -g -L/usr/local/lib -ltoxcore -ltoxav -ltoxencryptsave
+LDFLAGS = -g -L/usr/local/lib
+LDLIBS = -ltoxcore -ltoxav -ltoxencryptsave -lsodium -lopus -lvpx -lm -lpthread
diff --git a/nodes.h b/nodes.h
index 0f36e8d..cff0298 100644
--- a/nodes.h
+++ b/nodes.h
@@ -1,21 +1,15 @@
static struct node nodes[] = {
{
- .addr4 = "tox.zodiaclabs.org",
- .addr6 = "v6.tox.zodiaclabs.org",
- .port = 33445,
- .idstr = "A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074"
- },
- {
.addr4 = "biribiri.org",
.addr6 = NULL,
.port = 33445,
.idstr = "F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67"
},
{
- .addr4 = "178.62.250.138",
- .addr6 = "2a03:b0c0:2:d0::16:1",
+ .addr4 = "nodes.tox.chat",
+ .addr6 = NULL,
.port = 33445,
- .idstr = "788236D34978D1D5BD822F0A5BEBD2C53C64CC31CD3149350EE27D4D9A2F9B6B"
+ .idstr = "6FC41E2BD381D37E9748FC0E0328CE086AF9598BECC8FEB7DDF2E440475F300E"
},
{
.addr4 = "130.133.110.14",
@@ -36,12 +30,6 @@ static struct node nodes[] = {
.idstr = "1D5A5F2F5D6233058BF0259B09622FB40B482E4FA0931EB8FD3AB8E7BF7DAF6F"
},
{
- .addr4 = "108.61.165.198",
- .addr6 = "2001:19f0:5000:8121:5054:ff:fe1c:9ded",
- .port = 33445,
- .idstr = "8E7D0B859922EF569298B4D261A8CCB5FEA14FB91ED412A7603A585A25698832"
- },
- {
.addr4 = "194.249.212.109",
.addr6 = "2001:1470:fbfe::109",
.port = 33445,
@@ -54,12 +42,6 @@ static struct node nodes[] = {
.idstr = "DA4E4ED4B697F2E9B000EEFE3A34B554ACD3F45F5C96EAEA2516DD7FF9AF7B43"
},
{
- .addr4 = "192.99.168.140",
- .addr6 = NULL,
- .port = 33445,
- .idstr = "6A4D0607A296838434A6A7DDF99F50EF9D60A2C510BBF31FE538A25CB6B4652F"
- },
- {
.addr4 = "95.215.46.114",
.addr6 = "2a02:7aa0:1619::bdbd:17b8",
.port = 33445,
@@ -96,12 +78,6 @@ static struct node nodes[] = {
.idstr = "53737F6D47FA6BD2808F378E339AF45BF86F39B64E79D6D491C53A1D522E7039"
},
{
- .addr4 = "81.4.110.149",
- .addr6 = "2a00:d880:3:2::8bdc:f19",
- .port = 33445,
- .idstr = "9E7BD4793FFECA7F32238FA2361040C09025ED3333744483CA6F3039BFF0211E"
- },
- {
.addr4 = "104.233.104.126",
.addr6 = NULL,
.port = 33445,
@@ -114,12 +90,6 @@ static struct node nodes[] = {
.idstr = "AEC204B9A4501412D5F0BB67D9C81B5DB3EE6ADA64122D32A3E9B093D544327D"
},
{
- .addr4 = "5.135.59.163",
- .addr6 = NULL,
- .port = 33445,
- .idstr = "2D320F971EF2CA18004416C2AAE7BA52BF7949DB34EA8E2E21AF67BD367BE211"
- },
- {
.addr4 = "185.58.206.164",
.addr6 = "2a02:f680:1:1100::3313",
.port = 33445,
@@ -132,18 +102,30 @@ static struct node nodes[] = {
.idstr = "0CB9D8D636F8E3D71CF44A3019408A846B7BEDFA2810853355DB58C0A36BFE38"
},
{
+ .addr4 = "92.54.84.70",
+ .addr6 = NULL,
+ .port = 33445,
+ .idstr = "5625A62618CB4FCA70E147A71B29695F38CC65FF0CBD68AD46254585BE564802"
+ },
+ {
.addr4 = "195.93.190.6",
.addr6 = "2a01:d0:ffff:a8a::2",
.port = 33445,
.idstr = "FB4CE0DDEFEED45F26917053E5D24BDDA0FA0A3D83A672A9DA2375928B37023D"
},
{
- .addr4 = "loki.uplinklabs.net",
- .addr6 = "loki.uplinklabs.net",
+ .addr4 = "tox.uplinklabs.net",
+ .addr6 = "tox.uplinklabs.net",
.port = 33445,
.idstr = "1A56EA3EDF5DF4C0AEABBF3C2E4E603890F87E983CAC8A0D532A335F2C6E3E1F"
},
{
+ .addr4 = "109.75.40.105",
+ .addr6 = "2001:470:70d6::1",
+ .port = 33445,
+ .idstr = "2B9CD794424FD579044EC2FC5252B23DF8B4AAF239C25074F70B1090C3F8C83A"
+ },
+ {
.addr4 = "toxnode.nek0.net",
.addr6 = "toxnode.nek0.net",
.port = 33445,
@@ -216,6 +198,12 @@ static struct node nodes[] = {
.idstr = "1A480A53FAF2CBBFCC382D786C43E69EEE23F22C7C23A7CFEB6180A373E23E54"
},
{
+ .addr4 = "tox.deadteam.org",
+ .addr6 = "tox.deadteam.org",
+ .port = 33445,
+ .idstr = "C7D284129E83877D63591F14B3F658D77FF9BA9BA7293AEB2BDFBFE1A803AF47"
+ },
+ {
.addr4 = "46.229.52.198",
.addr6 = NULL,
.port = 33445,
@@ -228,28 +216,46 @@ static struct node nodes[] = {
.idstr = "A856243058D1DE633379508ADCAFCF944E40E1672FF402750EF712E30C42012A"
},
{
- .addr4 = "144.217.86.39",
- .addr6 = "fe80::f816:3eff:fe61:92e3",
+ .addr4 = "185.14.30.213",
+ .addr6 = "2a00:1ca8:a7::e8b",
+ .port = 443,
+ .idstr = "2555763C8C460495B14157D234DD56B86300A2395554BCAE4621AC345B8C1B1B"
+ },
+ {
+ .addr4 = "77.37.142.179",
+ .addr6 = NULL,
.port = 33445,
- .idstr = "7E5668E0EE09E19F320AD47902419331FFEE147BB3606769CFBE921A2A2FD34C"
+ .idstr = "98F5830A426C6BF165F895F04B897AFC4F57331B4BE0561F583C9F323194227B"
},
{
- .addr4 = "77.37.160.178",
+ .addr4 = "85.21.144.224",
.addr6 = NULL,
- .port = 33440,
- .idstr = "CE678DEAFA29182EFD1B0C5B9BC6999E5A20B50A1A6EC18B91C8EBB591712416"
+ .port = 33445,
+ .idstr = "8F738BBC8FA9394670BCAB146C67A507B9907C8E564E28C2B59BEBB2FF68711B"
},
{
- .addr4 = "77.37.142.179",
+ .addr4 = "tox.natalenko.name",
+ .addr6 = "tox.natalenko.name",
+ .port = 33445,
+ .idstr = "1CB6EBFD9D85448FA70D3CAE1220B76BF6FCE911B46ACDCF88054C190589650B"
+ },
+ {
+ .addr4 = "37.187.122.30",
.addr6 = NULL,
.port = 33445,
- .idstr = "98F5830A426C6BF165F895F04B897AFC4F57331B4BE0561F583C9F323194227B"
+ .idstr = "BEB71F97ED9C99C04B8489BB75579EB4DC6AB6F441B603D63533122F1858B51D"
},
{
- .addr4 = "185.14.30.213",
- .addr6 = "2a00:1ca8:a7::e8b",
- .port = 443,
- .idstr = "2555763C8C460495B14157D234DD56B86300A2395554BCAE4621AC345B8C1B1B"
+ .addr4 = "plfgr.eu.org",
+ .addr6 = "plfgr.eu.org",
+ .port = 33445,
+ .idstr = "F5A2E533EC720927FA970F508D949D5958F37889F039F50C905010244842656E"
+ },
+ {
+ .addr4 = "completelyunoriginal.moe",
+ .addr6 = "completelyunoriginal.moe",
+ .port = 33445,
+ .idstr = "FBC7DED0B0B662D81094D91CC312D6CDF12A7B16C7FFB93817143116B510C13E"
},
{
.addr4 = "46.101.197.175",
@@ -258,21 +264,21 @@ static struct node nodes[] = {
.idstr = "CD133B521159541FB1D326DE9850F5E56A6C724B5B8E5EB5CD8D950408E95707"
},
{
- .addr4 = "92.54.84.70",
- .addr6 = NULL,
+ .addr4 = "tox.zodiaclabs.org",
+ .addr6 = "v6.tox.zodiaclabs.org",
.port = 33445,
- .idstr = "5625A62618CB4FCA70E147A71B29695F38CC65FF0CBD68AD46254585BE564802"
+ .idstr = "A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074"
},
{
- .addr4 = "91.121.66.124",
- .addr6 = "2001:41d0:1:757c::1",
+ .addr4 = "108.61.165.198",
+ .addr6 = "2001:19f0:5000:8121:5054:ff:fe1c:9ded",
.port = 33445,
- .idstr = "4E3F7D37295664BBD0741B6DBCB6431D6CD77FC4105338C2FC31567BF5C8224A"
+ .idstr = "8E7D0B859922EF569298B4D261A8CCB5FEA14FB91ED412A7603A585A25698832"
},
{
- .addr4 = "tox.deadteam.org",
- .addr6 = "tox.deadteam.org",
- .port = 33445,
- .idstr = "C7D284129E83877D63591F14B3F658D77FF9BA9BA7293AEB2BDFBFE1A803AF47"
+ .addr4 = "77.37.160.178",
+ .addr6 = NULL,
+ .port = 33440,
+ .idstr = "CE678DEAFA29182EFD1B0C5B9BC6999E5A20B50A1A6EC18B91C8EBB591712416"
}
};
diff --git a/ratox.c b/ratox.c
index 27487de..2dcaee6 100644
--- a/ratox.c
+++ b/ratox.c
@@ -437,6 +437,7 @@ cbcallstate(ToxAV *av, uint32_t fnum, uint32_t state, void *udata)
if (f->av.state & RINGING) {
f->av.state &= ~RINGING;
f->av.state |= TRANSMITTING;
+ logmsg(": %s : Audio > Transmitting\n", f->name);
}
}
@@ -638,6 +639,7 @@ sendfriendcalldata(struct friend *f)
framesize * sizeof(int16_t) - (f->av.state & INCOMPLETE ? f->av.n : 0));
if (n == 0) {
f->av.state &= ~OUTGOING;
+ f->av.state &= ~INCOMPLETE;
return;
} else if (n < 0 || f->av.state & RINGING) {
/* discard data as long as the call is not established */
@@ -1962,7 +1964,7 @@ loop(void)
if (f->tx.state == TRANSFER_NONE)
FD_APPEND(f->fd[FFILE_IN]);
- if (!f->av.state || ((f->av.state & TRANSMITTING) && (f->av.state & OUTGOING)))
+ if (!f->av.state || (f->av.state & TRANSMITTING))
FD_APPEND(f->fd[FCALL_IN]);
}
FD_APPEND(f->fd[FREMOVE]);
@@ -2059,6 +2061,10 @@ loop(void)
}
f->av.state &= ~RINGING;
f->av.state |= TRANSMITTING;
+ logmsg(": %s : Audio > Answered\n", f->name);
+ ftruncate(f->fd[FCALL_STATE], 0);
+ lseek(f->fd[FCALL_STATE], 0, SEEK_SET);
+ dprintf(f->fd[FCALL_STATE], "transmitting\n");
}
}
@@ -2173,6 +2179,11 @@ loop(void)
fiforeset(f->dirfd, &f->fd[FCALL_IN], ffiles[FCALL_IN]);
break;
}
+
+ f->av.state |= RINGING;
+ logmsg(": %s : Audio : Tx > Inviting\n", f->name);
+ }
+ if (!(f->av.state & OUTGOING)) {
c0 = time(NULL);
f->av.n = 0;
f->av.lastsent.tv_sec = 0;
@@ -2183,10 +2194,8 @@ loop(void)
eprintf("malloc:");
f->av.state |= OUTGOING;
- f->av.state |= RINGING;
- logmsg(": %s : Audio : Tx > Inviting\n", f->name);
} else {
- if (f->av.state & OUTGOING)
+ if (f->av.state & TRANSMITTING)
sendfriendcalldata(f);
}
}