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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Aug 24 11:11:36 CDT 2010


branch "master" has been updated
       via  24aeed2a0f96bc63db249280eaee7ac999d3fc78 (commit)
       via  011e86908870faed9d432a0c9e445ebc6b947e10 (commit)
       via  6482af1cd7a54a6925dccb8812476325e3dcb3e0 (commit)
       via  d276c836ebd23be21fbd4ecf83d76c4d2ede6d84 (commit)
      from  2b50818d7a9acdb374ed5f37bc1f7e8fd0027531 (commit)

Summary of changes:
 src/PJSipManager.cpp       |    8 +----
 src/PJSipManager.h         |    4 +-
 src/PJSipSessionModule.cpp |   61 ++++++++++++++++++++++++++++++++++++++++---
 src/PJSipSessionModule.h   |    2 +
 4 files changed, 62 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 24aeed2a0f96bc63db249280eaee7ac999d3fc78
Merge: 011e869 2b50818
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 24 11:12:54 2010 -0500

    Merge branch 'master' of git.asterisk.org:asterisk-scf/integration/sip


commit 011e86908870faed9d432a0c9e445ebc6b947e10
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 24 11:11:51 2010 -0500

    Change module priority to application-level.
    
    I need to figure out the order regarding Invite callbacks and
    module callbacks. hopefully we'll get the module callbacks first...

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index badd643..195bc49 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -223,9 +223,7 @@ static pjsip_redirect_op invOnRedirected(pjsip_inv_session *inv, const pjsip_uri
 PJSipModule::PJSipModule()
 {
 	mModule.name = "Session Module";
-	// XXX I'm a bit hazy on whether this should be dialog
-	// usage or application priority.
-	mModule.priority = PJSIP_MOD_PRIORITY_DIALOG_USAGE;
+	mModule.priority = PJSIP_MOD_PRIORITY_APPLICATION;
 	mModule.load = sessionLoad;
 	mModule.start = sessionStart;
 	mModule.stop = sessionStop;

commit 6482af1cd7a54a6925dccb8812476325e3dcb3e0
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 24 11:07:56 2010 -0500

    Add some invite callback stubs.

diff --git a/src/PJSipSessionModule.cpp b/src/PJSipSessionModule.cpp
index 9bed2a9..badd643 100644
--- a/src/PJSipSessionModule.cpp
+++ b/src/PJSipSessionModule.cpp
@@ -179,6 +179,47 @@ static pj_status_t sessionOnTransactionStateChange(pjsip_transaction *tsx, pjsip
 	return PJ_SUCCESS;
 }
 
+static void invOnStateChanged(pjsip_inv_session *inv, pjsip_event *event)
+{
+	//stub
+}
+
+static void invOnNewSession(pjsip_inv_session *inv, pjsip_event *event)
+{
+	//stub
+}
+
+static void invOnTransactionStateChanged(psjip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e)
+{
+	//stub
+}
+
+static void invOnReceiveOffer(pjsip_inv_session *inv, const pjmedia_sdp_session *offer)
+{
+	//stub
+}
+
+static void invOnCreateOffer(pjsip_inv_session *inv, pjmedia_sdp_session **p_offer)
+{
+	//stub
+}
+
+static void invOnMediaUpdate(pjsip_inv_session *inv, pj_status_t status)
+{
+	//stub
+}
+
+static void invOnSendAck(pjsip_inv_session *inv, pjsip_rx_data *rdata)
+{
+	//stub
+}
+
+static pjsip_redirect_op invOnRedirected(pjsip_inv_session *inv, const pjsip_uri *target, const pjsip_event *e)
+{
+	//stub
+	return PJ_SIP_REDIRECT_REJECT;
+}
+
 PJSipModule::PJSipModule()
 {
 	mModule.name = "Session Module";
@@ -195,10 +236,22 @@ PJSipModule::PJSipModule()
 	mModule.on_tx_response = sessionOnTramsmitResponse;
 	mModule.on_tx_response = sessionOnTramsmitResponse;
 	mModule.on_tsx_state = sessionOnTransactionStateChange;
+
+	if (pjsip_inv_usage_instance() == -1)
+	{
+		pj_bzero(&mInvCallback, sizeof(&mInvCallback));
+		mInvCallback.on_state_changed = invOnStateChanged;
+		mInvCallback.on_new_session = invOnNewSession;
+		mInvCallback.on_tsx_state_changed = invOnTransactionStateChanged;
+		mInvCallback.on_rx_offer = invOnReceiveOffer;
+		mInvCallback.on_create_offer = invOnCreateOffer;
+		mInvCallback.on_media_update = invOnMediaUpdate;
+		mInvCallback.on_send_ack = invOnSendAck;
+		mInvCallback.on_redirected = invOnRedirected;
+	}
 	
 	Boost::shared_ptr<PJSipManager> manager = PJSipManager::getInstance();
-	pjsip_endpoint *endpt = manager.getEndpoint();
-	pjsip_endpt_register_module(endpt, &mModule);
+	manager.registerModule(mModule);
 }
 
 }; //end namespace SipChannelService
diff --git a/src/PJSipSessionModule.h b/src/PJSipSessionModule.h
index b497837..307cf24 100644
--- a/src/PJSipSessionModule.h
+++ b/src/PJSipSessionModule.h
@@ -10,6 +10,8 @@ public:
 	PJSipSessionModule();
 private:
 	pjsip_module mModule;
+	pjsip_inv_callback mInvCallback;
+	pjsip_ua_init_param mUaParam;
 };
 
 }; //end namespace SipChannelService

commit d276c836ebd23be21fbd4ecf83d76c4d2ede6d84
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Aug 24 09:43:35 2010 -0500

    Switch up PJSipManager to use boost::shared_ptr.

diff --git a/src/PJSipManager.cpp b/src/PJSipManager.cpp
index 398d5fd..4240e89 100644
--- a/src/PJSipManager.cpp
+++ b/src/PJSipManager.cpp
@@ -8,7 +8,7 @@ namespace Hydra
 namespace SIP
 {
 
-PJSipManager *PJSipManager::mInstance = 0;
+boost::shared_ptr<PJSipManager> PJSipManager::mInstance(new PJSipManager);
 
 static void *monitorThread(void *endpt)
 {
@@ -27,12 +27,8 @@ static void *monitorThread(void *endpt)
 	return NULL;
 }
 
-PJSipManager *PJSipManager::getInstance()
+boost::shared_ptr<PJSipManager> PJSipManager::getInstance()
 {
-	if (mInstance == 0)
-	{
-		mInstance = new PJSipManager;
-	}
 	return mInstance;
 }
 
diff --git a/src/PJSipManager.h b/src/PJSipManager.h
index 33e09a5..f8e9e8b 100644
--- a/src/PJSipManager.h
+++ b/src/PJSipManager.h
@@ -27,7 +27,7 @@ public:
 	/**
 	 * Get the singleton PJSipManager instance
 	 */
-	static PJSipManager *getInstance();
+	static boost::shared_ptr<PJSipManager> getInstance();
 	/**
 	 * Get a handle to the PJSipEndpoint for operations
 	 * that may require it
@@ -50,7 +50,7 @@ public:
 protected:
 	PJSipManager();
 private:
-	static PJSipManager* mInstance;
+	static boost::shared_ptr<PJSipManager> mInstance;
 	pjsip_endpoint *mEndpoint;
 	std::vector<pjsip_module *> mModules;
 	pj_thread_t *mPjThread;

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


-- 
asterisk-scf/integration/sip.git



More information about the asterisk-scf-commits mailing list