diff --git a/Makefile b/Makefile index d215cb3..b4b4a68 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ include $(CLEAR_VARS) -COMPILER_FLAGS = -Wall -O3 -I/usr/include/opus -I/usr/include/openssl -Ilibtgvoip/webrtc_dsp -c -std=c++11 -fpic -DANDROID -finline-functions -ffast-math -Os -fno-strict-aliasing -DUSE_KISS_FFT -DFIXED_POINT -DTGVOIP_USE_CUSTOM_CRYPTO -DPHP_LIBTGVOIP -DWEBRTC_POSIX -DTGVOIP_USE_DESKTOP_DSP -o +COMPILER_FLAGS = -Wall -O0 -I/usr/include/opus -I/usr/include/openssl/ -Ilibtgvoip/webrtc_dsp -c -std=c++11 -fpic -DANDROID -finline-functions -ffast-math -Os -fno-strict-aliasing -DUSE_KISS_FFT -DFIXED_POINT -DPHP_LIBTGVOIP -DWEBRTC_POSIX -DTGVOIP_USE_DESKTOP_DSP -g -o #COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -I/usr/include/opus -o LINKER_FLAGS = -shared LINKER_DEPENDENCIES = -lphpcpp -I/usr/include/opus diff --git a/README.md b/README.md index 81230d5..0fdc6a7 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,7 @@ WIP This is a PHP extension that wraps the [telegram VoIP library](https://github.com/grishka/libtgvoip), created using php-cpp. +This library requires the libopus headers, openssl headers (OpenSSL_1_0_1-stable) and the php-cpp headers. + It is licensed under AGPLV3. diff --git a/main.cpp b/main.cpp index f9ce581..bcf81c4 100644 --- a/main.cpp +++ b/main.cpp @@ -70,8 +70,9 @@ public: inst->Connect(); } void setEncryptionKey(Php::Parameters ¶ms) { - char *key = strdup(params[0]); - inst->SetEncryptionKey(key, params[1]); + char key[256]; + memcpy(key, (const char *) params[0], 256); + inst->SetEncryptionKey(key, (bool) params[1]); free(key); }