[svn-commits] russell: branch russell/bindings r103321 - in /team/russell/bindings/bindings...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Feb 11 15:22:00 CST 2008


Author: russell
Date: Mon Feb 11 15:21:58 2008
New Revision: 103321

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103321
Log:
expose executing asterisk applications from python ...

Modified:
    team/russell/bindings/bindings/ast_channel.i
    team/russell/bindings/bindings/examples/ast_channel_test.py

Modified: team/russell/bindings/bindings/ast_channel.i
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/bindings/ast_channel.i?view=diff&rev=103321&r1=103320&r2=103321
==============================================================================
--- team/russell/bindings/bindings/ast_channel.i (original)
+++ team/russell/bindings/bindings/ast_channel.i Mon Feb 11 15:21:58 2008
@@ -3,6 +3,7 @@
 %{
 #include "asterisk.h"
 #include "asterisk/channel.h"
+#include "asterisk/pbx.h"
 
 #include "res_python/res_python.h"
 %}
@@ -56,4 +57,14 @@
     {
         return $self->macropriority;
     }
+
+    int exec_app(const char *app_name, const char *app_args)
+    {
+        struct ast_app *ast_app;
+
+        if (!(ast_app = pbx_findapp(app_name)))
+            return -1;
+
+        return pbx_exec($self, ast_app, (void *) app_args);
+    }
 };

Modified: team/russell/bindings/bindings/examples/ast_channel_test.py
URL: http://svn.digium.com/view/asterisk/team/russell/bindings/bindings/examples/ast_channel_test.py?view=diff&rev=103321&r1=103320&r2=103321
==============================================================================
--- team/russell/bindings/bindings/examples/ast_channel_test.py (original)
+++ team/russell/bindings/bindings/examples/ast_channel_test.py Mon Feb 11 15:21:58 2008
@@ -3,3 +3,5 @@
 def ast_app(chan):
 	print '(ast_channel test) Channel is ' + chan.get_name() + ', currently executing ' \
 		+ chan.get_context() + ',' + chan.get_exten() + ',' + repr(chan.get_priority()) + '.'
+	print 'Executing Playback of tt-weasels ...'
+	chan.exec_app('Playback', 'tt-weasels')




More information about the svn-commits mailing list