Feeds, issues, packages and code source about emulation and pograming, of VENENUX proyects, Debian related distros and massenkoh!

SIPjs + Asterisk : on Debian

|

SIPjs + Asterisk > on Debian

This article will show how to setup, install and deploy asterisk in Debian, and use the SIPjs by implementing the owo-phone example, unfortunatelly only works for following Debian versions: wheeze, jessie, strecht, for squeeze and lenny does not work due lack of resources (a hard disk and a powered machine) to make available.

1. Installation of asterisk

Debian wheeze and jessie have backported packages, but for jessie you can use venenux packages (still wheeze pending). For strech and up use normal packages, below we explain why this:
apt-get instal lsb-release apt-transport-https

cat > /etc/apt/sources.list.d/debianbackports.list << EOF
deb http://ftp.de.debian.org/debian $(lsb_release -s -c)-backports main contrib non-free
EOF
apt-get update
apt-get install wget less groff bzip2 lrzip lzop lsof linux-base ca-certificates curl nmap iproute2 netstat

wget -nv https://download.opensuse.org/repositories/home:vegnuli:voip/Debian_8.0/Release.key -O Release.key
apt-key add - < Release.key
cat > /etc/apt/sources.list.d/debianvenenuxvoip.list << EOF
deb http://download.opensuse.org/repositories/home:/vegnuli:/voip/Debian_$(lsb_release -r -s | cut -d '.'  -f1).0/ /
EOF
apt-get update

apt-get install asterisk 
IMPORTANT this will install asterisk from debian backport if available, in wheeze will install asterisk 11.14 that has limited support for streaming, in jessie will install asterisk 12 that have good support, but, will install in jessie asterisk 13.14 with complete streaming support if vegnuli repo are enabled. For most modern will install in recent debian, lasted asterisk with good complete streaming support, that streaming of audio and video was officially since asterisk 13 release.

2. Configuring asterisk

Generates a selft signed certificate for the wss entry point, configure http and sip modules for webrtc >
export ipdefdev=$(netstat -rn | awk '/^0.0.0.0/ {thif=substr($0,74,10); print thif;} /^default.*UG/ {thif=substr($0,65,10);print thif;}' | head -1)
export ipdefval=$(/sbin/ifconfig $ipdefdev | grep 'Link ' -A 2 -B 2|grep 'inet' | grep -v 'inet6' | cut -d' ' -f12|cut -d'r' -f2|cut -d':' -f2)

openssl req -x509 -days 360 -nodes -newkey rsa:4096 \
   -subj "/C=VE/ST=Bolivar/L=Upata/O=Own/OU=VenenuX/CN=$ipdefcal" \
   -keyout "/etc/ssl/certs/$ipdefval.pem" -out "/etc/ssl/certs/$ipdefval.pem"

sed "s|.*;enabled=.*|enabled=yes|g" -i /etc/asterisk/http.conf
sed "s|;bindaddr=127.0.0.1|bindaddr=$ipdefval|g" -i /etc/asterisk/http.conf 
sed "s|.*;tlsenable=.*|tlsenable=yes          ; enable tls - default no.|g" -i /etc/asterisk/http.conf
sed "s|.*tlscertfile=.*|tlscertfile=/etc/ssl/certs/$ipdefval.pem|g" -i /etc/asterisk/http.conf
sed "s|.*tlsprivatekey=.*|tlsprivatekey=/etc/ssl/certs/$ipdefval.pem|g" -i /etc/asterisk/http.conf

sed "s|;realm=.*|realm=$ipdefval             ; Realm for digest authentication|g" -i /etc/asterisk/sip.conf
WARNING at this point everything was done with simple commands, now we must open sip.conf and added two new sections:
[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=password ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws,wss ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=fingerprint ; Tell Asterisk to verify DTLS fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
rtcp_mux=yes ; Tell Asterisk to do RTCP mux

[1061] ; This will be the legacy SIP client
type=friend
username=1061
host=dynamic
secret=password
context=default
WARNING now go to extensions.conf and added to "default" section the two users around line 671 in the file:
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
exten => 1061,1,Dial(SIP/1061) ; Dialing 1061 will call the SIP client registered to 1061
restart service and test:
service asterisk restart

asterisk -rvvv -x 'http show status' | grep 'Asterisk'
Server: Asterisk/13.14.1
/httpstatus => Asterisk HTTP General Status
/phoneprov/... => Asterisk HTTP Phone Provisioning Tool
/static/... => Asterisk HTTP Static Delivery
/ari/... => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket

asterisk -rvvv -x 'sip show peers'
Name/username             Host                                    Dyn Forcerport Comedia    ACL Port     Status      Description 
1060/1060                 (Unspecified)                            D  Auto (No)  No             0        Unmonitored
1061/1061                 (Unspecified)                            D  Auto (No)  No             0        Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2 offline]

