wiki:PyAjam
Last modified 3 years ago Last modified on 09/05/11 12:26:57

Pyajam

Introduction

AJAM (Asynchronous Javascript Asterisk Manager) is the new interface build upon HTTP to interact with Asterisk.
Introduced in asterisk 1.4. Returned datas are mostly formatted in XML.

Pyajam allow python programs to interact with an asterisk server using the AJAM interface, and in a pythonic way

Example

ajam = Pyajam(server='192.168.0.10', username='mspencer', password='*rocks!')
if not ajam.login():
  print "Invalid login"
  sys.exit(1)

# display list of peers (SIP and IAX2)
print ajam.peers())
# display peer 101 attributes
peer  = ajam.sippeer('101'))

# screenprint events
def ajam_event_listener(data):
  print data

ajam.waitevent(async=False, callback=ajam_event_listener)

Features

  • retrieve basic informations (sip/iax2 peers, sip peer details, sip registry)
  • catch asterisk events
  • information presented in a pythonic way (dict)
  • automatically reconnect to the asterisk server if connection lost
  • compatible with asterisk 1.4 and 1.6

Todo

  • actions: initiate call, transfert call
  • more pythonic: yes/no strings became True/False? values, integer converted from string to int
  • smooth differences between 1.4 and 1.6 asterisk data formats

Download

Documentation

The complete documentation is available at http://devedge.bour.cc/resources/pyajam/doc

Contact

Pyajam is written by Guillaume Bour <guillaume@…>

Licence

Pyajam is distributed under GNU GPL v3 Licence.

Attachments