Focus on UTF8
This commit is contained in:
parent
cae17c32bb
commit
68db20dd65
26
examples/unicode.py
Executable file
26
examples/unicode.py
Executable file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user