GithubHelp home page GithubHelp logo

probonopd / openphone Goto Github PK

View Code? Open in Web Editor NEW
27.0 8.0 6.0 496 KB

Open source desk telephone implemented in Python and pjsua

License: MIT License

Python 97.96% HTML 2.04%
phone sip python cx300 orangepi orangepi-zero telephony telephone

openphone's Introduction

OpenPhone

Open source desk telephone implemented in Python and pjsua

Rationale

This project contains the software for an extensible open source VOIP (voice-over-IP) desk telephone implemented in Python and pjsua, using inexpensive hardware such as an Orange Pi Zero. Using it, you can build

  • A VOIP upgrade to existing analog desk phones
  • A VOIP desk phone
  • A VOIP conference phone

Commercial VOIP desk phones are often outdated, inflexible, expensive, and use proprietary hardware and software.

This project aspires to build an extensible, customizable open source desk telephone from inexpensive components that matches (and exceeds) the user experience of an analog or ISDN desk phone.

Features

Hardware features

  • Use existing Ethernet and WLAN infrastructure (no DECT needed)
  • Can be powered using a normal 5V power supply (no 48V Power-over-Ethernet needed)
  • Has the physical appearance of a normal desk phone

Software features

  • Use SIP accounts
  • Speak the numbers while dialing to make dialing easier
  • Speak the name of the caller when a call comes in; also display the name of the caller in the display. Get the name of the caller from various online and local databases
  • Use the tones known from the local phone network (e.g., 1TR110 in Germany)
  • …and many more, plus plenty of room to realize your own ideas!

Hardware

OpenPhone is written in Python and can easily be extended to support additional hardware, such as single-board computers, sound cards, speakers, amplifiers, keyboards, cameras, network devices, etc.

The initial focus of the project is on using

  • Orange Pi Zero single board computer (can be ordered from China for around USD 10). This runs the logic of the phone. It provides an Ethernet jack for wired networking and a WLAN interface for wireless networking. Mobile networking could be added via USB. It can be powered through a normal 5V USB power supply
  • Polycom CX300 USB desk phone (conisting of handset, speaker, keyboard, display exposed over a USB interface, but no phone logic built in). This is used as a quick-start hardware for the phone, although OpenPhone can be used with other hardware devices as well

Software stack

The OpenPhone runs on the following software stack:

  • Armbian for Orange Pi Zero (it may run on Raspbian as well). It may be desirable to move to a smaller base system such as OpenWrt or miZy to shrink its footprint (contributions welcome)
  • python-pjsua SIP client library for Python. pjsua is part of th PJSIP project which is at the base of many softphones

Installation and usage

Please refer to the docs directory.

openphone's People

Contributors

probonopd 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  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openphone's Issues

Questions

I'm working on something that could make good use of this. Can I ask you a few questions about this project? [email protected]

Python3 + PJSUA2

Hi,
So I have a raspberry pi 4 with pi os 10 (buster) and I am able to make and receive calls with OpenPhone.

OpenPhone uses python 2.7 and I want to use python 3.

Buster also has python3 so I downloaded the latest pjsip from https://github.com/pjsip/pjproject and I was able to build the Python SWIG Module.

Took a little trial and error because at first no sound card was detected because ALSA was not working/installed. You need to install the libasound2-dev package before you build pjsip and the python SWIG module.

Then I found this example application in : pjproject-2.13.1/pjsip-apps/src/pygui/application.py and when I try this I am able to receive calls. I use the Polycom CX300 as the USB Audio device and this works but the sound quality is terrible.
Maybe an audio codec mismatch or this new SWIG module just needs more CPU power.....

Was curious if you also had bad sound quality with the development with OpenPhone or maybe someone had the same and can set me on the right track.

Regards,
Emiel.

OpenPhone on Raspberry Pi Compute Module 4

Hi, I wanted to try OpenPhone on a Raspberry Pi 4.
Current status : I can call from the USB phone to another phone.
When I try to pickup an incoming call the phone keeps ringing.....

Just wanted to write this what I have done so far to make this work on a Raspberry Pi 4:)

Installed Raspberry Pi OS (Legacy) Buster 2022-04-04 (so we have python2 as default)
With Compute Module IO Board, USB ports are disable by default!
(you can find a lot on the internet for this, but you need to add dtoverlay=dwc2,dr_mode=host to the /boot/config.txt to enable)

Then I followed the OpenPhone installation with these modifications :

Enable SPI :

in /boot/config.txt add/change dtparam=spi=on
(or use the raspberry config tool)

Install dependencies.

libttspico-utils is in buster non-free : so add buster non-free to the repo list.

wget -q https://ftp-master.debian.org/keys/release-10.asc -O- | apt-key add -
echo "deb http://deb.debian.org/debian buster non-free" >> /etc/apt/sources.list
apt-get update
apt -y install git libttspico-utils python-dev python-lxml python-requests python-flask python-pyaudio mpd python-mpd python-configparser python-pip python-setuptools libhidapi-libusb0
sudo pip install wheel
sudo pip install flask-bootstrap

Then "sudo pip install hid" will install the wrong python usb hid component.

sudo pip install cython
sudo pip install hidapi==0.9.0
(latest hidapi version doesn't support python2 anymore)

Then follow the rest of the installation but before you start openphone.py make these additional changes.

search openphone.py for spi.open(1,0) # For Neopixels
The raspberry has /dev/spidev0.0 and /dev/spidev0.1 but not 1.0
I changed this in 0,1 but I don't know if this should be 0.0 and if this only means some lights are not working.

search openphone.py for "os.path.dirname(file)" (I got 6 occurrences)
This is used to get the current path but I received an empty string and then files and folders can't be found.
I changed it in : os.path.dirname(os.path.abspath(file))
(on some lines you need to delete a ")" at the end but I assume people reading this know a bit of python to solve such an error :)

pull or fork

Hi,

Just clicked on Fork, but was wondering if a Pull request might be better.

I want to try to use this project on a new Rasberry Pi Compute Module 4 with IO Board to restore phone functions on an old Dutch Payphone. (Landis & Gyr manufactured early-mid 199x) These phones were all over the world in different configurations.
(https://gathering.tweakers.net/forum/list_messages/1812719 is in dutch but with google translate you get a pretty good understanding what me and a couple of others have tried)

First we tried if we could let the phone work as is, but the phone depends on a central management system which (of course) is out of service. My plan was to create a new voip phone and emulate the way it acted when it was in service.

Regards,
Emiel

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.