diff --git a/README b/README.rst similarity index 100% rename from README rename to README.rst diff --git a/examples/agi_script.py b/examples/agi_script.py new file mode 100755 index 0000000..13035db --- /dev/null +++ b/examples/agi_script.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +""" +Example to get and set variables via AGI. + +You can call directly this script with AGI() in Asterisk dialplan. +""" + +from asterisk.agi import * + +agi = AGI() + +agi.verbose("python agi started") + +# Get variable environment +extension = agi.env['agi_extension'] + +# Get variable in dialplan +phone_exten = agi.get_variable('PHONE_EXTEN') + +# Set variable, it will be available in dialplan +agi.set_variable('EXT_CALLERID', '1') \ No newline at end of file diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index 663c728..8401acc --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from asterisk import __version__ as version description = [] -f = open('README') +f = open('README.rst') logo_stripped = False for line in f: @@ -26,7 +26,7 @@ setup( author_email='kputland@users.sourceforge.net', maintainer='Randall Degges', maintainer_email='rdegges@gmail.com', - url='http://www.sourceforge.net/projects/pyst/', + url='https://github.com/rdegges/pyst2', packages=['asterisk'], license=', '.join(licenses), platforms='Any',