Skip to content

Commit

Permalink
Merge pull request #17 from tuxpowered/master
Browse files Browse the repository at this point in the history
Corrected _quote() to allow utf-8 strings to be passed.
  • Loading branch information
rdegges committed Nov 15, 2015
2 parents 61f1090 + 6b2c4da commit bd6ac43
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion asterisk/agi.py
Expand Up @@ -113,7 +113,12 @@ def _get_agi_env(self):
sys.stderr.write('\n')

def _quote(self, string):
return ''.join(['"', str(string), '"'])
""" provides double quotes to string, converts int/bool to string """
if isinstance(string, int):
string = str(string)
if isinstance(string, float):
string = str(string)
return ''.join(['"', string.encode('ascii', 'ignore'), '"'])

def _handle_sighup(self, signum, frame):
"""Handle the SIGHUP signal"""
Expand Down

0 comments on commit bd6ac43

Please sign in to comment.