Asterisk + Web2py projects?

112 views
Skip to first unread message

António Ramos

unread,
Jun 14, 2012, 7:46:10 AM6/14/12
to web...@googlegroups.com
Hello does anyone knows about Asterisk Open source PBX?

I have a working example with Web2py.
Its fantastic.


António Ramos

unread,
Jun 14, 2012, 7:47:03 AM6/14/12
to web...@googlegroups.com
Asterisk Gateway Interface lets you use python to interface with Asterisk

The sky is the limit


2012/6/14 António Ramos <ramst...@gmail.com>

Martin Weissenboeck

unread,
Jun 14, 2012, 7:49:16 AM6/14/12
to web...@googlegroups.com

I am working with Asterisk and it would be very interesting for me to see a connection with web2by.

villas

unread,
Jun 14, 2012, 8:14:56 AM6/14/12
to web...@googlegroups.com, mar...@weissenboeck.at
Yes,  it would be very interesting to see a code example --  thanks!

António Ramos

unread,
Jun 14, 2012, 8:37:13 AM6/14/12
to web...@googlegroups.com
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




2012/6/14 villas <vill...@gmail.com>
Reply all
Reply to author
Forward
0 new messages