Click2call for asterisk with python

Overview

Click2call para Asterisk com Python

Este projeto disponibiliza uma API construída em python contendo uma rota para Click2call e outra para listagem de ramais em tempo real. Ela pode ser integrada a qualquer servidor Asterisk.

Requisitos

  1. Criar um usuário no Maganer do seu Asterisk conforme abaixo (lembre-se de ajustar para o IP da sua rede):
[click2call]
secret=click2callsecret
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
permit=192.168.100.0/255.255.255.0
write=originate,system

Você poderá alterar o usuário e senha também.

  1. Recarregar o manager:
[[email protected]:/etc/asterisk]# rasterisk -x 'manager reload'

Deploy

  1. Definir as variáveis de ambiente:
[[email protected]:/]# cat .env
ASTERISK_IP=
ASTERISK_AMI_PORT=5038
ASTERISK_AMI_USER=
ASTERISK_AMI_PASSWORD=
ENVIRONMENT=dev
PORT=8000
HTTP_AUTH_USER=
HTTP_AUTH_PASSWORD=
Variável Valores
ASTERISK_IP IP do seu servidor Asterisk
ASTERISK_AMI_PORT Porta do manager do seu Asterisk
ASTERISK_AMI_USER Usuário criado no manager
ASTERISK_AMI_PASSWORD Senha do usuário criado no manager
ENVIRONMENT dev ou prod. Quando em dev qualquer alteração do código é recarregada imediatamente durante a execução do serviço
PORT Porta onde o serviço da API será executado
HTTP_AUTH_USER Usuário de acesso à api
HTTP_AUTH_PASSWORD Senha do usuário de acesso à api
  1. Fazer o build e a inicialização dos serviços:
docker-compose build
docker-compose up -d

Resquests

  • Click2call
curl --request POST \
  --url http://192.168.100.96:8000/click2call \
  --header 'Authorization: Basic c3VwZXJ1c2VyOnN1cGVyc2VjcmV0' \
  --header 'Content-Type: application/json' \
  --data '{
	"src":1000,
	"dst": 1001,
	"context":"from-internal"	
}'

Retorno:

{
	"status": "Success",
	"keys": {
		"ActionID": "1",
		"Message": "Originate successfully queued"
	},
	"follows": []
}
  • Listagem de ramais e seus status
curl --request GET \
  --url http://192.168.100.96:8000/get_extensions \
  --header 'Authorization: Basic c3VwZXJ1c2VyOnN1cGVyc2VjcmV0'

Retorno

[
	[
		{
			"Privilege": "System",
			"ChannelType": "SIP",
			"Peer": "SIP/1001",
			"PeerStatus": "Reachable",
			"Time": "9",
			"ActionID": "da32dd50-76ba-11ec-b872-0242ac150002"
		}
	],
	[
		{
			"Privilege": "System",
			"ChannelType": "SIP",
			"Peer": "SIP/1000",
			"PeerStatus": "Reachable",
			"Time": "1",
			"ActionID": "da32dd50-76ba-11ec-b872-0242ac150002"
		}
	]
]
Owner
Benedito Marques
Sysadmin em Fortics Tecnologia
Benedito Marques
DeDRM tools for ebooks

DeDRM_tools DeDRM tools for ebooks This is a fork of Apprentice Harper's version of the DeDRM tools. I've added some of the PRs that still haven't bee

2 Jan 10, 2022
京东自动入会获取京豆

京东入会领京豆 要求 有一定的电脑知识 or 有耐心爱折腾 需要Chrome(推荐)、Edge(Chromium)、Firefox 操作系统需是Mac(本人没在m1上测试)、Linux(在deepin上测试过)、Windows 安装方法 脚本采用Selenium遍历京东入会有礼界面,由于遍历了200

Vanke Anton 500 Dec 22, 2022
Bitflip Fault Simulation Platform by Daniele Rizzieri (2021)

BFSP [v1.05] Bitflip Fault Simulation Platform by Daniele Rizzieri (2021) The platform injects a random bitflip in each of N copies of a binary file.

