Python and rfc5766-turn-server binding, examples, to get started

560 views
Skip to first unread message

Sprogrammer

unread,
Nov 24, 2013, 5:21:45 PM11/24/13
to turn-server-project...@googlegroups.com
I have a custom Python application server and Python application client software for educational purpose. 
They both (server/client) using TCP and UDP for signaling and media transfer such as "Screencast" and "Teaching with audio lecture" for professors who want to train online from home or private office locations.

My server and client requires to use following tcp/udp ports:

> 58888 tcp is used for my protocol
> 5000 to 5005 tcp/udp is used for RTP packets
> 5900 to 5905 tcp is used for other protocol related tasks

But the problem is that without firewall/public ip address application works fine (in local area network or with public ip using DMZ etc from router). 

But when the users are behind firewall and nat / complex nat, ports are not available for peer to peer communication most of the users have never ever experience to configure those in there routers (professors from other department not ICT)

How can i in such case use rfc5766-turn-server to resolve it, so that i can have my ports 58888, 5000-5005, 5900-5905 tcp/udp available via server with the help of rfc5766-turn-server?

Do we also have some bindings for Python to read whats going on in server for parsing and other algorithm to attach.


Please advise kindly.

Oleg Moskalenko

unread,
Nov 24, 2013, 9:51:03 PM11/24/13
to turn-server-project...@googlegroups.com

This is a use case for a TURN server.

But TURN server is a simple but not a transparent tool. You will need two things:

1) Understanding how TURN works and how to use it. You will not be able to move ahead without learning what it is. You can read thru the RFC 5766 specs and thru the links on the front page of the project.

2) You will have to modify your application - you have to include a TURN client library into it, and modify your code. How to do that you will know after completion of the first (learning) item.

This project has a rudimentary simple client C/C++ library, but this project is concentrating on the server runtime. You can get client libraries in other open-source projects: libjingle, pjnath, and some others: all TURN implementations must be compatible if correctly done. I do not know whether a Python library exist somewhere.

Regards,
Oleg

Sprogrammer

unread,
Nov 27, 2013, 12:08:18 PM11/27/13
to turn-server-project...@googlegroups.com
Thank you. I will go for the client library like you suggestion.

$ wget http://www.pjsip.org/release/2.1/pjproject-2.1.tar.bz2
$ tar xvfj pjproject
-2.1.tar.bz2
$ cd pjproject
-2.1.0
$
export CFLAGS="$CFLAGS -fPIC" && ./configure
$ make dep
&& make
$ make install
$ cd pjsip
-apps/src/python
$ python setup
.py install


root@sun
-M14xR2:/var/tmp/pjproject-2.1.0/pjsip-apps/src/python# python
Python 2.7.3 (default, Apr 10 2013, 05:13:16)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pjsua
>>>

Reply all
Reply to author
Forward
0 new messages