1
0
mirror of https://github.com/danog/php-libtgvoip.git synced 2024-11-30 04:19:26 +01:00
This commit is contained in:
Daniil Gentili 2017-06-25 13:12:36 +02:00
parent f8894e8c1f
commit 25b6565a8c
3 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,7 @@
include $(CLEAR_VARS) 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 #COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -I/usr/include/opus -o
LINKER_FLAGS = -shared LINKER_FLAGS = -shared
LINKER_DEPENDENCIES = -lphpcpp -I/usr/include/opus LINKER_DEPENDENCIES = -lphpcpp -I/usr/include/opus

View File

@ -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 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. It is licensed under AGPLV3.

View File

@ -70,8 +70,9 @@ public:
inst->Connect(); inst->Connect();
} }
void setEncryptionKey(Php::Parameters &params) { void setEncryptionKey(Php::Parameters &params) {
char *key = strdup(params[0]); char key[256];
inst->SetEncryptionKey(key, params[1]); memcpy(key, (const char *) params[0], 256);
inst->SetEncryptionKey(key, (bool) params[1]);
free(key); free(key);
} }