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
Old versions of Deadcord that are problematic or used as reference.

⚠️ Unmaintained and broken. We have decided to release the old version of Deadcord before our v1.0 rewrite. (which will be equiped with much more feat

Galaxzy 1 Feb 10, 2022
a really simple bot that send you memes from reddit to whatsapp

a really simple bot that send you memes from reddit to whatsapp want to use use it? install the dependencies with pip3 install -r requirements.txt the

pai 10 Nov 28, 2021
EDF R&D implementation of ISO 15118-20 FDIS.

EDF R&D implementation of ISO 15118-20 FDIS ============ This project implements the ISO 15118-20 using Python. Supported features: DC Bidirectional P

30 Dec 29, 2022
Simple tools for the Horse Reality webgame

Realtools (Web Tools for Horse Reality) These tools were made on request from a close friend of mine who plays this game. A live instance can be found

shay 0 Sep 06, 2022
A slapdash script to solve Wordle or Absurdle automatically

A slapdash script to solve Wordle or Absurdle automatically

Michael Anthony 1 Jan 19, 2022
fast_bss_eval is a fast implementation of the bss_eval metrics for the evaluation of blind source separation.

fast_bss_eval Do you have a zillion BSS audio files to process and it is taking days ? Is your simulation never ending ? Fear no more! fast_bss_eval i

Robin Scheibler 99 Dec 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
An useful scripts for Misskey

misskey-scripts This place storing useful scripts which made by me. icon-repair Repair broken remote user's icon.

CyberRex 5 Sep 09, 2022
Nuclei - Burp Extension allows to run nuclei scanner directly from burp and transforms json results into the issues

Nuclei - Burp Extension Simple extension that allows to run nuclei scanner directly from burp and transforms json results into the issues. Installatio

106 Dec 22, 2022
A place where the most basic, basic of python coding exists

python-basics A place where the most basic, basic of python coding exists As you can see, there are four folders and the best order to read is: appeti

Chuqin 2 Oct 05, 2022
⚡KiCad library containing footprints and symbols for inductive analog keyboard switches

Inductive Analog Switches This library contains footprints and symbols for inductive analog keyboard switches for use with the Texas Instruments LDC13

Elias Sjögreen 3 Jun 30, 2022
A set of decks and notebooks with exercises for use in a hands-on causal inference tutorial session

intro-to-causal-inference A introduction to causal inference using common tools from the python data stack Table of Contents Getting Started Install g

Roni Kobrosly 15 Dec 07, 2022
Encode and decode cancro lang files to and from brainfuck

cancrolang Encode and decode cancro lang files to and from brainfuck. examples python3 main.py -f hello.cancro --run Hello World! the interpreter is n

witer33 1 Dec 20, 2021
The Doodle Master seeks to turn your UI mockups into real code.

Doodle Master The Doodle Master seeks to turn your UI mockups into real code. Currently this repository just serves to demonstrate a Proof Of Concept

Karanbir Chahal 2.4k Dec 09, 2022
Python Programming Bootcamp

python-bootcamp Python Programming Bootcamp Begin: 27th August 2021 End: 8th September 2021 Registration deadline: 22nd August 2021 Fees: No course or

Rohitash Chandra 11 Oct 19, 2022
It is a personal assistant chatbot, capable to perform many tasks same as Google Assistant plus more extra features...

PersonalAssistant It is an Personal Assistant, capable to perform many tasks with some unique features, that you haven'e seen yet.... Features / Tasks

Roshan Kumar 95 Dec 21, 2022
A web interface for a soft serve Git server.

Soft Serve monitor Soft Sevre is a very nice git server. It offers a really nice TUI to browse the repositories on the server. Unfortunately, it does

Maxime Bouillot 5 Apr 26, 2022
Astroquery is an astropy affiliated package that contains a collection of tools to access online Astronomical data.

Astroquery is an astropy affiliated package that contains a collection of tools to access online Astronomical data.

The Astropy Project 631 Jan 05, 2023
This is a practice on Airflow, which is building virtual env, installing Airflow and constructing data pipeline (DAGs)

airflow-test This is a practice on Airflow, which is Builing virtualbox env and setting Airflow on that env Installing Airflow using python virtual en

Jaeyoung 1 Nov 01, 2021
⏰ Shutdown Timer is an application that you can shutdown, restart, logoff, and hibernate your computer with a timer.

Shutdown Timer is a an application that you can shutdown, restart, logoff, and hibernate your computer with a timer. After choosing an action from the

Mehmet Güdük 5 Jun 27, 2022