Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support calls #177

Closed
makovez opened this issue Jul 24, 2017 · 29 comments
Closed

Support calls #177

makovez opened this issue Jul 24, 2017 · 29 comments

Comments

@makovez
Copy link

makovez commented Jul 24, 2017

How can i send an mp3 audio when accepting calls?

@Lonami
Copy link
Member

Lonami commented Jul 26, 2017

when accepting calls

Telegram calls? I have never used the Telegram API through Telethon, so I have no clue how that works. But I guess, instead using a microphone, you would stream the .mp3 file.

@makovez
Copy link
Author

makovez commented Jul 27, 2017

I have no idea how to stream it :(

I read this lib but i didnt understand much https://github.com/danog/libtgvoip

Sent from my Samsung SM-G530FZ using FastHub

@Lonami
Copy link
Member

Lonami commented Jul 27, 2017

Could you explain how you currently accept a call?

@makovez
Copy link
Author

makovez commented Jul 27, 2017

Im currently using another client but i think u will receive an update "UpdatePhoneCall". Then u call "acceptCallRequest"

@Lonami
Copy link
Member

Lonami commented Jul 27, 2017

But Telethon doesn't even support the calls protocol yet so I have no idea how you pretend to "send" (this should be "stream") an .mp3 audio!

@Lonami Lonami changed the title Send mp3 audio Support calls Jul 27, 2017
@makovez
Copy link
Author

makovez commented Jul 31, 2017

Do u know on messages.getDhConfig what i have to pass to version and random_lenght parameters?

@cher-nov
Copy link
Contributor

cher-nov commented Jul 31, 2017

@Seby2000,
https://core.telegram.org/method/messages.getDhConfig

Although official Telegram API docs are very outdated, they can still be useful sometimes.

@makovez
Copy link
Author

makovez commented Jul 31, 2017

@cher-nov i have already read it.
Value of the version parameter from messages.dhConfig, avialable at the client
What does it mean? i mean, DhConfig is returned by calling getDhConfig so how can i get the version?
Length of the required random sequence
This too...

@MasterGroosha
Copy link

So, is it possible to initiate calls or not?

@Lonami
Copy link
Member

Lonami commented Aug 23, 2017

Not sure, I haven't looked into it. If all you need to make the calls is use the Telegram API, then sure you can since all methods are available. If some other weird encryption is required, or since it's peer to peer I think?, then no, there's nothing built for that on Telethon yet. Maybe interfacing libtgvoip is enough.

@danog
Copy link

danog commented Aug 28, 2017

I read this lib but i didnt understand much https://github.com/danog/libtgvoip

Try https://github.com/danog/MadelineProto/blob/master/magna.php

P.S. Sorry Lonami had to do it <3

@Lonami
Copy link
Member

Lonami commented Aug 28, 2017

@danog you know you can also contribute to Telethon right? It's not that hard, and Python is easy to read :)

Even though Madeline is indeed great and has been added to the list of Telegram apps some people may still prefer to go with an implementation written in Python itself, if Python is what they use, since they'll depend on no other external tools.

@stek29
Copy link
Contributor

stek29 commented Aug 28, 2017

@Lonami AES IGE without openssl when?

@giuseppeM99
Copy link

giuseppeM99 commented Aug 28, 2017

Daniil is writing madeline.py, but he will release it only once he'll get 50 donation of 1[€$whatever] or more....
Ask him why

@Lonami
Copy link
Member

Lonami commented Aug 28, 2017

@Lonami AES IGE without openssl when?

@stek29 that has been a thing since the very beginning. Making use of openssl if available (see issue 199) was a recent enhancement.

but he will release it only once he'll get 50 donation

Of course, because PHP is his first priority, and he isn't going to spend time for free like that. Telethon on the other hand is just Python alone, and another open source project on its own which I develop only because I want to.

@devxpy
Copy link

devxpy commented Feb 27, 2018

@Lonami, how hard would it be to do a python wrapper for libtgvoip? I am ready to contribute if it takes a reasonable amount of time.
I am working on a project where I need to do voice communications. I was doing voice messages since they are very reliable but I tried out telegram calls and they are just fabulous. I've never experienced such perfect call quality on the internet, on a very shitty internet connection

@Lonami
Copy link
Member

Lonami commented Feb 27, 2018

It would not be excessively hard, since there's already a Telethon-calls proof of concept. It only needs said considerable amount of work to integrate it nicely and not recompile code every time one makes a call ;)

@Lonami
Copy link
Member

Lonami commented Feb 27, 2018

If you really are willing to work on it feel free to fork the project and maintain the extension yourself. I'll help as much as I can, but calls are definitely not a priority on my list.

@devxpy
Copy link

devxpy commented Mar 1, 2018

Can you please elaborate on what exactly are the problems with that proof-of-concept as of now?
Also, if possible a small intro on what i need to get that working.

I am also considering an easier solution, by using zeromq
Its a fantastic way to "Connect your code in any language, on any platform."
I have personally used it for a project before and it works like a charm.

Not as perfect as a binding but definitely easier to implement.

@Lonami
Copy link
Member

Lonami commented Mar 1, 2018

Can you please elaborate on what exactly are the problems with that proof-of-concept as of now?

It's calling a external compiler to generate the code that embeds the required parameters to stabilish the call ;)

There isn't really a need for zeromq. A C extension (like cryptg, really small) should be able to do the job.

@devxpy
Copy link

devxpy commented Mar 1, 2018

There isn't really a need for zeromq. A C extension (like cryptg, really small) should be able to do the job.

I was actually looking into using zeromq on php-libtgvoip.

I am partial to zeromq since its a less-headache solution overall.

I also felt that the libtgvoip is very poorly documented and writing zeromq communication channel would be much easier than reverse-engineering their whole API

It's calling a external compiler to generate the code that embeds the required parameters to stabilish the call ;)

that sounds bad

@Lonami
Copy link
Member

Lonami commented Mar 1, 2018

I also felt that the libtgvoip is very poorly documented

All the "hard" work is already done on that repository I keep linking. It's only missing a few tweaks. Shouldn't be too hard to pick up. C extensions for Python aren't that hard either really (also linked a small one you can use as a base).

@devxpy
Copy link

devxpy commented Mar 1, 2018

I forgot to ask, does this run on telegram servers directly?

@Lonami
Copy link
Member

Lonami commented Mar 1, 2018

No? Calls are peer to peer.

@devxpy
Copy link

devxpy commented Mar 1, 2018

WHAT. okay, now i can understand why the quality is so great, no intermediary server to deal with 👍

@Lonami
Copy link
Member

Lonami commented Mar 1, 2018

I'm not sure if there's an option to disable peer to peer. Don't take my word on this.

@devxpy
Copy link

devxpy commented Mar 1, 2018

I dont want to disable it. I like it being p2p rather than having a server to deal with.

@devxpy
Copy link

devxpy commented Mar 1, 2018

Did you create DynamicDict just so that you wont have to write [' '] ?

@Lonami
Copy link
Member

Lonami commented Mar 1, 2018

Yes. [''] is annoying to type. We can move this conversation to Telegram if you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants