It is relatively easy to write voice applications for the Asterisk software PBX using the CGI-like AGI (Asterisk Gateway Interface).
The following document describes the AGI and has some examples in Python: http://home.cogeco.ca/~camstuff/agi.html -- http://mail.python.org/mailman/listinfo/python-list