From 68db20dd6526b83c563239a83b66b931bf86220c Mon Sep 17 00:00:00 2001 From: poing Date: Thu, 8 Sep 2016 10:51:01 +0900 Subject: [PATCH] Focus on UTF8 --- examples/unicode.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 examples/unicode.py diff --git a/examples/unicode.py b/examples/unicode.py new file mode 100755 index 0000000..ebd6f41 --- /dev/null +++ b/examples/unicode.py @@ -0,0 +1,26 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- +# vim:fenc=utf-8 + +""" +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() + +string = 'カタカナ' + +agi.verbose(string) + +# 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', string) \ No newline at end of file