[asterisk-commits] russell: branch russell/bindings r103322 - in /team/russell/bindings/bindings...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 11 16:03:35 CST 2008


Author: russell
Date: Mon Feb 11 16:03:33 2008
New Revision: 103322

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103322
Log:
directly expose answer/hangup

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=103322&r1=103321&r2=103322
==============================================================================
--- team/russell/bindings/bindings/ast_channel.i (original)
+++ team/russell/bindings/bindings/ast_channel.i Mon Feb 11 16:03:33 2008
@@ -67,4 +67,19 @@
 
         return pbx_exec($self, ast_app, (void *) app_args);
     }
+
+    int answer(void)
+    {
+        int res = 0;
+
+        if ($self->_state != AST_STATE_UP)
+            res = ast_answer($self);
+
+        return res;
+    }
+
+    int hangup(void)
+    {
+        return ast_softhangup($self, AST_SOFTHANGUP_EXPLICIT);
+    }
 };

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=103322&r1=103321&r2=103322
==============================================================================
--- team/russell/bindings/bindings/examples/ast_channel_test.py (original)
+++ team/russell/bindings/bindings/examples/ast_channel_test.py Mon Feb 11 16:03:33 2008
@@ -3,5 +3,9 @@
 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 'Answering ...'
+	chan.answer()
 	print 'Executing Playback of tt-weasels ...'
 	chan.exec_app('Playback', 'tt-weasels')
+	print 'Hanging up ...'
+	chan.hangup()




More information about the asterisk-commits mailing list