From c4d5a73deefc7bf0456cd758f7ca72dbcd4fc164 Mon Sep 17 00:00:00 2001 From: Ludovic Gasc Date: Tue, 3 Dec 2013 11:37:40 +0100 Subject: [PATCH 1/3] Rename README file to have html formatting in Github --- README => README.rst | 0 setup.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename README => README.rst (100%) diff --git a/README b/README.rst similarity index 100% rename from README rename to README.rst diff --git a/setup.py b/setup.py index 663c728..8401acc 100644 --- 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', From d496ad08319a3324831551db55684aca123b98da Mon Sep 17 00:00:00 2001 From: Ludovic Gasc Date: Tue, 3 Dec 2013 11:39:05 +0100 Subject: [PATCH 2/3] Add execution rights for setup.py --- setup.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 setup.py diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 From 82cf4d022f236bfe1a853882846ee7f59c05b49f Mon Sep 17 00:00:00 2001 From: Ludovic Gasc Date: Tue, 3 Dec 2013 11:40:03 +0100 Subject: [PATCH 3/3] Add AGI script example. --- examples/agi_script.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 examples/agi_script.py 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