Daniele Rizzieri 2 Nov 05, 2022
tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel

tox-gh is a tox plugin which helps running tox on GitHub Actions with multiple different Python versions on multiple workers in parallel. This project is inspired by tox-travis.

tox development team 19 Dec 26, 2022
A Linux webcam plugin for BGMv2 as used in our demos.

The goal of this repository is to supplement the main Real-Time High Resolution Background Matting repo with a working demo of a videoconferencing plu

Andrey Ryabtsev 144 Dec 27, 2022
Extract continuous and discrete relaxation spectra from G(t)

pyReSpect-time Extract continuous and discrete relaxation spectra from stress relaxation modulus G(t). The papers which describe the method and test c

3 Nov 03, 2022
The worst and slowest programming language you have ever seen

VenumLang this is a complete joke EXAMPLE: fizzbuzz in venumlang x = 0

Venum 7 Mar 12, 2022
⚙️ Compile, Read and update your .conf file in python

⚙️ Compile, Read and update your .conf file in python

Reece Harris 2 Aug 15, 2022
Santa's kitchen helper for python

Santa's Kitchen Helper Introduction/Overview Contents UX User Stories Design Wireframes Color Scheme Typography Imagery Features Exisiting Features Fe

Paul Browne 4 May 31, 2022
Jarvis Python BOT acts like Google-assistance

Jarvis-Python-BOT Jarvis Python BOT acts like Google-assistance Setup Add Mail ID (Gmail) in the file at line no 82.

Ishan Jogalekar 1 Jan 08, 2022
A totally unrealistic cell growth/reproduction simulation.

A totally unrealistic cell growth/reproduction simulation.

Andrien Wiandyano 1 Oct 24, 2021
The CS Netlogo Helper is a small python script I made, to make computer science homework easier.

The CS Netlogo Helper is a small python script I made, to make computer science homework easier. This project is really ironic now that I think about it.

1 Jan 13, 2022
Hypothesis strategies for generating Python programs, something like CSmith

hypothesmith Hypothesis strategies for generating Python programs, something like CSmith. This is definitely pre-alpha, but if you want to play with i

Zac Hatfield-Dodds 73 Dec 14, 2022
A Python program that generates a maze that solves itself using DFS

Maze Generator And Solver Program Purpose: Generates a maze that then solves itself Language: Python and Pygame Algorithm: Randomized DFS / Floodfill

Joshua Liu 1 Jul 25, 2022
MiniJVM is simple java virtual machine written by python language, it can load class file from file system and run it.

MiniJVM MiniJVM是一款使用python编写的简易JVM,能够从本地加载class文件并且执行绝大多数指令。 支持的功能 1.从本地磁盘加载class并解析 2.支持绝大多数指令集的执行 3.支持虚拟机内存分区以及对象的创建 4.支持方法的调用和参数传递 5.支持静态代码块的初始化 不支

keguoyu 60 Apr 01, 2022
Fast Base64 encoding/decoding in Python

Fast Base64 implementation This project is a wrapper on libbase64. It aims to provide a fast base64 implementation for base64 encoding/decoding. Insta

Matthieu Darbois 96 Dec 26, 2022
Credit Card Fraud Detection

Credit Card Fraud Detection For this project, I used the datasets from the kaggle competition called IEEE-CIS Fraud Detection. The competition aims to

RayWu 4 Jun 21, 2022
The official FOSSCOMM 2021 CTF by [email protected]

FOSSCOMM 2021 CTF Table of Contents General Info FAQ General Info Purpose: This CTF is a collaboration between the FOSSCOMM conference and the Machina 2 Nov 14, 2021

NewsBlur is a personal news reader bringing people together to talk about the world.

NewsBlur NewsBlur is a personal news reader bringing people together to talk about the world.

Samuel Clay 6.2k Dec 29, 2022
Step by step development of a vending coffee machine project, including tkinter, sqlite3, simulation, etc.

Step by step development of a vending coffee machine project, including tkinter, sqlite3, simulation, etc.

Nikolaos Avouris 2 Dec 05, 2021