summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-12-11 11:18:33 +0000
committerBenny Prijono <bennylp@teluu.com>2008-12-11 11:18:33 +0000
commit1e493f5512415ff4de0beb4903a5bdf5e89941a4 (patch)
tree4b21076a2bdda8c801268cd26f595c6b057b6beb
parente0c99c6af3297030d0618cadbcb2067672fd2c1e (diff)
Ticket #682: New API to register (external) Python thread (thanks Johan Risberg for the patch)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2375 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/python/pjsua.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/pjsip-apps/src/python/pjsua.py b/pjsip-apps/src/python/pjsua.py
index 90dad86b..b49b79a3 100644
--- a/pjsip-apps/src/python/pjsua.py
+++ b/pjsip-apps/src/python/pjsua.py
@@ -2137,6 +2137,20 @@ class Lib:
lck = self.auto_lock()
return _pjsua.handle_events(timeout)
+ def thread_register(self, name):
+ """Register external threads (threads that are not created by PJSIP,
+ such as threads that are created by Python API) to PJSIP.
+
+ The call must be made from the new thread before calling any pjlib
+ functions.
+
+ Keyword arguments:
+ name -- Non descriptive name for the thread
+ """
+ dummy = 1
+ err = _pjsua.thread_register(name, dummy)
+ self._err_check("thread_register()", self, err)
+
def verify_sip_url(self, sip_url):
"""Verify that the specified string is a valid URI.
@@ -2732,9 +2746,6 @@ class Lib:
if buddy:
buddy._cb.on_state()
-
-
-
#
# Internal
#