Giter Club home page Giter Club logo

pytgvoip's Introduction

Python based Telegram VOIP calls

The easy way: Build with Docker

docker build -t pytgvoip .

Or, build manually

Build and Install libtgvoip

git clone https://github.com/gabomdq/libtgvoip.git
cd libtgvoip
./configure
make
make install

Build tdlib

git clone https://github.com/tdlib/td.git
cd td
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .

Build and Install tdlib Python wrapper

git clone https://github.com/gabomdq/python-telegram.git
cd python-telegram

(Before installing!) Copy libtdjson.so from the previous step to python-telegram/telegram/lib/linux

python3 setup.py install --user

Install this extension

python3 setup.py install --user

You need to register an app on Telegram's website, retrieve the API id and hash. Then you can call someone.

python3 tgcall.py api_id api_hash phone user_id dbkey

pytgvoip's People

Contributors

gabomdq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pytgvoip's Issues

Can't build with Docker (on Raspberry Pi 3)

Hello,
I want to try this solution for doing telegram voip calls. I can't build with docker, here is the log:

$ docker build --no-cache -t pytgvoip .
Sending build context to Docker daemon  73.22kB
Step 1/25 : FROM alpine:3.8
 ---> d2696274f894
Step 2/25 : RUN apk add --update               ca-certificates               musl               build-base               python3               python3-dev               bash               git               libxml2-dev               libxslt-dev               openssl-dev               opus-dev               pulseaudio-dev               alsa-lib-dev               cmake               gperf  && pip3.6 install --upgrade pip  && rm /var/cache/apk/*
 ---> Running in 93159cede076
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/armhf/APKINDEX.tar.gz
(1/103) Installing alsa-lib (1.1.6-r0)
(2/103) Installing pkgconf (1.5.3-r0)
(3/103) Installing alsa-lib-dev (1.1.6-r0)
(4/103) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(5/103) Installing ncurses-terminfo (6.1_p20180818-r1)
(6/103) Installing ncurses-libs (6.1_p20180818-r1)
(7/103) Installing readline (7.0.003-r0)
(8/103) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(9/103) Installing binutils (2.30-r5)
(10/103) Installing libmagic (5.32-r0)
(11/103) Installing file (5.32-r0)
(12/103) Installing gmp (6.1.2-r1)
(13/103) Installing isl (0.18-r0)
(14/103) Installing libgomp (6.4.0-r9)
(15/103) Installing libatomic (6.4.0-r9)
(16/103) Installing libgcc (6.4.0-r9)
(17/103) Installing mpfr3 (3.1.5-r1)
(18/103) Installing mpc1 (1.0.3-r1)
(19/103) Installing libstdc++ (6.4.0-r9)
(20/103) Installing gcc (6.4.0-r9)
(21/103) Installing musl-dev (1.1.19-r10)
(22/103) Installing libc-dev (0.7.1-r0)
(23/103) Installing g++ (6.4.0-r9)
(24/103) Installing make (4.2.1-r2)
(25/103) Installing fortify-headers (0.9-r0)
(26/103) Installing build-base (0.5-r1)
(27/103) Installing ca-certificates (20171114-r3)
(28/103) Installing libattr (2.4.47-r7)
(29/103) Installing libacl (2.2.52-r5)
(30/103) Installing libbz2 (1.0.6-r6)
(31/103) Installing expat (2.2.5-r0)
(32/103) Installing lz4-libs (1.8.2-r0)
(33/103) Installing xz-libs (5.2.4-r0)
(34/103) Installing libarchive (3.3.2-r3)
(35/103) Installing nghttp2-libs (1.32.0-r0)
(36/103) Installing libssh2 (1.8.0-r3)
(37/103) Installing libcurl (7.61.1-r1)
(38/103) Installing rhash-libs (1.3.6-r1)
(39/103) Installing libuv (1.20.2-r0)
(40/103) Installing cmake (3.11.1-r2)
(41/103) Installing cmake-bash-completion (3.11.1-r2)
(42/103) Installing pcre2 (10.31-r0)
(43/103) Installing git (2.18.1-r0)
(44/103) Installing gperf (3.1-r2)
(45/103) Installing zlib-dev (1.2.11-r1)
(46/103) Installing libxml2 (2.9.8-r1)
(47/103) Installing libxml2-dev (2.9.8-r1)
(48/103) Installing libgpg-error (1.30-r0)
(49/103) Installing libgcrypt (1.8.3-r0)
(50/103) Installing libxslt (1.1.32-r0)
(51/103) Installing libxslt-dev (1.1.32-r0)
(52/103) Installing libcrypto1.0 (1.0.2r-r0)
(53/103) Installing libssl1.0 (1.0.2r-r0)
(54/103) Installing openssl-dev (1.0.2r-r0)
(55/103) Installing opus (1.2.1-r1)
(56/103) Installing opus-dev (1.2.1-r1)
(57/103) Installing perl (5.26.3-r0)
(58/103) Installing libffi (3.2.1-r4)
(59/103) Installing gdbm (1.13-r1)
(60/103) Installing sqlite-libs (3.25.3-r0)
(61/103) Installing python2 (2.7.15-r1)
(62/103) Installing gettext-asprintf (0.19.8.1-r2)
(63/103) Installing libintl (0.19.8.1-r2)
(64/103) Installing libunistring (0.9.7-r0)
(65/103) Installing gettext-libs (0.19.8.1-r2)
(66/103) Installing gettext (0.19.8.1-r2)
(67/103) Installing gettext-dev (0.19.8.1-r2)
(68/103) Installing bzip2-dev (1.0.6-r6)
(69/103) Installing libffi-dev (3.2.1-r4)
(70/103) Installing libuuid (2.32-r0)
(71/103) Installing libblkid (2.32-r0)
(72/103) Installing libfdisk (2.32-r0)
(73/103) Installing libmount (2.32-r0)
(74/103) Installing libsmartcols (2.32-r0)
(75/103) Installing util-linux-dev (2.32-r0)
(76/103) Installing pcre (8.42-r0)
(77/103) Installing glib (2.56.1-r0)
(78/103) Installing libpcre16 (8.42-r0)
(79/103) Installing libpcre32 (8.42-r0)
(80/103) Installing libpcrecpp (8.42-r0)
(81/103) Installing pcre-dev (8.42-r0)
(82/103) Installing glib-dev (2.56.1-r0)
(83/103) Installing dbus-libs (1.10.24-r1)
(84/103) Installing json-c (0.13.1-r0)
(85/103) Installing libltdl (2.4.6-r5)
(86/103) Installing libogg (1.3.3-r2)
(87/103) Installing flac (1.3.2-r2)
(88/103) Installing libvorbis (1.3.6-r2)
(89/103) Installing libsndfile (1.0.28-r5)
(90/103) Installing speexdsp (1.2_rc3-r5)
(91/103) Installing pulseaudio-libs (9.0-r5)
(92/103) Installing libcap (2.25-r1)
(93/103) Installing fftw-single-libs (3.3.6p2-r2)
(94/103) Installing libidl (0.8.14-r2)
(95/103) Installing orbit2 (2.14.19-r4)
(96/103) Installing dbus-glib (0.108-r1)
(97/103) Installing polkit (0.105-r8)
(98/103) Installing gconf (3.2.6-r3)
(99/103) Installing eudev-libs (3.2.5-r2)
(100/103) Installing pulseaudio (9.0-r5)
(101/103) Installing pulseaudio-dev (9.0-r5)
(102/103) Installing python3 (3.6.6-r0)
(103/103) Installing python3-dev (3.6.6-r0)
Executing busybox-1.28.4-r2.trigger
Executing ca-certificates-20171114-r3.trigger
Executing glib-2.56.1-r0.trigger
No schema files found: doing nothing.
OK: 377 MiB in 116 packages
Collecting pip
  Downloading https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
  Found existing installation: pip 10.0.1
    Uninstalling pip-10.0.1:
      Successfully uninstalled pip-10.0.1
Successfully installed pip-19.0.3
Removing intermediate container 93159cede076
 ---> 939c2db03ad6
Step 3/25 : RUN echo "manylinux1_compatible = True" > /usr/lib/python3.6/_manylinux.py  && cd /usr/bin  && ln -sf easy_install-3.6 easy_install  && ln -sf idle3.6 idle  && ln -sf pydoc3.6 pydoc  && ln -sf python3.6 python  && ln -sf python-config3.6 python-config  && ln -sf pip3.6 pip  && ln -sf /usr/include/locale.h /usr/include/xlocale.h
 ---> Running in 6926e2a7ab0a
Removing intermediate container 6926e2a7ab0a
 ---> 004f987c8e9d
Step 4/25 : WORKDIR /usr/src
 ---> Running in 6a4a7727cd2d
Removing intermediate container 6a4a7727cd2d
 ---> 536794e9c4f5
Step 5/25 : RUN set -ex; git clone https://github.com/gabomdq/libtgvoip.git
 ---> Running in ae3ba239d0e0
+ git clone https://github.com/gabomdq/libtgvoip.git
Cloning into 'libtgvoip'...
Removing intermediate container ae3ba239d0e0
 ---> cfae86b864ca
Step 6/25 : RUN set -ex; ./configure && make -j4 && make install
 ---> Running in 7c7cad54283f
+ ./configure
/bin/sh: ./configure: not found
The command '/bin/sh -c set -ex; ./configure && make -j4 && make install' returned a non-zero code: 127

Can you tell me something about this error?
Regards,

Eduardo

Getting error

hi

While executing make command was getting error related with aclocal. Manually edited Makefile and changed reference to specific version of 1.16 for aclocal and automake. Then it got compiled successfully. However when I execute this command getting this error

$pythpython3 tgcall.py api_id='apiId' api_hash='apiHash' phone='mynumber' user_id=tocalleduserID dbkey='dbKey'
Traceback (most recent call last):
  File "tgcall.py", line 11, in <module>
    from tgvoip import call
ImportError: libtgvoip.so.0: cannot open shared object file: No such file or directory
$ ls -tla /usr/local/lib/libtgvoip.so.0
lrwxrwxrwx 1 root root 18 Dec 25 18:12 /usr/local/lib/libtgvoip.so.0 -> libtgvoip.so.0.0.0
sekar@UDOO-x86:/ssd/bot/telegram/pytgvoip$ 
on3 tgcall.py api_id .....................
Traceback (most recent call last):
  File "tgcall.py", line 11, in <module>
    from tgvoip import call
ImportError: libtgvoip.so.0: cannot open shared object file: No such file or directory
$ ls -tla /usr/local/lib/libtgvoip.so.0
lrwxrwxrwx 1 root root 18 Dec 25 18:12 /usr/local/lib/libtgvoip.so.0 -> libtgvoip.so.0.0.0
$ ls -tla /usr/local/lib/libtgvoip*
-rw-r--r-- 1 root root 14839458 Dec 25 18:12 /usr/local/lib/libtgvoip.a
-rwxr-xr-x 1 root root      961 Dec 25 18:12 /usr/local/lib/libtgvoip.la
lrwxrwxrwx 1 root root       18 Dec 25 18:12 /usr/local/lib/libtgvoip.so -> libtgvoip.so.0.0.0
lrwxrwxrwx 1 root root       18 Dec 25 18:12 /usr/local/lib/libtgvoip.so.0 -> libtgvoip.so.0.0.0
-rwxr-xr-x 1 root root  6423416 Dec 25 18:12 /usr/local/lib/libtgvoip.so.0.0.0

Edit #1:

I added /usr/local/lib to my LD_LIBRARY_PATH by executing export LD_LIBRARY_PATH=/usr/local/lib. Now getting following error

Traceback (most recent call last):
  File "tgcall.py", line 11, in <module>
    from tgvoip import call
ImportError: cannot import name 'call'

Still working?

Hi, I know this is old, but, is still working? come here from your blog and I need to do the same.

Thanks

How to check if call is playing?

Hello,
I want to finish a call once the play is over.
How can I check if the call is still "playing"? I saw that call.playing is available in libtgvoip but don't know how to use it in pytgvoip.

Thanks
Kind regards,

undefined symbol: _ZTVN6tgvoip11IPv4AddressE

Hello,
When I try to execute tgcall.py, I get the following error:

ubuntu@domotics:~/gabomdq/pytgvoip$ python3 tgcall.py 111111 1212121212121212121 +3412121212
Traceback (most recent call last):
  File "tgcall.py", line 11, in <module>
    from tgvoip import call
ImportError: /home/ubuntu/.local/lib/python3.7/site-packages/tgvoip.cpython-37m-aarch64-linux-gnu.so: undefined symbol: _ZTVN6tgvoip11IPv4AddressE

Any idea what could be wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.