Here it is
You have to put a script in
/var/lib/asterisk/agi-bin
my script
#!/usr/bin/python
import sys
import os
from xmlrpclib import ServerProxy
env = {}
tests = 0
while 1:
line = sys.stdin.readline().strip()
if line == '':
break
key,data = line.split(':')
if key[:10] == 'agi_arg_1':
temp=data.strip()
server=ServerProxy('
http://192.168.1.132:8000/Cantina/default/call/xmlrpc')
server.add(temp)
***************************
Then call it from extensions.conf like this
exten => 700,1,Answer()
same => n,Read(TMP,vm-enter-num-to-call,1,,1,3)
same => n,AGI(myscript.py,${TMP})
same => n,Hangup()
Then the rest is web2py tornado and Websockets like Bruno explains in an excellent tutorial