3. Configure SIPjs owo-example

I already forked the original repository and added some minor info, just only info not changing any, so you can clone either the original project or my mckaygerhard project.
Here we have a problem, chrome/like browsers don't allow easily to setup a exception to your new ws entry point self signed certificate, so maybe its recommended to use firefox/palemoon here next, for that, navigate tohttps://127.0.0.1:8089/ws and add the certificate exception by click on the @avanced@ button at the screen advertise.
Install apache, git, curl nodejs and npm
apt-get install apache2 git git-core curl apt-transport-https

echo "deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu lucid main" >> /etc/apt/sources.list.d/50nodejsnpm.list
apt-get update
apt-get install nodejs=0.10.37-1chl1~lucid1
IMPORTANT: Debian 9+ already have enough recent version of nodejs and npm 
clone the project example of SIPjs owo-phone
cd /var/www/html/
git clone https://github.com/mckaygerhard/owo-phone.js.git sipjs
cd /var/www/html/sipjs
npm install bower
node_modules/bower/bin/bower install --allow-root
Open your browser and try to start communication
now point your browser to http://localhost/sipjs/ and fil the inputs with the asterisk user 1060 with the ws server as your local host ip or configured in the http.conf file.
  • push the whell button aside to the "Call" button
  • use any name
  • uri are the 1060@127.0.0.1
  • auth name : 1060
  • password of 1060 "password" as was paste in the sip.conf
  • ws server: wss://127.0.0.1:8089/ws

NUevo framework guachi, pero para grandes proyectos

|
Porsupuesto en gitlab, no en github..


Guachi (Nombre quizas definitivo) es un framework nacido de los constantes trabajos realizados por Master Vitronic, creador de VenenuX, altamente basado en Banshee, se penso para proyectos pequeños, pero realmente es para proyectos gigantes donde se neceita control de la mas minima pieza de trabajo

DONDE?


El proyecto esta residenciado en https://gitlab.com/guachi/Guachi_Framework y su vision es modular, es un framework fuertemente tecnico, orientado a buenos prgramadores, las clases de mayor interes son Guachi.php y class.router.php despues de las llamadas a input.php.

COMO?


Basa su logica en enrutamientos, usando el famoso directorio "public" en vez de un directorio "stats" para los elementos no dinamicos. Para los adeptos notaran que define lejos el core de la exposicion de los archivos por el webserver, lo que significa que no ejecuta en hostings gratis, pues requiere "ayuda" del administrador (Definir htaccess o aliasing).

Debido a esto Guachi hace uso extensivo de la reglas "rewrite" de los servidores web, lo que lo orienta a proyectos mas completos que a cosas simples o sencillas, asi que es recomendable tenga un buen entendimiento de estas, esto permite configurar rutas especiales y tener dominio y control sobre los requests respecto el desarrollo.

CUANTO?


Rudimentario y livaiano, pero fuerto y robusto, usa Php cualquier version desde la cinco, no tenene requierminetos mas que modulo match, modulo curl y modulo mcrypt/openssl (este ultimo tampoco disponible en la mayoria de los hostings, solo en planes AWS) pero tal como se explica, no es un proyecto empezando su desarrollo, ya se ha usado en produccion, sin embargo en cuando a conectividad de datos no tiene soporte ODBC en el cual se comenzara a trabajar... 

CUANDO?


Aun no hay releases o versiones oficiales, pero no es un proyecto en desarrollo, realmente ya se ha usado en produccion varias veces y esta es la razon de porque se hace hoy dia un proyecto publico en la web, el trabajo actual es mas de ampliacion y documentacion que de refacciones y desarrollo, ya que ya es estable y tienen uso..

la cagada que nos queda, dejan clave en paginas banco

|
una imagen vale mas que mil palabras, se ve clarito como codean campos que nunca deberian estar alli.. no solo el password sino otras cosas..

si se jorunga mas en banesco se puede ver indicaciones de como se trabaja y de porque falla tanto, puff que cagada