Intergrazione Whatsapp con Asterisk, parte prima, installazione Yowsup:
nota: non va su Ubuntu 10.04, serve una versione piu' aggiornata.
Installazione:
sudo apt-get update
sudo apt-get install python-dateutil
sudo apt-get install python-setuptools
sudo apt-get install python-dev
sudo apt-get install libevent-dev
sudo apt-get install ncurses-dev
git clone git://github.com/tgalal/yowsup.git
cd yowsup
sudo python setup.py install
richiesta pin via SIM
per TIM
python yowsup-cli registration --requestcode sms --phone 393xxxxxxxxx --cc 39 --mcc 222 --mnc 01 -E android
per TRE
python yowsup-cli registration --requestcode sms --phone 393xxxxxxxxx --cc 39 --mcc 222 --mnc 99 -E android
per Wind
python yowsup-cli registration --requestcode sms --phone 393xxxxxxxxx --cc 39 --mcc 222 --mnc 88 -E android
per Vodafone
python yowsup-cli registration --requestcode sms --phone 393xxxxxxxxx --cc 39 --mcc 222 --mnc 10 -E android
registrazione numero:
python yowsup-cli registration --register xxx-xxx --phone 393xxxxxxxxx --cc 39 -E android
nota: xxx-xxx e' il codice ricevuto per sms
risposta:
INFO:yowsup.common.http.warequest:{"tos2_version": "eu","status":"ok","login":"393xxxxxxxxx","type":" existing","edge_routing_info":"CAA=","chat_dns_dom ain":"sl","pw":"dDvLuJxZ4JMB3Frdan6KugtJq2U=","exp iration":4444444444.0,"kind":"free","price":"$0.99 ","cost":"0.99","currency":"USD","price_expiration ":1524732868}
status: ok
kind: free
pw: sdfvLuJxZ4JMB3Frdan6KugtJq2U=
price: $0.99
price_expiration: 1524732868
currency: USD
cost: 0.99
expiration: 4444444444.0
login: 393xxxxxxxxx
type: existing
creare file di configurazione
nano config
cc=39 #if not specified it will be autodetected
phone=393xxxxxxxxx
password=sdfvLuJxZ4JMB3Frdan6KugtJq2U=
lancio yowsup CLI
cd yowsup
yowsup-cli demos --yowsup --config config
autenticazione
/L
invio messaggio
/message send 393924843898 testo
oppure da shell:
cd yowsup
yowsup-cli demos -c config -s "393xxxxxxxx" "Message test"