[asterisk-scf-commits] asterisk-scf/release/sip.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Oct 5 10:56:22 CDT 2011


branch "master" has been updated
       via  1094f862471a5cdc8955aecca1bbbeebba31b44c (commit)
      from  030ca07ce06155cc17518f07099650ab7b862d4a (commit)

Summary of changes:
 src/Component.cpp    |   10 +++++-----
 src/PJSipManager.cpp |    9 +--------
 2 files changed, 6 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 1094f862471a5cdc8955aecca1bbbeebba31b44c
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Oct 5 12:56:44 2011 -0300

    Only initialize pjlib once.

diff --git a/src/Component.cpp b/src/Component.cpp
index 37e6a7f..0e0a591 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -414,11 +414,6 @@ void Component::onPreInitialize()
 {
     try
     {
-        // Initialize PJSIP
-        // NOTE: Should use PJSipManager::create now.
-        mPJSipManager = PJSipManager::create(getName(), getCommunicator()->getProperties());
-        lg(Debug) << "Created PJSIP manager";
-
         //As nice as it is of IceBox to provide us with a communicator,
         //we're going to create our own so that we can provide it with a threadhook.
         //Yes, this could be done via a plugin, but this is easier. Go away.
@@ -426,6 +421,11 @@ void Component::onPreInitialize()
         id.threadHook = new AsteriskSCF::PJLib::ThreadHook("Ice");
         id.properties = getCommunicator()->getProperties();
 
+        // Initialize PJSIP
+        // NOTE: Should use PJSipManager::create now.
+        mPJSipManager = PJSipManager::create(getName(), getCommunicator()->getProperties());
+        lg(Debug) << "Created PJSIP manager";
+
         setCommunicator(Ice::initialize(id));
     }
     catch(const std::exception& e)
diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index e4f1054..803edac 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -267,13 +267,6 @@ PJSipManager::PJSipManager() :
 {
     memset(&mCachingPool, 0, sizeof(mCachingPool));
 
-    pj_status_t status = pj_init();
-    if (fail(status))
-    {
-        const char* message = "Failed to Initialize PJSIP";
-        logger(Error) << message;
-        throw InternalInitializationException(message);
-    }
     // The third parameter is just copied from
     // example code from PJLIB. This can be adjusted
     // if necessary.
@@ -291,7 +284,7 @@ PJSipManager::PJSipManager() :
         throw InternalInitializationException(message);
     }
     
-    status = pj_thread_create(mMemoryPool, "SIP", (pj_thread_proc *) &monitorThread,
+    pj_status_t status = pj_thread_create(mMemoryPool, "SIP", (pj_thread_proc *) &monitorThread,
         this, PJ_THREAD_DEFAULT_STACK_SIZE * 2, 0, &mPjThread);
     if (fail(status))
     {

-----------------------------------------------------------------------


-- 
asterisk-scf/release/sip.git



More information about the asterisk-scf-commits mailing list