Skip to content

Instantly share code, notes, and snippets.

View alfredh's full-sized avatar

Alfred E. Heggestad alfredh

View GitHub Profile
diff --git a/src/main/main.c b/src/main/main.c
index 78a47e3..7858aa9 100644
--- a/src/main/main.c
+++ b/src/main/main.c
@@ -115,6 +115,7 @@ struct re {
#ifdef HAVE_PTHREAD
pthread_mutex_t mutex; /**< Mutex for thread synchronization */
pthread_mutex_t *mutexp; /**< Pointer to active mutex */
+ pthread_t tid;
#endif
@alfredh
alfredh / re-tlsstack.patch
Created August 21, 2020 16:39
TLS stack for libre
diff --git a/Makefile b/Makefile
index 2680b7c..bff75d7 100644
--- a/Makefile
+++ b/Makefile
@@ -33,6 +33,7 @@ MODULES += aes srtp
MODULES += odict
MODULES += json
MODULES += rtmp
+MODULES += cert
diff --git a/include/re_ice.h b/include/re_ice.h
index 6c72856..adeaffd 100644
--- a/include/re_ice.h
+++ b/include/re_ice.h
@@ -24,12 +24,6 @@ enum ice_compid {
ICE_COMPID_RTCP = 2
};
-/** ICE Nomination */
-enum ice_nomination {
diff --git a/mk/modules.mk b/mk/modules.mk
index f5487f9..026c140 100644
--- a/mk/modules.mk
+++ b/mk/modules.mk
@@ -65,7 +65,7 @@ USE_L16 := 1
ifneq ($(OS),win32)
USE_AAC := $(shell [ -f $(SYSROOT)/include/fdk-aac/FDK_audio.h ] || \
- [ -f $(SYSROOT)/local/include/fdk-aac/FDK_audio.h ] || \
+ [ -f $(SYSROOT_LOCAL)/include/fdk-aac/FDK_audio.h ] || \
@alfredh
alfredh / baresip-sip-websock.patch
Created September 21, 2019 09:20
baresip with SIP over Websockets
diff --git a/src/reg.c b/src/reg.c
index 198164c..874a6aa 100644
--- a/src/reg.c
+++ b/src/reg.c
@@ -48,6 +48,8 @@ static int sipmsg_af(const struct sip_msg *msg)
case SIP_TRANSP_TCP:
case SIP_TRANSP_TLS:
+ case SIP_TRANSP_WS:
+ case SIP_TRANSP_WSS:
@alfredh
alfredh / re-sip-websock.patch
Last active December 29, 2019 11:17
libre with SIP over Websockets
diff --git a/include/re_sip.h b/include/re_sip.h
index 5a011e5..5f5dd3e 100644
--- a/include/re_sip.h
+++ b/include/re_sip.h
@@ -16,6 +16,9 @@ enum sip_transp {
SIP_TRANSP_UDP = 0,
SIP_TRANSP_TCP,
SIP_TRANSP_TLS,
+ SIP_TRANSP_WS,
+ SIP_TRANSP_WSS,
@alfredh
alfredh / ngrep.txt
Created August 24, 2019 08:14
Ngrep between Chrome and Baresip
T 10.0.1.8:64444 -> 91.121.30.149:5060 [AP] #20
REGISTER sip:sip.antisip.com SIP/2.0.
Via: SIP/2.0/TCP 10.0.1.8:64442;branch=z9hG4bK404f8c353afdb62d;rport.
Contact: <sip:alfredh2-0x7fde1b61c650@10.0.1.8:64442;transport=tcp>;expires=60;+sip.instance="<urn:uuid:bb2fe713-df57-403b-eec0-64c433aedd09>";+sip.ice.
Max-Forwards: 70.
Route: <sip:sip.antisip.com;transport=tcp;lr>.
To: <sip:alfredh2@sip.antisip.com>.
From: "Anti Alf" <sip:alfredh2@sip.antisip.com>;tag=4164371e3f5b8fda.
Call-ID: 112d5b617cf345e1.
CSeq: 53513 REGISTER.
./baresip -f /Users/alfredh/.baresip-gst -v
baresip v0.6.3 Copyright (C) 2010 - 2019 Alfred E. Heggestad et al.
Local network address: IPv4=en0|10.0.1.8
ui: stdio
opus: fmtp="stereo=0;sprop-stereo=0;maxaveragebitrate=64000;useinbandfec=1"
aucodec: opus/48000/1
aucodec: PCMU/8000/1
aucodec: PCMA/8000/1
auplay: coreaudio
ausrc: coreaudio
@alfredh
alfredh / auloop.diff
Created August 3, 2019 15:57
auloop.diff
diff --git a/modules/auloop/auloop.c b/modules/auloop/auloop.c
index 8028d69..5ec5dce 100644
--- a/modules/auloop/auloop.c
+++ b/modules/auloop/auloop.c
@@ -42,7 +42,14 @@ struct audio_loop {
bool started;
uint64_t n_read;
+ uint64_t n_read_count;
uint64_t n_write;
@alfredh
alfredh / re-sip-tls-verify.patch
Created July 15, 2019 15:22
libre SIP/TLS verify
diff --git a/include/re_tls.h b/include/re_tls.h
index 319d601c..d4f6d041 100644
--- a/include/re_tls.h
+++ b/include/re_tls.h
@@ -56,6 +56,7 @@ const char *tls_cipher_name(const struct tls_conn *tc);
int tls_set_ciphers(struct tls *tls, const char *cipherv[], size_t count);
int tls_set_servername(struct tls_conn *tc, const char *servername);
int tls_set_verify_server(struct tls_conn *tc, const char *host);
+bool tls_verify_peer_san(const struct tls_conn *tc, const char *host);