Coder Social home page Coder Social logo

shb3618 / sip_call Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrta/sip_call

0.0 1.0 0.0 194 KB

SIP client for ESP32 to initiate a phone call from a door bell

License: Apache License 2.0

C++ 91.42% C 0.77% CMake 1.16% Dockerfile 0.08% Shell 1.01% Python 5.56%

sip_call's Introduction

ESP32 door bell to sip call

On startup the application associates with the compiled in wlan access point and registers on the SIP server.

Once a signal is detected on the selected GPIO, a call is initiated to a target number. On the phone, the custom string is displayed. After the configured timeout is elapsed, the call is canceled. If the signal is detected again, before the timer is elapsed, the timer is started again.

Tested with:

  • AVM Fritzbox 7390
  • AVM Fritzbox 7490 (Firmware 7.27)
  • AVM Fritzbox 7590
  • local FreeSWITCH installation

Programming

The source code is mixed C and C++.

This application is to be used with Espressif IoT Development Framework (ESP-IDF). It is tested with version v4.3 (rev c9646ff0beffc86d2c6d1bfbad34da16e328e0e3)

Please check ESP-IDF docs for getting started instructions.

Building

The project now uses cmake, so after initializing your environment with the relevant variables from esp-idf you can use idf.py to build, flash etc:

cd <this project's root dir>
idf.py menuconfig
idf.py build
idf.py flash monitor

To build this project for the pc (linux, e.g. ubuntu or fedora), a sample (not all features are supported, yet):

mkdir <build dir>
cd <build dir>
cmake <this project's root dir>/native
make

The sip server configuration must be done in the defines of the file <this project's root dir>/native/main.cpp.

The following libraries are required for this (e.g. on fedora):

sudo dnf install asio-devel mbedtls-devel

Code formatting

Clang-format is used to format the code. The settings are stored in .clangformat. The format of external files, e.g. components/sip_client/include/boost/sml.hpp should not be changed. To run clang-format (e.g. version 12) over all files:

find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)' -exec clang-format -style=file -i {} \;

Hardware

An ESP32 board can be used. Only one external GPIO (input is sufficient) must be available, to detect the call trigger. To test this, two PC817 opto coupler are used to detect the AC signal (about 12V from the bell transformer). The input diodes of the opto couplers are connected in parallel and opposing directions. In series, a 2k Resistor is used. This may have to be tweaked according to the input voltage. The output transistors of the opto couplers are connected in parallel in the same polarity to pull the signal to ground, if a current flows through one of the input diodes. A pull up resistor (either internal in the ESP32 or external) must be used to pull the signal to 3V3 if no input current is detected and the output transistors are switched off.

Instead of two PC817 opto couplers, one PC814 can be used to detect the AC signal. Because of the different CTR, the resistor values must be tweaked. If it is sufficient to only detect one half-wave of the AC signal (this is normally the case) one PC817 opto coupler and a simple diode (e.g. 1N4148) is sufficient. The diode ensures that the voltage of the input diode of the opto coupler is not above the threshold. The 1N4148 must be connected anti-parallel to the input diode of the PC817.

If the bell transformer delivers enough power, the ESP32 can be powered from it. A bridge rectifier, a big capacitor and a cheap switching regulator board can be used for that.

License

If not otherwise specified, code in this repository is Copyright (C) 2017-2021 Christian Taedcke <[email protected]>, licensed under the Apache License 2.0 as described in the file LICENSE.

Misc Information

On the AVM Fritzbox the number **9 can be used to let all connected phones ring.

sip_call's People

Contributors

chrta avatar flattermann78 avatar lennartpl avatar

Watchers

 avatar

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.