Skip to content

Commit

Permalink
Merge branch 'feature/add_voip_example' into 'master'
Browse files Browse the repository at this point in the history
Add voip example

See merge request adf/esp-adf-internal!310
  • Loading branch information
jason-mao committed Jun 25, 2019
2 parents 8f5f1b7 + 525e166 commit 49d7330
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 34 deletions.
2 changes: 1 addition & 1 deletion components/esp-adf-libs
67 changes: 34 additions & 33 deletions examples/README.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions examples/advanced_examples/voip/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#

PROJECT_NAME := voip_app
#CURRENT_PATH := $(shell pwd)
include $(ADF_PATH)/project.mk
#IDF_PATH := $(CURRENT_PATH)/esp-idf
# EXTRA_COMPONENT_DIRS := $(CURRENT_PATH)/components

#include $(IDF_PATH)/make/project.mk
40 changes: 40 additions & 0 deletions examples/advanced_examples/voip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# VoIP Example

This example allows users to make calls over the internet.

## Compatibility

| ESP32-LyraT | ESP32-LyraT-MSC |
|:-----------:|:---------------:|
| [![alt text](../../docs/_static/esp32-lyrat-v4.2-side-small.jpg "ESP32-LyraT")](https://docs.espressif.com/projects/esp-adf/en/latest/get-started/get-started-esp32-lyrat.html) | [![alt text](../../docs/_static/esp32-lyratd-msc-v2.2-small.jpg "ESP32-LyraTD-MSC")](https://docs.espressif.com/projects/esp-adf/en/latest/get-started/get-started-esp32-lyratd-msc.html) |
| ![alt text](../../docs/_static/yes-button.png "Compatible") | ![alt text](../../docs/_static/yes-button.png "Compatible") |

## Usage

Prepare the audio board:

- Connect speakers or headphones to the board.

Configure the example:

- Select compatible audio board in `menuconfig` > `Audio HAL`.
- Set up Wi-Fi connection by running `menuconfig` > `VOIP App Configuration` and filling in `WiFi SSID` and `WiFi Password`.
- Select compatible audio codec in `menuconfig` > `VOIP App Configuration` > `SIP Codec`.
- Create the SIP extension, ex: 100 (see below)
- Set up SIP URI in `menuconfig` > `VOIP App Configuration` > `SIP_URI`.

Configure external application:

Setup the PBX Server like Yet Another Telephony Engine (FreePBX/FreeSwitch or any other PBXs)
http://docs.yate.ro/wiki/Beginners_in_Yate

## Features
- Lightweight
- Support multiple transports for SIP (UDP, TCP, TLS)
- Support G711A/8000 & G711U/8000 Audio Codec
- Easy setting up by using URI

## Reference
http://www.yate.ro/
https://www.tutorialspoint.com/session_initiation_protocol/index.htm
https://tools.ietf.org/html/rfc3261
33 changes: 33 additions & 0 deletions examples/advanced_examples/voip/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
menu "VOIP App Configuration"

config WIFI_SSID
string "WiFi SSID"
default "myssid"
help
SSID (network name) for the example to connect to.

config WIFI_PASSWORD
string "WiFi Password"
default "mypassword"
help
WiFi password (WPA or WPA2) for the example to use.

choice VOIP_CODEC
prompt "SIP Codec"
default G711A
help
sip codec

config SIP_CODEC_G711A
bool "G711 PCMA"
config SIP_CODEC_G711U
bool "G711 PCMU"
endchoice

config SIP_URI
string "SIP URI"
default "udp://100:100@192.168.1.123:5060"
help
The SIP URI with username, password, address, port and transport type

endmenu
5 changes: 5 additions & 0 deletions examples/advanced_examples/voip/main/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# "main" pseudo-component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)

Loading

0 comments on commit 49d7330

Please sign in to comment.