From 53c8d917525f183e9360e9e27b1404ad80ce1322 Mon Sep 17 00:00:00 2001 From: almog cohen Date: Tue, 22 Mar 2016 15:08:48 +0200 Subject: [PATCH] added the EXEC command, which enables running all the possible asterisk commands --- asterisk/agi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/asterisk/agi.py b/asterisk/agi.py index 90ed288..512ed03 100755 --- a/asterisk/agi.py +++ b/asterisk/agi.py @@ -667,6 +667,13 @@ class AGI: """ self.execute('NOOP') + def exec_command(self, command, *args): + """Send an arbitrary asterisk command with args (even not AGI commands)""" + # The arguments of the command should be prepared as comma delimited, that's the way the EXEC works + args = ','.join(map(str, args)) + return self.execute('EXEC', command, args) + + if __name__ == '__main__': agi = AGI() #agi.appexec('festival','Welcome to Klass Technologies. Thank you for calling.')